Skip to content

Commit e3ad632

Browse files
authored
chore: add publish workflow
1 parent 32806f0 commit e3ad632

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

.github/workflows/publish.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: NPM publish
2+
on:
3+
workflow_dispatch:
4+
inputs:
5+
versionType:
6+
type: choice
7+
description: Version Type
8+
required: true
9+
options:
10+
- patch
11+
- minor
12+
- major
13+
permissions:
14+
id-token: write
15+
contents: write
16+
jobs:
17+
publish:
18+
name: Publishing to NPM
19+
runs-on: ubuntu-latest
20+
steps:
21+
- uses: actions/checkout@v4
22+
- name: Setup Node JS
23+
uses: actions/setup-node@v4
24+
with:
25+
node-version: 20
26+
registry-url: https://registry.npmjs.org
27+
28+
# Ensure npm 11.5.1 or later is installed
29+
- name: Update npm
30+
run: npm install -g npm@latest
31+
- run: npm ci
32+
- run: git config --global user.email "[email protected]"
33+
- run: git config --global user.name "y-infra"
34+
- run: npm run release -- --release-as ${{ github.event.inputs.versionType }}
35+
- run: npm publish
36+
- run: git push --follow-tags

0 commit comments

Comments
 (0)