Release #11
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: "Specific version to release (e.g. 1.2.3), or leave empty for auto-detect from conventional commits" | |
| required: false | |
| type: string | |
| jobs: | |
| release: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| actions: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| fetch-depth: 0 | |
| - name: Determine next version (auto) | |
| if: inputs.version == '' | |
| id: semver | |
| uses: ietf-tools/semver-action@v1 | |
| with: | |
| token: ${{ github.token }} | |
| noVersionBumpBehavior: patch | |
| noNewCommitBehavior: patch | |
| - name: Validate manual version | |
| if: inputs.version != '' | |
| run: | | |
| if ! echo "${{ inputs.version }}" | grep -qE '^[0-9]+\.[0-9]+\.[0-9]+$'; then | |
| echo "::error::Invalid version format '${{ inputs.version }}'. Expected X.Y.Z" | |
| exit 1 | |
| fi | |
| - name: Create tag | |
| env: | |
| VERSION: ${{ inputs.version != '' && inputs.version || steps.semver.outputs.nextStrict }} | |
| run: | | |
| git tag "$VERSION" | |
| git push origin "$VERSION" | |
| - name: Generate release notes | |
| id: changelog | |
| uses: requarks/changelog-action@v1 | |
| with: | |
| token: ${{ github.token }} | |
| tag: ${{ inputs.version != '' && inputs.version || steps.semver.outputs.nextStrict }} | |
| writeToFile: false | |
| useGitmojis: false | |
| excludeTypes: "" | |
| includeInvalidCommits: true | |
| - name: Create release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ inputs.version != '' && inputs.version || steps.semver.outputs.nextStrict }} | |
| body: ${{ steps.changelog.outputs.changes }} | |
| - name: Trigger npm publish | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| VERSION: ${{ inputs.version != '' && inputs.version || steps.semver.outputs.nextStrict }} | |
| run: gh workflow run npm-publish.yml --ref "$VERSION" -f version="$VERSION" | |
| - name: Trigger Homebrew release | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| VERSION: ${{ inputs.version != '' && inputs.version || steps.semver.outputs.nextStrict }} | |
| run: gh workflow run homebrew-release.yml --ref "$VERSION" -f version="$VERSION" |