release.yml 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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. name: IDF Component Registry
  51. runs-on: ubuntu-latest
  52. steps:
  53. - name: Checkout
  54. uses: actions/checkout@v3
  55. - name: Upload component to the component registry
  56. uses: espressif/upload-components-ci-action@v1
  57. with:
  58. name: ArduinoJson
  59. namespace: bblanchon
  60. api_token: ${{ secrets.IDF_COMPONENT_API_TOKEN }}
  61. particle:
  62. name: Particle
  63. runs-on: ubuntu-latest
  64. steps:
  65. - name: Install
  66. run: npm install -g particle-cli
  67. - name: Checkout
  68. uses: actions/checkout@v3
  69. - name: Login
  70. run: particle login --token ${{ secrets.PARTICLE_TOKEN }}
  71. timeout-minutes: 1
  72. - name: Publish
  73. run: bash -eux extras/scripts/publish-particle-library.sh
  74. timeout-minutes: 5
  75. platformio:
  76. name: PlatformIO
  77. runs-on: ubuntu-latest
  78. steps:
  79. - name: Set up Python 3.x
  80. uses: actions/setup-python@v4
  81. with:
  82. python-version: "3.x"
  83. - name: Install PlatformIO
  84. run: pip install platformio
  85. - name: Checkout
  86. uses: actions/checkout@v3
  87. - name: Publish
  88. run: pio pkg publish --no-interactive --no-notify
  89. env:
  90. PLATFORMIO_AUTH_TOKEN: ${{ secrets.PLATFORMIO_AUTH_TOKEN }}