-
Notifications
You must be signed in to change notification settings - Fork 1
64 lines (58 loc) · 1.66 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
name: Deploy Latest Release
on:
release:
types: [published, unpublished]
branches:
- main
jobs:
set-commit-hash:
name: Store the hash of the commit
runs-on: ubuntu-latest
outputs:
commit_hash: ${{ steps.commit-hash.outputs.commit_hash }}
steps:
- id: commit-hash
uses: ottofeller/github-actions/latest-release-commit-hash@main
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
typecheck:
name: Typecheck the code
needs: set-commit-hash
runs-on: ubuntu-latest
steps:
- uses: ottofeller/github-actions/npm-run@main
with:
ref: ${{ needs.set-commit-hash.outputs.commit_hash }}
node-version: 16
command: npm run typecheck
lint:
name: Lint the code
needs: set-commit-hash
runs-on: ubuntu-latest
steps:
- uses: ottofeller/github-actions/npm-run@main
with:
ref: ${{ needs.set-commit-hash.outputs.commit_hash }}
node-version: 16
command: npm run lint
test:
name: Test the code
needs: set-commit-hash
runs-on: ubuntu-latest
steps:
- uses: ottofeller/github-actions/npm-run@main
with:
node-version: 16
ref: ${{ needs.set-commit-hash.outputs.commit_hash }}
command: npm run test
publish-npm:
name: Publish the release to NPM
needs: [set-commit-hash, typecheck, lint, test]
runs-on: ubuntu-latest
steps:
- uses: ottofeller/github-actions/publish-npm@main
with:
ref: ${{ needs.set-commit-hash.outputs.commit_hash }}
registry-url: https://registry.npmjs.org/
npm-token: ${{ secrets.NPM_TOKEN }}
include-build-step: true