-
Notifications
You must be signed in to change notification settings - Fork 8
63 lines (58 loc) · 2 KB
/
test.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
name: Build and test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
# prevent from running on forks
if: github.repository_owner == 'restatedev'
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [19.x]
steps:
- uses: actions/checkout@v3
- uses: bufbuild/buf-setup-action@v1
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm run proto
- run: npm run verify
- run: mv $(npm pack) restatedev-restate-sdk.tgz
- uses: actions/upload-artifact@v3
with:
name: restatedev-restate-sdk
path: restatedev-restate-sdk.tgz
retention-days: 1
if-no-files-found: error
- name: Publish snapshot
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
run: |
# We're using 0.0.0 to avoid this version to be higher than released versions.
# To use it:
# "@restatedev/restate-sdk": "^0.0.0-SNAPSHOT"
npm version 0.0.0-SNAPSHOT-$(date '+%Y%m%d%H%M%S') --git-tag-version false
# We use dist-tag dev for the snapshot releases, see https://docs.npmjs.com/cli/v9/commands/npm-dist-tag for more info
# A snapshot MUST not be published with latest tag (omitting --tag defaults to latest) to avoid users to install snapshot releases
# when using npm install
npm publish --tag dev --access public
e2e:
permissions:
contents: read
issues: read
checks: write
pull-requests: write
actions: read
secrets: inherit
needs: build
uses: restatedev/e2e/.github/workflows/e2e.yaml@main
with:
sdkTypescriptCommit: ${{ github.event.pull_request.head.sha || github.sha }}
e2eRef: main