Skip to content

Commit 300347a

Browse files
build: GH actions
1 parent cb6268c commit 300347a

File tree

3 files changed

+88
-0
lines changed

3 files changed

+88
-0
lines changed

.github/actions/prepare/action.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Prepare
2+
3+
description: Checkout and install dependencies
4+
5+
runs:
6+
using: composite
7+
steps:
8+
- uses: actions/setup-node@v3
9+
with:
10+
node-version: '20.x'
11+
registry-url: 'https://registry.npmjs.org'
12+
- name: Install npm
13+
shell: bash
14+
run: npm install -g npm
15+
- name: Install dependencies
16+
shell: bash
17+
run: npm ci

.github/workflows/checks.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Checks
2+
3+
on:
4+
pull_request:
5+
6+
jobs:
7+
build:
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- name: Checkout
12+
uses: actions/checkout@v2
13+
- name: Prepare
14+
uses: ./.github/actions/prepare
15+
- name: Build
16+
run: npm run build
17+
18+
format:
19+
runs-on: ubuntu-latest
20+
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v2
24+
- name: Prepare
25+
uses: ./.github/actions/prepare
26+
- name: Lint
27+
run: npm run format:check
28+
29+
lint:
30+
runs-on: ubuntu-latest
31+
32+
steps:
33+
- name: Checkout
34+
uses: actions/checkout@v2
35+
- name: Prepare
36+
uses: ./.github/actions/prepare
37+
- name: Lint
38+
run: npm run lint
39+
40+
may-merge:
41+
needs: ['format', 'lint', 'build']
42+
runs-on: ubuntu-latest
43+
steps:
44+
- name: Cleared for merging
45+
run: echo OK

.github/workflows/publish.yml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Publish
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
jobs:
8+
build:
9+
runs-on: ubuntu-latest
10+
11+
permissions:
12+
contents: read
13+
id-token: write
14+
15+
steps:
16+
- uses: actions/checkout@v3
17+
- uses: actions/setup-node@v3
18+
with:
19+
node-version: '20.x'
20+
registry-url: 'https://registry.npmjs.org'
21+
- run: npm install -g npm
22+
- run: npm ci
23+
- run: npm run build
24+
- run: npm publish --provenance --access public
25+
env:
26+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

0 commit comments

Comments
 (0)