Release v0.0.3 #3
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: | |
| workflow_dispatch: | |
| inputs: | |
| version: | |
| description: "Semver version (e.g. 0.1.0)" | |
| required: true | |
| permissions: | |
| contents: write | |
| run-name: Release v${{ github.event.inputs.version }} | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Configure git | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| - name: Validate version | |
| run: | | |
| VERSION="${{ github.event.inputs.version }}" | |
| if ! [[ "$VERSION" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then | |
| echo "❌ Invalid version: $VERSION" | |
| exit 1 | |
| fi | |
| - name: Set up git-cliff | |
| uses: kenji-miyake/setup-git-cliff@v2 | |
| - name: Install just | |
| uses: extractions/setup-just@v2 | |
| - name: Create release tag and commit | |
| run: | | |
| VERSION="${{ github.event.inputs.version}}" | |
| echo "Creating release v$VERSION..." | |
| just tag $VERSION | |
| git push origin HEAD:main | |
| git push origin v$VERSION | |
| echo "✓ Release v$VERSION created and pushed" | |
| - name: Generate release notes | |
| id: changelog | |
| run: | | |
| VERSION="${{ github.event.inputs.version }}" | |
| git cliff --latest --strip all --output RELEASE_NOTES.md | |
| echo "Generated release notes for v$VERSION" | |
| - name: Create GitHub Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: v${{ github.event.inputs.version }} | |
| name: v${{ github.event.inputs.version }} | |
| body_path: RELEASE_NOTES.md | |
| draft: false | |
| prerelease: false | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |