release.yml 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. name: Release
  2. on:
  3. push:
  4. tags:
  5. - v*.*.*
  6. jobs:
  7. release:
  8. name: Create release
  9. runs-on: ubuntu-20.04
  10. steps:
  11. - name: Set variables
  12. id: init
  13. run: |
  14. echo "tag=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
  15. echo "version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
  16. - name: Checkout
  17. uses: actions/checkout@v3
  18. - name: Write release body
  19. id: body
  20. run: |
  21. FILENAME=RELEASE.md
  22. extras/scripts/get-release-body.sh ${{ steps.init.outputs.tag }} CHANGELOG.md | tee $FILENAME
  23. echo "filename=$FILENAME" >> $GITHUB_OUTPUT
  24. - name: Amalgamate ArduinoJson.h
  25. id: amalgamate_h
  26. run: |
  27. FILENAME=ArduinoJson-${{ steps.init.outputs.tag }}.h
  28. extras/scripts/build-single-header.sh src/ArduinoJson.h "$FILENAME"
  29. echo "filename=$FILENAME" >> $GITHUB_OUTPUT
  30. - name: Amalgamate ArduinoJson.hpp
  31. id: amalgamate_hpp
  32. run: |
  33. FILENAME=ArduinoJson-${{ steps.init.outputs.tag }}.hpp
  34. extras/scripts/build-single-header.sh src/ArduinoJson.hpp "$FILENAME"
  35. echo "filename=$FILENAME" >> $GITHUB_OUTPUT
  36. - name: Create Arduino package
  37. id: arduino
  38. run: |
  39. FILENAME=ArduinoJson-${{ steps.init.outputs.tag }}.zip
  40. extras/scripts/build-arduino-package.sh . "$FILENAME"
  41. echo "filename=$FILENAME" >> $GITHUB_OUTPUT
  42. - name: Create release
  43. uses: ncipollo/release-action@v1
  44. with:
  45. bodyFile: ${{ steps.body.outputs.filename }}
  46. name: ArduinoJson ${{ steps.init.outputs.version }}
  47. artifacts: ${{ steps.amalgamate_h.outputs.filename }},${{ steps.amalgamate_hpp.outputs.filename }},${{ steps.arduino.outputs.filename }}
  48. token: ${{ secrets.GITHUB_TOKEN }}
  49. idf:
  50. runs-on: ubuntu-latest
  51. steps:
  52. - name: Checkout
  53. uses: actions/checkout@v3
  54. - name: Upload component to the component registry
  55. uses: espressif/upload-components-ci-action@v1
  56. with:
  57. name: ArduinoJson
  58. namespace: bblanchon
  59. api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
  60. particle:
  61. runs-on: ubuntu-latest
  62. steps:
  63. - name: Install
  64. run: npm install -g particle-cli
  65. - name: Checkout
  66. uses: actions/checkout@v3
  67. - name: Login
  68. run: particle login --token ${{ secrets.PARTICLE_TOKEN }}
  69. - name: Publish
  70. run: extras/scripts/publish-particle-library.sh