Release: v0.7.67 #111
Workflow file for this run
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: Create Release | |
| # Trigger when a new tag matching the pattern is created and pushed | |
| on: | |
| push: | |
| tags: | |
| - 'v*.*.*' | |
| jobs: | |
| create-release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Extract version from tag | |
| id: version | |
| run: | | |
| TAG=${GITHUB_REF#refs/tags/} | |
| VERSION=${TAG#v} | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| echo "tag=$TAG" >> $GITHUB_OUTPUT | |
| echo "Extracted version: $VERSION from tag: $TAG" | |
| - name: Fetch tag annotation | |
| run: | | |
| TAG="${{ steps.version.outputs.tag }}" | |
| git fetch origin tag "$TAG" --no-tags | |
| env: | |
| GIT_TERMINAL_PROMPT: 0 | |
| - name: Get tag message | |
| id: tag_message | |
| run: | | |
| TAG="${{ steps.version.outputs.tag }}" | |
| TAG_MESSAGE=$(git tag -l --format='%(contents)' "$TAG" 2>/dev/null || echo "") | |
| if [ -z "$TAG_MESSAGE" ]; then | |
| TAG_MESSAGE="Release $TAG" | |
| fi | |
| DELIM="EOF_$(date +%s)_$RANDOM" | |
| echo "message<<$DELIM" >> $GITHUB_OUTPUT | |
| printf '%s\n' "$TAG_MESSAGE" >> $GITHUB_OUTPUT | |
| echo "$DELIM" >> $GITHUB_OUTPUT | |
| - name: Create GitHub Release | |
| run: | | |
| TAG="${{ steps.version.outputs.tag }}" | |
| REPO="${{ github.repository }}" | |
| echo "${{ steps.tag_message.outputs.message }}" > release_notes.txt | |
| echo "${{ secrets.PAT_TOKEN || secrets.GITHUB_TOKEN }}" | gh auth login --with-token | |
| if gh release view "$TAG" --repo "$REPO" &>/dev/null; then | |
| echo "Release $TAG already exists, skipping creation" | |
| exit 0 | |
| fi | |
| gh release create "$TAG" \ | |
| --repo "$REPO" \ | |
| --title "Release $TAG" \ | |
| --notes-file release_notes.txt | |
| echo "✓ Release $TAG created successfully" | |