release.yml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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@v4
  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 release
  37. uses: ncipollo/release-action@v1
  38. with:
  39. bodyFile: ${{ steps.body.outputs.filename }}
  40. name: ArduinoJson ${{ steps.init.outputs.version }}
  41. artifacts: ${{ steps.amalgamate_h.outputs.filename }},${{ steps.amalgamate_hpp.outputs.filename }}
  42. token: ${{ secrets.GITHUB_TOKEN }}
  43. idf:
  44. name: IDF Component Registry
  45. runs-on: ubuntu-latest
  46. steps:
  47. - name: Checkout
  48. uses: actions/checkout@v4
  49. - name: Upload component to the component registry
  50. uses: espressif/upload-components-ci-action@v1
  51. with:
  52. name: ArduinoJson
  53. namespace: bblanchon
  54. api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
  55. particle:
  56. name: Particle
  57. runs-on: ubuntu-latest
  58. steps:
  59. - name: Install
  60. run: npm install -g particle-cli particle-usb
  61. - name: Checkout
  62. uses: actions/checkout@v4
  63. - name: Login
  64. run: particle login --token ${{ secrets.PARTICLE_TOKEN }}
  65. - name: Publish
  66. run: bash -eux extras/scripts/publish-particle-library.sh
  67. platformio:
  68. name: PlatformIO
  69. runs-on: ubuntu-latest
  70. steps:
  71. - name: Set up Python 3.x
  72. uses: actions/setup-python@v5
  73. with:
  74. python-version: "3.x"
  75. - name: Install PlatformIO
  76. run: pip install platformio
  77. - name: Checkout
  78. uses: actions/checkout@v4
  79. - name: Publish
  80. run: pio pkg publish --no-interactive --no-notify
  81. env:
  82. PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }}