-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (50 loc) · 1.5 KB
/
ci.yaml
File metadata and controls
57 lines (50 loc) · 1.5 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# How version bumping and publishing works?
# Developer creates a tag with correct version number,
# attaches to the latest commit & pushes to the main branch
name: CI
on:
push:
tags:
- '*'
# pull_request:
# types: [closed]
# branches:
# - main
permissions:
id-token: write #for OIDC
contents: read
jobs:
build:
runs-on: 'ubuntu-latest'
# if: ${{github.event.pull_request.merged}}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
token: ${{secrets.PAT_TOKEN}}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
registry-url: 'https://registry.npmjs.org'
- name: Install bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.2.22
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Configure name and email
run: |
git config user.name ${{secrets.GH_USERNAME}}
git config user.email ${{secrets.GH_EMAIL}}
# commit message should include a valid tag
# for pushing with tags use --follow-tags
- name: Bump app version as per the tag
run: |
bun pm version from-git -m "chore: update version"
- name: Publish to npm using OIDC
run: npm publish --provenance --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Sync with repo
run: git push origin HEAD:main