-
Notifications
You must be signed in to change notification settings - Fork 3
44 lines (40 loc) · 1.23 KB
/
test-and-release.yaml
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
name: Test and Release
on: push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
jobs:
tests:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: "18.x"
- name: Install latest npm
run: |
sudo npm install -g npm@
npm config set update-notifier false
sudo chown -R $USER:$(id -gn $USER) /home/runner/.config
- name: Authenticate with NPM registry
run: echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc
- name: Keep npm cache around to speed up installs
uses: actions/cache@v3
with:
path: ~/.npm
key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-build-${{ env.cache-name }}-
${{ runner.OS }}-build-
${{ runner.OS }}-
- name: Install dependencies
run: npm ci --no-audit
- name: Compile
run: npx tsc
- name: Test
run: npm test
- name: Semantic release
continue-on-error: true
run: |
npm i --no-save semantic-release
npx semantic-release