Merge pull request #9 from Frederisk/add-args #21
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Release Action | |
| on: | |
| push: | |
| branches: [main, master] | |
| tags: ['v*.*.*'] | |
| permissions: | |
| contents: write | |
| jobs: | |
| test: | |
| uses: ./.github/workflows/test.yml | |
| secrets: inherit | |
| build-and-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Code | |
| uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Delete Old Development Release & Tag | |
| if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| gh release delete development --cleanup-tag -y || true | |
| - name: Update Development Tag | |
| if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' | |
| run: | | |
| git tag -f development | |
| git push origin development --force | |
| - name: Publish Development Pre-release | |
| if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| tag_name: development | |
| name: 'Development Pre-release' | |
| prerelease: true | |
| generate_release_notes: true | |
| - name: Publish Official Release | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| prerelease: false | |
| generate_release_notes: true | |
| - name: Update Major Version Tag | |
| if: startsWith(github.ref, 'refs/tags/v') | |
| run: | | |
| TAG_NAME=${GITHUB_REF#refs/tags/} | |
| MAJOR_VERSION=$(echo $TAG_NAME | cut -d. -f1) | |
| git tag -f $MAJOR_VERSION | |
| git push -f origin $MAJOR_VERSION |