@@ -25,31 +25,31 @@ jobs:
25
25
NAME : linux-x64-glibc,
26
26
OS : ubuntu-latest,
27
27
TOOLCHAIN : stable,
28
- TARGET : x86_64-unknown-linux-gnu,
28
+ TARGET : x86_64-unknown-linux-gnu
29
29
}
30
30
- {
31
31
NAME : linux-arm64-glibc,
32
- OS : ubuntu-latest ,
32
+ OS : arm64 ,
33
33
TOOLCHAIN : stable,
34
- TARGET : aarch64-unknown-linux-gnu,
34
+ TARGET : aarch64-unknown-linux-gnu
35
35
}
36
36
- {
37
37
NAME : win32-x64-msvc,
38
38
OS : windows-latest,
39
39
TOOLCHAIN : stable,
40
- TARGET : x86_64-pc-windows-msvc,
40
+ TARGET : x86_64-pc-windows-msvc
41
41
}
42
42
- {
43
43
NAME : darwin-x64,
44
44
OS : macos-latest,
45
45
TOOLCHAIN : stable,
46
- TARGET : x86_64-apple-darwin,
46
+ TARGET : x86_64-apple-darwin
47
47
}
48
48
- {
49
49
NAME : darwin-arm64,
50
50
OS : macos-latest,
51
51
TOOLCHAIN : stable,
52
- TARGET : aarch64-apple-darwin,
52
+ TARGET : aarch64-apple-darwin
53
53
}
54
54
steps :
55
55
- name : Checkout this magicblock-validator
@@ -85,21 +85,10 @@ jobs:
85
85
version : latest
86
86
87
87
- name : Install build dependencies
88
- if : matrix.build.OS == 'ubuntu-latest'
88
+ if : startsWith( matrix.build.OS, 'ubuntu')
89
89
run : |
90
90
sudo apt-get update
91
- sudo apt-get install -y libclang-dev protobuf-compiler cmake pkg-config libssl-dev ca-certificates openssh-client
92
-
93
- - name : Install cross compiler (if needed)
94
- if : matrix.build.TARGET == 'aarch64-unknown-linux-gnu'
95
- run : |
96
- sudo apt-get install -y gcc-aarch64-linux-gnu g++-aarch64-linux-gnu binutils-aarch64-linux-gnu
97
- aarch64-linux-gnu-gcc --version
98
- aarch64-linux-gnu-ld --version
99
- mkdir -p ~/.cargo
100
- echo '[target.aarch64-unknown-linux-gnu]' >> ~/.cargo/config.toml
101
- echo 'linker = "aarch64-linux-gnu-gcc"' >> ~/.cargo/config.toml
102
- echo 'ar = "aarch64-linux-gnu-ar"' >> ~/.cargo/config.toml
91
+ sudo apt-get install -y libclang-dev protobuf-compiler cmake pkg-config libssl-dev ca-certificates openssh-client libudev-dev
103
92
104
93
- name : Build (linux/macos/windows)
105
94
uses : actions-rs/cargo@v1
109
98
110
99
- name : Check versions are aligned
111
100
run : |
112
- # Fails if versions are not aligned
113
101
cd magicblock-validator/.github && ./version-align.sh --check
114
102
115
103
- name : Build the NPM package
@@ -118,36 +106,25 @@ jobs:
118
106
cd magicblock-validator
119
107
bin="ephemeral-validator"
120
108
mv target/${{ matrix.build.TARGET }}/release/rpc target/${{ matrix.build.TARGET }}/release/${bin}
121
- # derive the OS and architecture from the build matrix name
122
- # note: when split by a hyphen, first part is the OS and the second is the architecture
123
109
node_os=$(echo "${{ matrix.build.NAME }}" | cut -d '-' -f1)
124
110
export node_os
125
111
node_arch=$(echo "${{ matrix.build.NAME }}" | cut -d '-' -f2)
126
112
export node_arch
127
- # set the version
128
113
export node_version="${{ env.RELEASE_VERSION }}"
129
- # set the package name
130
- # note: use 'windows' as OS name instead of 'win32'
131
114
if [ "${{ matrix.build.OS }}" = "windows-latest" ]; then
132
115
export node_pkg="${bin}-windows-${node_arch}"
133
116
else
134
117
export node_pkg="${bin}-${node_os}-${node_arch}"
135
118
fi
136
119
echo "node_pkg=${node_pkg}" >> $GITHUB_ENV
137
- # create the package directory
138
120
mkdir -p "${node_pkg}/bin"
139
- # generate package.json from the template
140
121
envsubst < .github/packages/npm-package/package.json.tmpl > "${node_pkg}/package.json"
141
122
cat "${node_pkg}/package.json"
142
- # copy the binary into the package
143
- # note: windows binaries has '.exe' extension
144
123
if [ "${{ matrix.build.OS }}" = "windows-latest" ]; then
145
124
bin="${bin}.exe"
146
125
fi
147
126
echo "bin_name=${bin}" >> $GITHUB_ENV
148
127
cp "target/${{ matrix.build.TARGET }}/release/${bin}" "${node_pkg}/bin"
149
-
150
- # Create the release bin file
151
128
release_name="ephemeral-validator-${{ matrix.build.NAME }}"
152
129
if [ "${{ matrix.build.OS }}" = "windows-latest" ]; then
153
130
release_name="${release_name}.exe"
@@ -216,4 +193,4 @@ jobs:
216
193
npm publish --access public
217
194
fi
218
195
env :
219
- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
196
+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
0 commit comments