@@ -25,31 +25,31 @@ jobs:
2525 NAME : linux-x64-glibc,
2626 OS : ubuntu-latest,
2727 TOOLCHAIN : stable,
28- TARGET : x86_64-unknown-linux-gnu,
28+ TARGET : x86_64-unknown-linux-gnu
2929 }
3030 - {
3131 NAME : linux-arm64-glibc,
32- OS : ubuntu-latest ,
32+ OS : arm64 ,
3333 TOOLCHAIN : stable,
34- TARGET : aarch64-unknown-linux-gnu,
34+ TARGET : aarch64-unknown-linux-gnu
3535 }
3636 - {
3737 NAME : win32-x64-msvc,
3838 OS : windows-latest,
3939 TOOLCHAIN : stable,
40- TARGET : x86_64-pc-windows-msvc,
40+ TARGET : x86_64-pc-windows-msvc
4141 }
4242 - {
4343 NAME : darwin-x64,
4444 OS : macos-latest,
4545 TOOLCHAIN : stable,
46- TARGET : x86_64-apple-darwin,
46+ TARGET : x86_64-apple-darwin
4747 }
4848 - {
4949 NAME : darwin-arm64,
5050 OS : macos-latest,
5151 TOOLCHAIN : stable,
52- TARGET : aarch64-apple-darwin,
52+ TARGET : aarch64-apple-darwin
5353 }
5454 steps :
5555 - name : Checkout this magicblock-validator
@@ -85,21 +85,10 @@ jobs:
8585 version : latest
8686
8787 - name : Install build dependencies
88- if : matrix.build.OS == 'ubuntu-latest'
88+ if : startsWith( matrix.build.OS, 'ubuntu')
8989 run : |
9090 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
10392
10493 - name : Build (linux/macos/windows)
10594 uses : actions-rs/cargo@v1
10998
11099 - name : Check versions are aligned
111100 run : |
112- # Fails if versions are not aligned
113101 cd magicblock-validator/.github && ./version-align.sh --check
114102
115103 - name : Build the NPM package
@@ -118,36 +106,25 @@ jobs:
118106 cd magicblock-validator
119107 bin="ephemeral-validator"
120108 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
123109 node_os=$(echo "${{ matrix.build.NAME }}" | cut -d '-' -f1)
124110 export node_os
125111 node_arch=$(echo "${{ matrix.build.NAME }}" | cut -d '-' -f2)
126112 export node_arch
127- # set the version
128113 export node_version="${{ env.RELEASE_VERSION }}"
129- # set the package name
130- # note: use 'windows' as OS name instead of 'win32'
131114 if [ "${{ matrix.build.OS }}" = "windows-latest" ]; then
132115 export node_pkg="${bin}-windows-${node_arch}"
133116 else
134117 export node_pkg="${bin}-${node_os}-${node_arch}"
135118 fi
136119 echo "node_pkg=${node_pkg}" >> $GITHUB_ENV
137- # create the package directory
138120 mkdir -p "${node_pkg}/bin"
139- # generate package.json from the template
140121 envsubst < .github/packages/npm-package/package.json.tmpl > "${node_pkg}/package.json"
141122 cat "${node_pkg}/package.json"
142- # copy the binary into the package
143- # note: windows binaries has '.exe' extension
144123 if [ "${{ matrix.build.OS }}" = "windows-latest" ]; then
145124 bin="${bin}.exe"
146125 fi
147126 echo "bin_name=${bin}" >> $GITHUB_ENV
148127 cp "target/${{ matrix.build.TARGET }}/release/${bin}" "${node_pkg}/bin"
149-
150- # Create the release bin file
151128 release_name="ephemeral-validator-${{ matrix.build.NAME }}"
152129 if [ "${{ matrix.build.OS }}" = "windows-latest" ]; then
153130 release_name="${release_name}.exe"
@@ -216,4 +193,4 @@ jobs:
216193 npm publish --access public
217194 fi
218195 env :
219- NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
196+ NODE_AUTH_TOKEN : ${{ secrets.NPM_TOKEN }}
0 commit comments