Skip to content

Commit 4574f5d

Browse files
authored
Merge pull request #4 from aboutbits/ci-optimizations
Optimize CI
2 parents 7337db9 + 641c6b2 commit 4574f5d

3 files changed

Lines changed: 41 additions & 39 deletions

File tree

.github/workflows/main.yml

Lines changed: 23 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,32 @@
1-
name: Test
1+
name: Create Relase & Publish Package
22

33
on:
44
push:
5-
tags-ignore:
6-
- '**'
5+
tags:
6+
- 'v*'
7+
8+
env:
9+
NODE_VERSION: 16
710

811
jobs:
9-
checks:
10-
runs-on: ubuntu-20.04
12+
build:
13+
runs-on: ubuntu-22.04
14+
timeout-minutes: 5
1115
steps:
1216
- uses: actions/checkout@v3
13-
- uses: actions/setup-node@v3
17+
- uses: actions/github-script@v6
1418
with:
15-
node-version: 16
16-
- uses: actions/cache@v3
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
1727
with:
18-
path: ~/.npm
19-
key: ${{ runner.os }}-npm-${{ hashFiles('**/package-lock.json') }}
20-
- run: npm ci
21-
- run: npm run lint
22-
- run: npm run typecheck
28+
node-version: ${{ env.NODE_VERSION }}
29+
registry-url: 'https://registry.npmjs.org'
30+
- run: npm publish
31+
env:
32+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.github/workflows/release-package.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Test Package
2+
3+
on: push
4+
5+
env:
6+
NODE_VERSION: 16
7+
8+
jobs:
9+
test:
10+
runs-on: ubuntu-22.04
11+
timeout-minutes: 15
12+
steps:
13+
- uses: actions/checkout@v3
14+
- uses: aboutbits/github-actions-node/setup-and-install@v1
15+
with:
16+
node-version: ${{ env.NODE_VERSION }}
17+
- run: npm run lint
18+
- run: npm run typecheck

0 commit comments

Comments
 (0)