-
Notifications
You must be signed in to change notification settings - Fork 33
38 lines (32 loc) · 968 Bytes
/
release.yml
File metadata and controls
38 lines (32 loc) · 968 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
name: Release
on:
push:
branches: [main]
workflow_dispatch:
jobs:
release:
runs-on: ubuntu-latest
permissions:
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/*
- name: Install dependencies
run: yarn
- name: Build
run: yarn build
# 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