Skip to content

Commit a331c94

Browse files
committed
optimize CI
1 parent 8e87d01 commit a331c94

4 files changed

Lines changed: 10781 additions & 19 deletions

File tree

.github/workflows/main.yml

Lines changed: 18 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,32 @@
11
name: Create Relase & Publish Package
2+
23
on:
34
push:
45
tags:
56
- 'v*'
7+
8+
env:
9+
NODE_VERSION: 16
10+
611
jobs:
712
build:
8-
runs-on: ubuntu-20.04
13+
runs-on: ubuntu-22.04
14+
timeout-minutes: 5
915
steps:
10-
- uses: actions/checkout@v2
11-
- uses: actions/create-release@v1
12-
env:
13-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
16+
- uses: actions/checkout@v3
17+
- uses: actions/github-script@v6
1418
with:
15-
tag_name: ${{ github.ref }}
16-
release_name: Release ${{ github.ref }}
17-
draft: false
18-
prerelease: false
19-
- uses: actions/setup-node@v1
19+
script: |
20+
github.rest.repos.createRelease({
21+
owner: context.repo.owner,
22+
repo: context.repo.repo,
23+
tag_name: '${{ github.ref }}',
24+
name: 'Release ${{ github.ref_name }}'
25+
})
26+
- uses: aboutbits/github-actions-node/setup-and-install@v1
2027
with:
21-
node-version: '16.x'
28+
node-version: ${{ env.NODE_VERSION }}
2229
registry-url: 'https://registry.npmjs.org'
23-
- run: npm install
2430
- run: npm publish
2531
env:
2632
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/test.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
11
name: Test Package
2+
23
on: push
4+
5+
env:
6+
NODE_VERSION: 16
7+
38
jobs:
49
test:
5-
runs-on: ubuntu-20.04
10+
runs-on: ubuntu-22.04
11+
timeout-minutes: 15
612
steps:
7-
- uses: actions/checkout@v2
8-
- uses: actions/setup-node@v1
13+
- uses: actions/checkout@v3
14+
- uses: aboutbits/github-actions-node/setup-and-install@v1
915
with:
10-
node-version: '16.x'
11-
registry-url: 'https://registry.npmjs.org'
12-
- run: npm install
16+
node-version: ${{ env.NODE_VERSION }}
1317
- run: npm run checks

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
/.vscode
77

88
# Project
9-
/package-lock.json
109
/node_modules
1110
/dist
1211

0 commit comments

Comments
 (0)