release.yml 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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 ::set-output name=tag::${GITHUB_REF#refs/tags/}
  15. echo ::set-output name=version::${GITHUB_REF#refs/tags/v}
  16. - name: Checkout
  17. uses: actions/checkout@v2
  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 ::set-output name=filename::$FILENAME
  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 ::set-output name=filename::$FILENAME
  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 ::set-output name=filename::$FILENAME
  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 ::set-output name=filename::$FILENAME
  42. - name: Create release
  43. uses: ncipollo/release-action@v1
  44. with:
  45. bodyFile: ${{ steps.body.outputs.filename }}
  46. draft: true
  47. name: ArduinoJson ${{ steps.init.outputs.version }}
  48. artifacts: ${{ steps.amalgamate_h.outputs.filename }},${{ steps.amalgamate_hpp.outputs.filename }},${{ steps.arduino.outputs.filename }}
  49. token: ${{ secrets.GITHUB_TOKEN }}