Skip to content

Commit 30e979b

Browse files
authored
chore(release): Set up semantic-release (#49)
1 parent ffe203b commit 30e979b

File tree

4 files changed

+56
-43
lines changed

4 files changed

+56
-43
lines changed

.github/workflows/pages.yml

Lines changed: 19 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,47 @@
1-
name: Deploy GitHub Pages
1+
---
2+
name: Pages
23

34
on:
4-
push:
5-
branches: ["release"]
6-
workflow_dispatch:
5+
workflow_run:
6+
workflows: [Release]
7+
branches: [release]
8+
types:
9+
- completed
710

811
permissions:
912
contents: read
1013
pages: write
1114
id-token: write
1215

1316
concurrency:
14-
group: "pages"
17+
group: pages
1518
cancel-in-progress: true
1619

1720
jobs:
1821
build:
1922
runs-on: ubuntu-latest
20-
steps:
21-
- name: Checkout
22-
uses: actions/checkout@v3
2323

24-
- name: Install NodeJS
25-
uses: actions/setup-node@v3
24+
steps:
25+
- uses: actions/checkout@v3
26+
- uses: actions/setup-node@v3
2627
with:
2728
node-version-file: '.nvmrc'
28-
29-
- name: Install Yarn
30-
run: npm install -g yarn
31-
32-
- name: Cache dependencies
33-
uses: actions/cache@v3
34-
with:
35-
path: .yarn/cache
36-
key: ${{ runner.os }}-yarn-${{ hashFiles('yarn.lock') }}
37-
restore-keys: |
38-
${{ runner.os }}-yarn-
39-
40-
- name: Install dependencies
41-
run: yarn install --immutable
42-
43-
- name: Build API Reference
44-
run: yarn pages
45-
46-
- name: Setup Pages
47-
uses: actions/configure-pages@v1
48-
49-
- name: Build with Jekyll
50-
uses: actions/jekyll-build-pages@v1
29+
cache: yarn
30+
- run: yarn install --immutable
31+
- run: yarn pages
32+
- uses: actions/configure-pages@v1
33+
- uses: actions/jekyll-build-pages@v1
5134
with:
5235
source: ./
5336
destination: ./_site
54-
55-
- name: Upload artifact
56-
uses: actions/upload-pages-artifact@v1
37+
- uses: actions/upload-pages-artifact@v1
5738

5839
deploy:
5940
environment:
6041
name: github-pages
6142
url: ${{ steps.deployment.outputs.page_url }}
6243
runs-on: ubuntu-latest
6344
needs: build
45+
6446
steps:
65-
- name: Deploy to GitHub Pages
66-
id: deployment
67-
uses: actions/deploy-pages@v1
47+
- uses: actions/deploy-pages@v1

.github/workflows/release.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
name: Release
3+
4+
on:
5+
workflow_run:
6+
workflows: [Build]
7+
branches: [release]
8+
types:
9+
- completed
10+
11+
permissions:
12+
contents: write
13+
id-token: write
14+
15+
concurrency:
16+
group: release
17+
cancel-in-progress: true
18+
19+
jobs:
20+
release:
21+
runs-on: ubuntu-latest
22+
23+
steps:
24+
- uses: actions/checkout@v3
25+
- uses: cycjimmy/semantic-release-action@v3
26+
with:
27+
branch: release
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
30+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

package.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,8 @@
3939
"typedoc-plugin-merge-modules": "^4.0.1",
4040
"typescript": "^4.7.4"
4141
},
42-
"packageManager": "[email protected]"
42+
"packageManager": "[email protected]",
43+
"publishConfig": {
44+
"access": "public"
45+
}
4346
}

yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -189,9 +189,9 @@ __metadata:
189189
linkType: hard
190190

191191
"@types/node@npm:^18.7.11":
192-
version: 18.7.11
193-
resolution: "@types/node@npm:18.7.11"
194-
checksum: 66f200a5595d94285fa2052d29048b328acd729ace4be3516d3d2c1736ab33b5cbf698bec70afc5c6101e5df6c9867e3ec3a091dd937886c1e7a712ddde60f69
192+
version: 18.7.13
193+
resolution: "@types/node@npm:18.7.13"
194+
checksum: 45431e7e89ecaf85c7d2c180d801c132a7c59e2f8ad578726b6d71cc74e3267c18f9ccdcad738bc0479790c078f0c79efb0e58da2c6be535c15995dbb19050c9
195195
languageName: node
196196
linkType: hard
197197

0 commit comments

Comments
 (0)