prepare-release.yml 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. name: Prepare Release
  2. on:
  3. workflow_dispatch:
  4. push:
  5. tags:
  6. - 'v*'
  7. permissions:
  8. contents: read
  9. jobs:
  10. prepare:
  11. permissions:
  12. contents: write # for softprops/action-gh-release to create GitHub release
  13. runs-on: ubuntu-latest
  14. strategy:
  15. matrix:
  16. node-version: [22]
  17. steps:
  18. - uses: actions/checkout@v4
  19. - name: Use Node.js ${{ matrix.node-version }}
  20. uses: actions/setup-node@v4
  21. with:
  22. node-version: ${{ matrix.node-version }}
  23. registry-url: 'https://registry.npmjs.org'
  24. cache: 'npm'
  25. - name: Install dependencies
  26. run: npm install
  27. - name: Test
  28. run: npm test
  29. - name: Resolve version
  30. id: vars
  31. run: |
  32. echo "TAG_NAME=$(git describe --tags --abbrev=0)" >> $GITHUB_ENV
  33. - name: Get release notes
  34. run: |
  35. RELEASE_NOTES=$(npm run release-notes --silent)
  36. echo "RELEASE_NOTES<<EOF" >> $GITHUB_ENV
  37. echo "$RELEASE_NOTES" >> $GITHUB_ENV
  38. echo "EOF" >> $GITHUB_ENV
  39. - name: Release
  40. uses: softprops/action-gh-release@v1
  41. with:
  42. draft: true
  43. tag_name: ${{ env.TAG_NAME }}
  44. body: ${{ env.RELEASE_NOTES }}