Skip to content

Commit 141f89d

Browse files
chore: update actions
1 parent 30ea237 commit 141f89d

File tree

3 files changed

+54
-38
lines changed

3 files changed

+54
-38
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
on:
2+
pull_request:
3+
branches:
4+
- main
5+
6+
jobs:
7+
test:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- uses: pnpm/action-setup@v2
12+
with:
13+
version: 8
14+
- uses: actions/setup-node@v3
15+
with:
16+
node-version: 18
17+
cache: 'pnpm'
18+
19+
- run: pnpm install --frozen-lockfile
20+
- run: pnpm lint && pnpm test && pnpm build:lib

.github/workflows/publish.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# .github/workflows/publish.yml
2+
name: publish
3+
4+
on:
5+
push:
6+
tags:
7+
- 'v*.*.*'
8+
9+
jobs:
10+
publish:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v3
14+
15+
- uses: pnpm/action-setup@v2
16+
with:
17+
version: 8
18+
19+
- uses: actions/setup-node@v3
20+
with:
21+
node-version: 18
22+
registry-url: 'https://registry.npmjs.org'
23+
cache: 'pnpm'
24+
25+
- run: pnpm install --frozen-lockfile
26+
- run: pnpm build:lib
27+
- run: pnpm publish --access public
28+
env:
29+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Lines changed: 5 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# .github/workflows/release-please.yml
2+
name: release-please
3+
14
on:
25
push:
36
branches:
@@ -7,49 +10,13 @@ permissions:
710
contents: write
811
pull-requests: write
912

10-
name: release-please
1113
jobs:
12-
release-please:
14+
release:
1315
runs-on: ubuntu-latest
1416
steps:
15-
- name: Release
16-
id: release
17-
if: ${{ github.ref_name == 'main' }}
17+
- name: Create release PR
1818
uses: google-github-actions/release-please-action@v3
1919
with:
2020
release-type: node
2121
default-branch: main
2222
token: ${{ secrets.GH_RELEASE_TOKEN }}
23-
24-
- name: Checkout
25-
uses: actions/checkout@v3
26-
if: ${{ steps.release.outputs.releases_created }}
27-
28-
- name: Install pnpm
29-
uses: pnpm/action-setup@v2
30-
if: ${{ steps.release.outputs.releases_created }}
31-
with:
32-
version: 8
33-
34-
# Setup .npmrc file to publish to npm
35-
- name: Setup Node
36-
uses: actions/setup-node@v3
37-
with:
38-
node-version: '18.x'
39-
registry-url: 'https://registry.npmjs.org'
40-
cache: 'pnpm'
41-
if: ${{ steps.release.outputs.releases_created }}
42-
43-
- name: CI
44-
run: pnpm install --frozen-lockfile
45-
if: ${{ steps.release.outputs.releases_created }}
46-
47-
- name: Build
48-
run: pnpm build:lib
49-
if: ${{ steps.release.outputs.releases_created }}
50-
51-
- name: Publish
52-
run: pnpm publish
53-
if: ${{ steps.release.outputs.releases_created }}
54-
env:
55-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)