Skip to content

crustacean-dev/release-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Release Action

A composite GitHub Action that automates semantic versioning releases for GitHub Actions.

Given a package.json with a valid semver version, it:

  1. Creates an exact version tag (v1.2.3)
  2. Moves floating minor (v1.2) and major (v1) tags to the latest SHA
  3. Publishes a GitHub Release with auto-generated notes

If the exact version tag already exists, the action skips gracefully.

Usage

- uses: crustacean-dev/release-action@v1
  with:
    github-token: ${{ secrets.GITHUB_TOKEN }}

Inputs

Name Required Description
github-token Yes Token for the GitHub API

Self-hosted release workflow

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

How it works

  • Version source: read from package.json via 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 create with --generate-notes

License

MIT

About

Package and publish your GitHub Actions effortlessly

Topics

Resources

License

Stars

Watchers

Forks

Contributors