Release 0.2.2.0 #6
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: Publish GitHub Release | |
| on: | |
| push: | |
| tags: | |
| - "v*" | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: "Tag to release, for example v1.2.3" | |
| required: true | |
| permissions: | |
| contents: write | |
| jobs: | |
| create-release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Resolve tag | |
| id: tag | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| TAG="${{ github.event.inputs.tag }}" | |
| else | |
| TAG="${GITHUB_REF#refs/tags/}" | |
| fi | |
| echo "tag=${TAG}" >> "$GITHUB_OUTPUT" | |
| - name: Validate 3-point version tag | |
| id: validate | |
| run: | | |
| TAG="${{ steps.tag.outputs.tag }}" | |
| if ! echo "$TAG" | grep -Eq '^v[0-9]+\.[0-9]+\.[0-9]+$'; then | |
| echo "Skipping release creation: tag is not 3-point (vX.Y.Z): $TAG" | |
| echo "is_three_point=false" >> "$GITHUB_OUTPUT" | |
| exit 0 | |
| fi | |
| echo "is_three_point=true" >> "$GITHUB_OUTPUT" | |
| - name: Checkout | |
| if: steps.validate.outputs.is_three_point == 'true' | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Create GitHub release | |
| if: steps.validate.outputs.is_three_point == 'true' | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| run: | | |
| TAG="${{ steps.tag.outputs.tag }}" | |
| if gh release view "$TAG" >/dev/null 2>&1; then | |
| echo "Release already exists for $TAG" | |
| exit 0 | |
| fi | |
| gh release create "$TAG" \ | |
| --title "$TAG" \ | |
| --generate-notes |