A composite GitHub Action that automates semantic versioning releases for GitHub Actions.
Given a package.json with a valid semver version, it:
- Creates an exact version tag (
v1.2.3) - Moves floating minor (
v1.2) and major (v1) tags to the latest SHA - Publishes a GitHub Release with auto-generated notes
If the exact version tag already exists, the action skips gracefully.
- uses: crustacean-dev/release-action@v1
with:
github-token: ${{ secrets.GITHUB_TOKEN }}| Name | Required | Description |
|---|---|---|
github-token |
Yes | Token for the GitHub API |
This repo ships with a workflow_dispatch workflow that bumps package.json, commits, and then invokes itself:
# .github/workflows/release.yml
on:
workflow_dispatch:
inputs:
bump:
type: choice
options: [patch, minor, major]Trigger it from the GitHub UI or CLI:
gh workflow run release.yml -f bump=patch- Version source: read from
package.jsonvia Node (node -p "require('./package.json').version") - Tag check: uses the GitHub API to verify the exact tag doesn't already exist before proceeding
- Floating tags: minor and major tags are force-updated (PATCH) or created (POST) to always point at the latest release in their range
- Release: created via
gh release createwith--generate-notes