-
Notifications
You must be signed in to change notification settings - Fork 152
Expand file tree
/
Copy pathaction.yml
More file actions
90 lines (84 loc) · 2.66 KB
/
action.yml
File metadata and controls
90 lines (84 loc) · 2.66 KB
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
name: Build Node wrapper
inputs:
os:
description: "The current operating system"
required: true
type: string
options:
- amazon-linux
- macos
- ubuntu
named_os:
description: "The name of the current operating system"
required: false
default: "linux"
type: string
options:
- linux
- darwin
arch:
description: "The current architecture"
required: false
default: "x64"
type: string
options:
- x64
- arm64
target:
description: "Specified target for rust toolchain, ex. x86_64-apple-darwin"
type: string
required: true
engine-version:
description: "Engine version to install"
required: false
type: string
publish:
description: "Enable building the wrapper in release mode"
required: false
type: boolean
default: "false"
npm_scope:
description: "The NPM scope"
required: false
type: string
default: "@valkey"
github-token:
description: "GITHUB_TOKEN, GitHub App installation access token"
required: true
type: string
env:
CARGO_TERM_COLOR: always
runs:
using: "composite"
steps:
- name: Install software dependencies
uses: ./.github/workflows/install-shared-dependencies
with:
os: ${{ inputs.os }}
target: ${{ inputs.target }}
github-token: ${{ inputs.github-token }}
engine-version: ${{ inputs.engine-version }}
- name: Create package.json file
uses: ./.github/workflows/node-create-package-file
with:
release_version: ${{ env.RELEASE_VERSION }}
os: ${{ inputs.os }}
named_os: ${{ inputs.named_os }}
arch: ${{ inputs.arch }}
npm_scope: ${{ inputs.npm_scope }}
target: ${{ inputs.target }}
- name: npm install
shell: bash
working-directory: ./node
run: |
rm -rf node_modules && npm install --frozen-lockfile
cd rust-client
npm install --frozen-lockfile
- name: Build
shell: bash
working-directory: ./node
run: |
source "$HOME/.cargo/env"
TARGET_FLAG=`if [ "${{ inputs.target }}" != '' ]; then echo "--target ${{ inputs.target }}"; fi`
BUILD_FLAG=`if [ "${{ inputs.publish }}" == 'true' ]; then echo "build:release"; else echo "build"; fi`
npm run $BUILD_FLAG --build-flags="$TARGET_FLAG"