Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
4bec90f
feat: add prepare release workflow
leoweyr Mar 20, 2026
20daca8
feat: add publish release workflow
leoweyr Mar 20, 2026
047bf99
feat: add user-facing workflows
leoweyr Mar 20, 2026
e48851c
chore: move reusable workflows to src
leoweyr Mar 20, 2026
4b667a0
feat: add change log config
leoweyr Mar 20, 2026
7e15921
docs: update readme with usage instructions
leoweyr Mar 20, 2026
04e730f
chore: add icon
leoweyr Mar 20, 2026
e81214e
docs(readme): add banner
leoweyr Mar 20, 2026
2ad0a73
chore: correct eye perspective in icon
leoweyr Mar 20, 2026
0b0676e
fix: move reusable workflows back to .github/workflows directory
leoweyr Mar 20, 2026
456d0c9
fix: add missing reusable release workflows
leoweyr Mar 20, 2026
8d2afaa
fix: rename reserved GITHUB_TOKEN secret in reusable workflows
leoweyr Mar 20, 2026
7aef3e8
fix: correct git-cliff config path to prevent fallback to default
leoweyr Mar 20, 2026
dd5ada5
fix: ensure revert commits follow conventional format in changelog
leoweyr Mar 22, 2026
b912f9e
release: v1.0.0
github-actions[bot] Mar 20, 2026
1eaef1a
fix: prioritize revert commits parsing to prevent misclassification a…
leoweyr Mar 22, 2026
167d2d0
fix: use type field to correctly classify revert commits in change log
leoweyr Mar 22, 2026
026c69b
fix: preserve original type/scope in revert commit preprocessing
leoweyr Mar 22, 2026
5f388b2
fix(cliff): classify build commits under DevOps
leoweyr Mar 28, 2026
1c00f3d
ci: add update used by repos stats workflow
leoweyr Mar 29, 2026
4c3e192
ci: stabilize reusable workflow dependency search
leoweyr Mar 29, 2026
86c093b
feat: add tracker for reusable workflow usage
leoweyr Mar 29, 2026
80556c5
fix: make release base branch configurable via reusable workflow input
leoweyr Mar 29, 2026
66b12ff
release: v1.0.1
github-actions[bot] Mar 29, 2026
7191ff0
feat: support npm publish
leoweyr Apr 4, 2026
00decad
release: v1.1.0
github-actions[bot] Apr 4, 2026
86c1762
Merge branch 'master' into release/v1.1.0
leoweyr Apr 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/actions/npm-publish/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: 'NPM Publish'
description: 'Publish package to npm registry.'

inputs:
node-version:
description: 'Node.js version to use.'
required: false
default: '20'
package-dir:
description: 'Directory containing package.json.'
required: false
default: '.'
deploy-command:
description: 'Publish command to execute.'
required: false
default: 'npm run deploy'
access-token:
description: 'NPM auth token.'
required: true

runs:
using: 'composite'
steps:
- name: 📦 Install Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ inputs.node-version }}
registry-url: 'https://registry.npmjs.org'

- name: 🔍 Verify NPM Package File
shell: bash
working-directory: ${{ inputs.package-dir }}
run: |
if [ ! -f 'package.json' ]; then
echo '❌ package.json Not Found'
exit 1
fi

- name: 📦 Install Dependencies
shell: bash
working-directory: ${{ inputs.package-dir }}
run: npm ci

- name: 🚀 Deploy npm Package
shell: bash
working-directory: ${{ inputs.package-dir }}
env:
NODE_AUTH_TOKEN: ${{ inputs.access-token }}
run: ${{ inputs.deploy-command }}
48 changes: 47 additions & 1 deletion .github/workflows/reusable-publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,27 @@ name: Publish Release

on:
workflow_call:
inputs:
npm-node-version:
description: 'Node.js version for npm publish.'
required: false
type: string
default: '20'
npm-package-dir:
description: 'Directory containing package.json for npm publish.'
required: false
type: string
default: '.'
npm-deploy-command:
description: 'Command used to publish npm package.'
required: false
type: string
default: 'npm run deploy'
secrets:
ACCESS_TOKEN:
required: true
NPM_TOKEN:
required: false

jobs:
publish-release:
Expand All @@ -15,7 +33,7 @@ jobs:
- name: 👣 Track Workflow Run
continue-on-error: true
run: |
curl -s "https://abacus.jasoncameron.dev/hit/leoweyr/github-release-workflow-usage" > /dev/null
curl -s "https://abacus.jasoncameron.dev/hit/leoweyr/github-release-workflow-usage" > /dev/null

- name: 📂 Checkout Code
uses: actions/checkout@v4
Expand Down Expand Up @@ -44,3 +62,31 @@ jobs:
--title "${{ env.VERSION_TITLE }}" \
--notes-file release_body.md \
--verify-tag

- name: 🔍 Verify NPM Token
id: verify_npm_token
run: |
if [ -z "${{ secrets.NPM_TOKEN }}" ]; then
echo '👻 NPM_TOKEN is not configured.'
echo 'enabled=false\n' >> "$GITHUB_OUTPUT"
exit 0
fi

echo 'enabled=true\n' >> "$GITHUB_OUTPUT"

- name: 🔄 Sync NPM Publish Action
if: steps.verify_npm_token.outputs.enabled == 'true'
uses: actions/checkout@v4
with:
repository: 'leoweyr/github-release-workflow'
path: .release-workflow
sparse-checkout: .github/actions/npm-publish

- name: 🚀 Deploy NPM Package
if: steps.verify_npm_token.outputs.enabled == 'true'
uses: ./.release-workflow/.github/actions/npm-publish
with:
node-version: ${{ inputs.npm-node-version }}
package-dir: ${{ inputs.npm-package-dir }}
deploy-command: ${{ inputs.npm-deploy-command }}
access-token: ${{ secrets.NPM_TOKEN }}
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

All notable changes to this project will be documented in this file.

# [1.1.0](https://github.com/leoweyr/github-release-workflow/compare/v1.0.1...v1.1.0) (2026-04-04)
### Features

* support npm publish ([7191ff0](https://github.com/leoweyr/github-release-workflow/commit/7191ff0f6d537348fc5ccf6115ecbfac8c5dbd19)) [@leoweyr](https://github.com/leoweyr)



# [1.0.1](https://github.com/leoweyr/github-release-workflow/compare/v1.0.0...v1.0.1) (2026-03-29)
### Bug Fixes

Expand Down
17 changes: 15 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![github-release-workflow](https://socialify.git.ci/leoweyr/github-release-workflow/image?description=1&font=KoHo&forks=1&issues=1&logo=https%3A%2F%2Fraw.githubusercontent.com%2Fleoweyr%2Fgithub-release-workflow%2Frefs%2Fheads%2Fdevelop%2Fassets%2Ficon.svg&name=1&owner=1&pattern=Formal+Invitation&pulls=1&stargazers=1&theme=Light)
![github-release-workflow](https://socialify.git.ci/leoweyr/github-release-workflow/image?description=1&font=KoHo&logo=https%3A%2F%2Fraw.githubusercontent.com%2Fleoweyr%2Fgithub-release-workflow%2Frefs%2Fheads%2Fdevelop%2Fassets%2Ficon.svg&name=1&owner=1&pattern=Formal+Invitation&theme=Light)

![Usage](https://img.shields.io/badge/dynamic/json?url=https%3A%2F%2Fabacus.jasoncameron.dev%2Fget%2Fleoweyr%2Fgithub-release-workflow-usage&query=%24.value&label=Usage&color=blue&suffix=%20times)
![Used by Stats](https://img.shields.io/endpoint?url=https://gist.githubusercontent.com/leoweyr/0575adecfc13c95f281dfccfe5b76063/raw/github-release-workflow-used-by-stats.json)
Expand Down Expand Up @@ -38,4 +38,17 @@ This workflow streamlines your release process into a few simple steps:
4. **Review and Merge**: Review the Pull Request created by the bot.
* **Do not modify the Pull Request title or body**, as they are used for the release metadata.
* Merge the Pull Request.
* The workflow will automatically create a GitHub Release for you.
* The workflow will automatically create coordinated releases across GitHub and supported package registries.

## 📦 Optional Publishing

> [!NOTE]
>
> If the required secret for the release target are not configured, publishing will not start.

Configure target publishing in your user-side entry workflow (`.github/workflows/publish-release.yml`):

| Release Target | Required Secret | User-Side Inputs (`with`) |
|----------------|-----------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------|
| GitHub Release | `ACCESS_TOKEN` (Mapped from `secrets.GITHUB_TOKEN`) | None |
| NPM | `NPM_TOKEN` | `npm-node-version` (Default `20`)<br/>`npm-package-dir` (Default `.`)<br/>`npm-deploy-command` (Default `npm run deploy`) |
Loading