-
Notifications
You must be signed in to change notification settings - Fork 2
68 lines (52 loc) · 1.68 KB
/
ci.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
65
66
67
68
# Run all tests, linters, code analysis and other QA tasks on
# every push to main and PRs.
#
# To SSH into the runner to debug a failure, add the following step before
# the failing step
# - uses: lhotari/action-upterm@v1
# with:
# limit-access-to-actor: true
name: CI
on:
workflow_dispatch:
pull_request:
push:
branches:
- main
# Prevent multiple jobs running after fast subsequent pushes
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
tests:
name: Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: teamniteo/gha-actions/nix@v2
with:
cache: niteo-public
auth_token: '${{ secrets.CACHIX_AUTH_TOKEN_PUBLIC }}'
- run: nix-shell --run "make lint all=true"
- run: nix-shell --run "make tests"
- run: nix-shell --run "make dist"
- uses: teamniteo/gha-actions/uncommitted-changes@v2
publish:
name: Publish to NPM
needs: tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: teamniteo/gha-actions/nix@v2
with:
cache: niteo-public
auth_token: '${{ secrets.CACHIX_AUTH_TOKEN_PUBLIC }}'
- name: Create .npmrc file to publish to npm
uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://registry.npmjs.org'
- name: Publish the package to NPM
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: nix-shell --run "npm version --no-git-tag-version prerelease --preid $(date +%Y-%m-%dT%H-%M-%S) && make dist && npm publish" # yamllint disable-line