Skip to content

Commit acf5ef4

Browse files
committed
optimize CI
1 parent 3ccde90 commit acf5ef4

1 file changed

Lines changed: 16 additions & 9 deletions

File tree

.github/workflows/main.yml

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,31 @@
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:
813
runs-on: ubuntu-22.04
14+
timeout-minutes: 5
915
steps:
1016
- uses: actions/checkout@v3
11-
- uses: actions/create-release@v1
12-
env:
13-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
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: aboutbits/github-actions-node/setup-and-install@v2
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
28+
node-version: ${{ env.NODE_VERSION }}
2229
registry-url: 'https://registry.npmjs.org'
2330
- run: npm publish
2431
env:

0 commit comments

Comments
 (0)