|
17 | 17 | # ensures this only runs if the PR was actually merged, not just closed unmerged |
18 | 18 | if: github.event.pull_request.merged == true |
19 | 19 | runs-on: ubuntu-latest |
20 | | - env: |
21 | | - # toggle to 'false' to only push the tag and skip creating the GitHub Release |
22 | | - CREATE_RELEASE: 'true' |
23 | 20 | outputs: |
| 21 | + type: ${{ steps.parse.outputs.type }} |
24 | 22 | version: ${{ steps.increment.outputs.version }} |
25 | 23 | steps: |
26 | 24 | - name: ⚡ Checkout repository ⚡ |
@@ -74,21 +72,33 @@ jobs: |
74 | 72 |
|
75 | 73 | NEXT_VERSION="${MAJOR}.${MINOR}.${PATCH}" |
76 | 74 | echo "version=$NEXT_VERSION" >> "$GITHUB_OUTPUT" |
| 75 | + publish: |
| 76 | + name: Publish Release |
| 77 | + needs: |
| 78 | + - release |
| 79 | + |
| 80 | + if: needs.release.outputs.type != 'none' |
| 81 | + runs-on: ubuntu-latest |
| 82 | + env: |
| 83 | + # toggle to 'false' to only push the tag and skip creating the GitHub Release |
| 84 | + CREATE_RELEASE: 'true' |
| 85 | + steps: |
| 86 | + - name: ⚡ Checkout repository ⚡ |
| 87 | + uses: actions/checkout@v6 |
77 | 88 |
|
78 | 89 | - name: ⚡ Create tag ⚡ |
79 | | - if: steps.parse.outputs.type != 'none' |
80 | 90 | run: | |
81 | 91 | git config user.name "rarest automation" |
82 | 92 | git config user.email "automation@noreply.rarestype.com" |
83 | 93 |
|
84 | | - git tag "${{ steps.increment.outputs.version }}" |
85 | | - git push origin "${{ steps.increment.outputs.version }}" |
| 94 | + git tag "${{ needs.release.outputs.version }}" |
| 95 | + git push origin "${{ needs.release.outputs.version }}" |
86 | 96 |
|
87 | 97 | - name: ⚡ Create release ⚡ |
88 | | - if: steps.parse.outputs.type != 'none' && env.CREATE_RELEASE == 'true' |
| 98 | + if: env.CREATE_RELEASE == 'true' |
89 | 99 | run: | |
90 | | - gh release create "${{ steps.increment.outputs.version }}" \ |
91 | | - --title "${{ steps.increment.outputs.version }}" \ |
| 100 | + gh release create "${{ needs.release.outputs.version }}" \ |
| 101 | + --title "${{ needs.release.outputs.version }}" \ |
92 | 102 | --generate-notes |
93 | 103 | env: |
94 | 104 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
0 commit comments