-
Notifications
You must be signed in to change notification settings - Fork 51
78 lines (74 loc) · 2.23 KB
/
cd-dgraph-js.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
69
70
71
72
73
74
75
76
77
78
name: cd-dgraph-js
on:
workflow_dispatch:
inputs:
releasetag:
description: git tag to checkout and version to publish to npm
required: true
type: string
releasetype:
description: specify how to tag release on npm
required: true
type: choice
options:
- latest
- rc
- beta
permissions:
contents: read
jobs:
dgraph-js-tests:
runs-on: warp-ubuntu-latest-x64-16x
strategy:
fail-fast: true
matrix:
node-version: [18.x, 20.x, 22.x, 23.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- name: Checkout dgraph-js repo
uses: actions/checkout@v4
with:
path: dgraph-js
repository: hypermodeinc/dgraph-js
ref: ${{ github.event.inputs.releasetag }}
- name: Checkout dgraph repo
uses: actions/checkout@v4
with:
path: dgraph
repository: hypermodeinc/dgraph
ref: main
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build dgraph binary
run: cd dgraph && make docker-image # also builds dgraph binary
- name: Move dgraph binary to gopath
run: cd dgraph && mv dgraph/dgraph ~/go/bin/dgraph
- name: Setup node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm
cache-dependency-path: dgraph-js/package-lock.json
- name: Run dgraph-js tests
working-directory: dgraph-js
run: |
npm ci --legacy-peer-deps
bash scripts/run-tests.sh
dgraph-js-publish-npm:
needs: [dgraph-js-tests]
runs-on: ubuntu-latest
steps:
- name: Checkout dgraph-js repo
uses: actions/checkout@v4
- name: Setup node.js
uses: actions/setup-node@v4
with:
node-version: 20.x
registry-url: https://registry.npmjs.org
- name: Build dgraph-js package
run: npm ci
- run: npm publish --tag '${{ github.event.inputs.releasetype }}'
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_DGRAPH_JS_TOKEN }}