chore(release): bump version to 0.6.0 #10
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: Release | |
| on: | |
| push: | |
| tags: | |
| - "[0-9]+.[0-9]+.[0-9]+" | |
| - "[0-9]+.[0-9]+.[0-9]+-*" | |
| workflow_dispatch: | |
| inputs: | |
| tag: | |
| description: "Tag to release (e.g., 1.0.0). If empty, uses current commit." | |
| required: false | |
| type: string | |
| permissions: | |
| contents: write | |
| jobs: | |
| #============================================================================ | |
| # Create release | |
| #============================================================================ | |
| create-release: | |
| name: Create Release | |
| runs-on: ubuntu-latest | |
| outputs: | |
| tag: ${{ steps.tag.outputs.tag }} | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.event.inputs.tag || github.ref }} | |
| fetch-depth: 0 # Fetch all history and tags | |
| - name: Extract tag name | |
| id: tag | |
| run: | | |
| if [ -n "${{ github.event.inputs.tag }}" ]; then | |
| TAG="${{ github.event.inputs.tag }}" | |
| else | |
| TAG="${GITHUB_REF#refs/tags/}" | |
| fi | |
| echo "tag=$TAG" >> $GITHUB_OUTPUT | |
| echo "Creating release for tag: $TAG" | |
| # Get previous release tag (excludes pre-releases like -rc1, -alpha, etc.) | |
| PREV_TAG=$(git tag --sort=-v:refname | grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' | grep -v "^$TAG$" | head -1) | |
| echo "prev_tag=$PREV_TAG" >> $GITHUB_OUTPUT | |
| echo "Previous release tag: $PREV_TAG" | |
| # Create GitHub-compatible anchor for CHANGELOG link | |
| # GitHub converts "## [X.Y.Z] - YYYY-MM-DD" to "#xyz---yyyy-mm-dd" | |
| ANCHOR=$(echo "$TAG" | sed 's/\.//g') | |
| DATE=$(date -u +%Y-%m-%d) | |
| FULL_ANCHOR="${ANCHOR}---${DATE}" | |
| echo "anchor=$FULL_ANCHOR" >> $GITHUB_OUTPUT | |
| echo "Changelog anchor: #$FULL_ANCHOR" | |
| - name: Verify tag format | |
| run: | | |
| TAG="${{ steps.tag.outputs.tag }}" | |
| if [[ ! "$TAG" =~ ^[0-9]+\.[0-9]+\.[0-9]+(-[a-zA-Z0-9]+)?$ ]]; then | |
| echo "::warning::Tag '$TAG' doesn't follow semantic versioning (X.Y.Z)" | |
| fi | |
| - name: Create Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.tag.outputs.tag }} | |
| name: nfx-datetime ${{ steps.tag.outputs.tag }} | |
| draft: true | |
| prerelease: false | |
| generate_release_notes: true | |
| fail_on_unmatched_files: false | |
| body: | | |
| nfx-datetime ${{ steps.tag.outputs.tag }} has been released. | |
| 📜 [Changelog](https://github.com/${{ github.repository }}/blob/main/CHANGELOG.md#${{ steps.tag.outputs.anchor }}) |