Skip to content

Commit f749a4a

Browse files
committed
add ci workflows
1 parent 791bf54 commit f749a4a

File tree

3 files changed

+140
-0
lines changed

3 files changed

+140
-0
lines changed

.github/workflows/build.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Build
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- main
7+
8+
concurrency:
9+
group: ${{ github.workflow }}-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
test:
14+
runs-on: ubuntu-latest
15+
steps:
16+
- name: Checkout
17+
uses: actions/checkout@v4
18+
19+
- name: Setup pnpm
20+
uses: pnpm/action-setup@v4
21+
with:
22+
run_install: false
23+
24+
- name: Setup Node
25+
uses: actions/setup-node@v4
26+
with:
27+
node-version-file: ".nvmrc"
28+
cache: "pnpm"
29+
30+
- name: Install dependencies
31+
run: pnpm install --frozen-lockfile
32+
33+
- name: Lint
34+
run: pnpm lint
35+
36+
- name: Run build
37+
run: pnpm build
38+
39+
# - name: Run tests
40+
# run: pnpm test:ci
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: "Publish Snapshot Release"
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths-ignore:
8+
# - '.github/**'
9+
- "**/package.json"
10+
11+
env:
12+
NPM_TOKEN: ${{ secrets.NPM_AUTOMATION_FROM_CHANCE }}
13+
14+
concurrency: ${{ github.workflow }}-${{ github.ref }}
15+
16+
jobs:
17+
publish-snapshot:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Setup pnpm
24+
uses: pnpm/action-setup@v4
25+
with:
26+
run_install: false
27+
28+
- name: Setup Node
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version-file: ".nvmrc"
32+
registry-url: "https://registry.npmjs.org"
33+
cache: "pnpm"
34+
35+
- name: Install dependencies
36+
run: pnpm install --frozen-lockfile
37+
38+
- name: Build packages
39+
run: pnpm build
40+
41+
- name: Write .npmrc
42+
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
43+
44+
- name: Update snapshot version
45+
run: pnpm run bump:next
46+
47+
- name: Publish snapshot
48+
run: pnpm run release:next --no-git-checks
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: "Publish Stable Release"
2+
3+
on:
4+
push:
5+
branches:
6+
- stable
7+
8+
env:
9+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
10+
NPM_TOKEN: ${{ secrets.NPM_AUTOMATION_FROM_CHANCE }}
11+
12+
concurrency: ${{ github.workflow }}-${{ github.ref }}
13+
14+
jobs:
15+
publish-stable:
16+
name: Version or publish
17+
timeout-minutes: 15
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v4
22+
23+
- name: Setup pnpm
24+
uses: pnpm/action-setup@v4
25+
with:
26+
run_install: false
27+
28+
- name: Setup Node
29+
uses: actions/setup-node@v4
30+
with:
31+
node-version-file: ".nvmrc"
32+
registry-url: "https://registry.npmjs.org"
33+
cache: "pnpm"
34+
35+
- name: Install dependencies
36+
run: pnpm install --frozen-lockfile
37+
38+
- name: Build packages
39+
run: pnpm build
40+
41+
- name: Write .npmrc
42+
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" > .npmrc
43+
44+
- name: Create Release Pull Request or Publish to npm
45+
id: changesets
46+
uses: changesets/action@v1
47+
with:
48+
title: New release
49+
commit: New release
50+
version: pnpm run bump:stable
51+
publish: pnpm run release:stable:ci
52+
createGithubReleases: false

0 commit comments

Comments
 (0)