Skip to content

Commit 63c0b5b

Browse files
committed
ci: update pnpm action and release workflow
1 parent c7db067 commit 63c0b5b

3 files changed

Lines changed: 23 additions & 55 deletions

File tree

.github/workflows/docs.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ jobs:
1616
uses: actions/checkout@v3
1717

1818
- name: Setup PNPM
19-
uses: pnpm/action-setup@v2.2.2
19+
uses: pnpm/action-setup@v2.4.0
2020
with:
21-
version: latest
21+
run_install: true
2222

2323
- name: Build Docs
24-
run: pnpm i && pnpm run docs
24+
run: pnpm run docs
2525

2626
- name: Deploy
2727
uses: peaceiris/actions-gh-pages@v3

.github/workflows/release.yml

Lines changed: 17 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -10,62 +10,30 @@ jobs:
1010
release-npm:
1111
name: Release NPM (${{ github.ref }})
1212
runs-on: ubuntu-latest
13+
permissions:
14+
contents: write
15+
issues: write
16+
pull-requests: write
1317
steps:
1418
- name: Checkout Repository
1519
uses: actions/checkout@v3
16-
with:
17-
fetch-depth: 0
18-
19-
- name: Check if Tag on Main
20-
run: |
21-
git checkout main
22-
branch=$(git branch main --contains ${{ github.ref }})
23-
git checkout ${{ github.ref }}
24-
if [ -z $branch ]; then
25-
echo "Tag ${{ github.ref }} is not contained in the main branch."
26-
exit 1
27-
fi
2820

2921
- name: Setup PNPM
30-
uses: pnpm/action-setup@v2.2.2
22+
uses: pnpm/action-setup@v2.4.0
3123
with:
32-
version: latest
3324
run_install: true
3425

35-
- name: Build & Test
36-
run: pnpm build && pnpm test
37-
38-
- name: Publish
39-
run: |
40-
pnpm config set //registry.npmjs.org/:_authToken ${{ secrets.NPM_TOKEN }}
41-
pnpm publish --verbose --no-git-checks
42-
43-
release-note:
44-
name: Release Note (${{ github.ref }})
45-
runs-on: ubuntu-latest
46-
needs:
47-
- release-npm
48-
steps:
49-
- name: Checkout Repository
50-
uses: actions/checkout@v3
51-
with:
52-
fetch-depth: 0
53-
54-
- name: Check if Tag on Main
55-
run: |
56-
git checkout main
57-
branch=$(git branch main --contains ${{ github.ref }})
58-
git checkout ${{ github.ref }}
59-
if [ -z $branch ]; then
60-
echo "Tag ${{ github.ref }} is not contained in the main branch."
61-
exit 1
62-
fi
26+
- name: Build
27+
run: pnpm build
6328

64-
- name: Publish Release
65-
uses: "marvinpinto/action-automatic-releases@latest"
29+
- name: Create Release Pull Request or Publish to NPM
30+
id: changesets
31+
uses: changesets/action@v1
6632
with:
67-
repo_token: "${{ secrets.GH_TOKEN }}"
68-
prerelease: false
69-
files: |
70-
README.md
71-
LICENSE
33+
publish: pnpm changeset publish
34+
version: pnpm changeset version
35+
title: Release Packages
36+
commit: bump versions
37+
env:
38+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
39+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ jobs:
2929
uses: actions/checkout@v3
3030

3131
- name: Setup PNPM
32-
uses: pnpm/action-setup@v2.2.2
32+
uses: pnpm/action-setup@v2.4.0
3333
with:
34-
version: latest
34+
run_install: true
3535

3636
- name: Build
37-
run: pnpm i && pnpm build
37+
run: pnpm build
3838

3939
- name: Test (w/ service)
4040
run: sudo -E $PNPM_HOME/pnpm test

0 commit comments

Comments
 (0)