Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 0 additions & 24 deletions .github/workflows/release-manual.yml

This file was deleted.

18 changes: 15 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,22 @@ name: Release
on:
push:
branches: [main]
workflow_dispatch:

jobs:
release:
runs-on: ubuntu-latest
permissions:
id-token: write # Required for trusted publishing via OIDC (https://docs.npmjs.com/trusted-publishers)
if: "contains(github.event.head_commit.message, 'chore(release): publish')"
id-token: write
# Only gate push events by commit message; allow workflow_dispatch always
if: >
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'push' && contains(github.event.head_commit.message, 'chore(release): publish'))
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- uses: actions/setup-node@v4
with:
node-version: lts/*
Expand All @@ -22,5 +28,11 @@ jobs:
- name: Build
run: yarn build

- name: Publish to NPM
# Choose publish command based on the event type
- name: Publish to NPM (push)
if: github.event_name == 'push'
run: npm run release:publish

- name: Publish to NPM (manual)
if: github.event_name == 'workflow_dispatch'
run: npm run release:publish-manual