Skip to content

Commit 2902b26

Browse files
committed
chore: add ci workflow
Added a ci workflow to build and publish to npm. It does not use token instead it uses OIDC to securely connect to npm.
1 parent d7e4a21 commit 2902b26

1 file changed

Lines changed: 43 additions & 0 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
# pull_request:
6+
# types: [closed]
7+
# branches:
8+
# - main
9+
10+
permissions:
11+
id-token: write #for OIDC
12+
contents: read
13+
14+
15+
jobs:
16+
build:
17+
runs-on: 'ubuntu-latest'
18+
# if: ${{github.event.pull_request.merged}}
19+
steps:
20+
- name: Checkout code
21+
uses: actions/checkout@v4
22+
- name: Install bun
23+
uses: oven-sh/setup-bun@v2
24+
with:
25+
bun-version: 1.2.22
26+
- name: Install dependencies
27+
run: bun install --frozen-lockfile
28+
- name: Configure name and email
29+
run: |
30+
git config user.name ${{secrets.GH_USERNAME}}
31+
git config user.email ${{secrets.GH_EMAIL}}
32+
npm version from-git
33+
34+
# commit message should include a valid tag
35+
# for pushing with tags use --follow-tags
36+
- name: Bump app version as per the tag
37+
run: bun pm version from-git
38+
39+
- name: Npm Login
40+
run: npm install -g npm@latest
41+
- name: Publish to npm using OIDC
42+
run: npm publish
43+

0 commit comments

Comments
 (0)