release.yml 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. name: Release
  2. on:
  3. push:
  4. tags:
  5. - v*.*.*
  6. jobs:
  7. release:
  8. name: Create release
  9. runs-on: ubuntu-22.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@v4
  18. - name: Write release body
  19. id: body
  20. run: |
  21. FILENAME=RELEASE.md
  22. tee $FILENAME <<END
  23. ## Changes
  24. $(extras/scripts/extract_changes.awk CHANGELOG.md)
  25. [View version history](https://github.com/bblanchon/ArduinoJson/blob/${{ steps.init.outputs.tag }}/CHANGELOG.md)
  26. END
  27. echo "filename=$FILENAME" >> $GITHUB_OUTPUT
  28. - name: Amalgamate ArduinoJson.h
  29. id: amalgamate_h
  30. run: |
  31. FILENAME=ArduinoJson-${{ steps.init.outputs.tag }}.h
  32. extras/scripts/build-single-header.sh src/ArduinoJson.h "$FILENAME"
  33. echo "filename=$FILENAME" >> $GITHUB_OUTPUT
  34. - name: Amalgamate ArduinoJson.hpp
  35. id: amalgamate_hpp
  36. run: |
  37. FILENAME=ArduinoJson-${{ steps.init.outputs.tag }}.hpp
  38. extras/scripts/build-single-header.sh src/ArduinoJson.hpp "$FILENAME"
  39. echo "filename=$FILENAME" >> $GITHUB_OUTPUT
  40. - name: Create release
  41. uses: ncipollo/release-action@v1
  42. with:
  43. bodyFile: ${{ steps.body.outputs.filename }}
  44. name: ArduinoJson ${{ steps.init.outputs.version }}
  45. artifacts: ${{ steps.amalgamate_h.outputs.filename }},${{ steps.amalgamate_hpp.outputs.filename }}
  46. token: ${{ secrets.GITHUB_TOKEN }}
  47. idf:
  48. name: IDF Component Registry
  49. runs-on: ubuntu-latest
  50. steps:
  51. - name: Checkout
  52. uses: actions/checkout@v4
  53. - name: Upload component to the component registry
  54. uses: espressif/upload-components-ci-action@v1
  55. with:
  56. name: ArduinoJson
  57. namespace: bblanchon
  58. api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
  59. particle:
  60. name: 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@v4
  67. - name: Login
  68. run: particle login --token ${{ secrets.PARTICLE_TOKEN }}
  69. - name: Publish
  70. run: bash -eux extras/scripts/publish-particle-library.sh
  71. platformio:
  72. name: PlatformIO
  73. runs-on: ubuntu-latest
  74. steps:
  75. - name: Set up Python 3.x
  76. uses: actions/setup-python@v5
  77. with:
  78. python-version: "3.x"
  79. - name: Install PlatformIO
  80. run: pip install platformio
  81. - name: Checkout
  82. uses: actions/checkout@v4
  83. - name: Publish
  84. run: pio pkg publish --no-interactive --no-notify
  85. env:
  86. PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }}