-
Notifications
You must be signed in to change notification settings - Fork 7
87 lines (68 loc) · 2 KB
/
Copy pathci.yml
File metadata and controls
87 lines (68 loc) · 2 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: CI
on:
push:
branches:
- main
tags:
- "v*"
pull_request:
jobs:
install:
runs-on: ubuntu-latest
timeout-minutes: 10
name: Node
steps:
- name: Checkout Code
uses: actions/checkout@v7
- uses: pnpm/action-setup@v6
- name: Use Node 24 and pnpm
uses: actions/setup-node@v6
with:
node-version: 24
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
- name: Use Bun
uses: oven-sh/setup-bun@v2
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Build Site
run: pnpm run build:site
release:
runs-on: ubuntu-latest
needs: [install]
if: startsWith(github.ref, 'refs/tags/')
env:
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
steps:
- name: Checkout Code
uses: actions/checkout@v7
- uses: pnpm/action-setup@v6
- name: Use Node 24 and pnpm
uses: actions/setup-node@v6
with:
node-version: 24
cache: 'pnpm'
registry-url: 'https://registry.npmjs.org'
- name: Use Bun
uses: oven-sh/setup-bun@v2
- name: Install Dependencies
run: pnpm install --frozen-lockfile
- name: Build Package
run: pnpm run build
- name: Determine tag
id: determine_tag
run: |
echo "tag=$(echo $GITHUB_REF | grep -Eo 'alpha|beta|rc')" >> $GITHUB_OUTPUT
- name: Add auth token to npmrc
run: |
echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- name: Publish to versioned tag
if: steps.determine_tag.outputs.tag != ''
run: |
echo "Publishing to ${{ steps.determine_tag.outputs.tag }} tag"
pnpm publish --tag ${{ steps.determine_tag.outputs.tag }} --no-git-check
- name: Publish to latest
if: steps.determine_tag.outputs.tag == ''
run: |
echo "Publishing to latest"
pnpm publish --no-git-check