no verify tag #4
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: Auto Release from Changelog | |
| on: | |
| push: | |
| branches: | |
| - main | |
| # paths: | |
| # - 'CHANGELOG.md' | |
| jobs: | |
| create-release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Parse Changelog | |
| id: changelog | |
| run: python3 .github/scripts/parse_changelog.py | |
| - name: Check if release exists | |
| id: check_release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| TAG="${{ steps.changelog.outputs.tag }}" | |
| if gh release view "$TAG" &>/dev/null; then | |
| echo "Release $TAG already exists" | |
| echo "exists=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "Release $TAG does not exist" | |
| echo "exists=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Create Release | |
| if: steps.check_release.outputs.exists == 'false' | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| TAG="${{ steps.changelog.outputs.tag }}" | |
| VERSION="${{ steps.changelog.outputs.version }}" | |
| gh release create "$TAG" \ | |
| --title "Release $VERSION" \ | |
| --notes-file release_body.txt | |
| - name: Skip Release | |
| if: steps.check_release.outputs.exists == 'true' | |
| run: | | |
| echo "Release ${{ steps.changelog.outputs.tag }} already exists. Skipping creation." |