-
Notifications
You must be signed in to change notification settings - Fork 2
95 lines (76 loc) · 2.19 KB
/
cicd.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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
name: CICD
on:
push:
branches:
- main
pull_request:
branches:
- main
permissions:
contents: read
id-token: write
jobs:
test:
runs-on: ubuntu-latest
steps:
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: 1.21
- name: Checkout resonate-sdk-ts repository
uses: actions/checkout@v4
- name: Install dependencies
run: npm install
- name: Run linter
run: npm run lint
- name: Run prettier
run: npm run prettier
- name: Checkout resonate repository
uses: actions/checkout@v4
with:
repository: resonatehq/resonate
path: resonate
- name: Build resonate
run: go build -o resonate
working-directory: resonate
- name: Start resonate server
run: ./resonate serve &
working-directory: resonate
- name: Run tests
env:
RESONATE_STORE_URL: http://localhost:8001
run: npm test -- --verbose
- name: Upload coverage report to Codecov
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
build:
needs: test
runs-on: ubuntu-latest
steps:
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: "20"
registry-url: "https://registry.npmjs.org"
- name: Checkout resonate-sdk-ts repository
uses: actions/checkout@v4
- name: Install dependencies
run: npm install
- name: Build
run: npm run build
- name: Publish
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
# Use 0.0.0 so as to not conflict with a newer version
# Use the commit sha as a unique identifier
npm version 0.0.0-SNAPSHOT-$GITHUB_SHA --git-tag-version false
# Publish to the main tag
npm publish --provenance --access public --tag main