|
51 | 51 | with: |
52 | 52 | name: ${{ matrix.file }} |
53 | 53 | path: dist/${{ matrix.file }} |
| 54 | + |
| 55 | + tagged-release: |
| 56 | + needs: build |
| 57 | + runs-on: ubuntu-latest |
| 58 | + if: startsWith(github.ref, 'refs/tags/') |
| 59 | + steps: |
| 60 | + - uses: actions/checkout@v4 |
| 61 | + |
| 62 | + # Download the dist folder from the build job |
| 63 | + - name: Download build artifacts |
| 64 | + uses: actions/download-artifact@v4 |
| 65 | + with: |
| 66 | + name: dist |
| 67 | + path: dist |
| 68 | + |
| 69 | + # Create GitHub Release for the tag |
| 70 | + - name: Create GitHub Release |
| 71 | + id: create_release |
| 72 | + uses: actions/create-release@v1 |
| 73 | + with: |
| 74 | + tag_name: ${{ github.ref_name }} |
| 75 | + release_name: Release ${{ github.ref_name }} |
| 76 | + draft: false |
| 77 | + prerelease: false |
| 78 | + env: |
| 79 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 80 | + |
| 81 | + # Upload each zip as a release asset |
| 82 | + - name: Upload release assets |
| 83 | + run: | |
| 84 | + for zip in dist/*.zip; do |
| 85 | + echo "Uploading $zip..." |
| 86 | + gh release upload ${{ github.ref_name }} "$zip" |
| 87 | + done |
| 88 | + env: |
| 89 | + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 90 | + |
| 91 | + push-changelog: |
| 92 | + name: "Push Change Log" |
| 93 | + needs: tagged-release |
| 94 | + runs-on: ubuntu-latest |
| 95 | + env: |
| 96 | + TAG_NAME: ${{ github.event.inputs.tag || github.ref_name }} |
| 97 | + steps: |
| 98 | + - name: Checkout Source |
| 99 | + uses: actions/checkout@v4 |
| 100 | + with: |
| 101 | + fetch-depth: 0 |
| 102 | + |
| 103 | + - name: Save commits to change log |
| 104 | + run: git log $(git describe --tags --abbrev=0 @^ 2> /dev/null)..@ --oneline > CHANGE.log |
| 105 | + |
| 106 | + - name: Upload Change Log |
| 107 | + uses: actions/upload-artifact@v4 |
| 108 | + with: |
| 109 | + name: CHANGE.log |
| 110 | + path: CHANGE.log |
| 111 | + |
| 112 | + - name: Push Change log to Release |
| 113 | + uses: softprops/action-gh-release@v1 |
| 114 | + with: |
| 115 | + tag_name: ${{ env.TAG_NAME }} |
| 116 | + files: CHANGE.log |
0 commit comments