38
38
strategy :
39
39
fail-fast : false
40
40
matrix :
41
- build : [linux, macos, windows, linux-aarch64]
41
+ build : [linux, macos, macos-arm64, windows, linux-aarch64]
42
42
include :
43
43
- build : linux
44
44
os : ubuntu-18.04
55
55
artifact_name : ' wasmer-macos-amd64'
56
56
cross_compilation_artifact_name : ' cross_compiled_from_mac'
57
57
run_integration_tests : true
58
+ - build : macos-arm64
59
+ os : macos-11.0
60
+ rust : nightly
61
+ target : aarch64-apple-darwin
62
+ artifact_name : ' wasmer-macos-arm64'
58
63
- build : windows
59
64
os : windows-latest
60
65
rust : 1.47.0
@@ -83,42 +88,16 @@ jobs:
83
88
uses : actions-rs/toolchain@v1
84
89
with :
85
90
toolchain : ${{ matrix.rust }}
91
+ target : ${{ matrix.target }}
86
92
override : true
87
- - name : Configure cargo data directory
88
- # After this point, all cargo registry and crate data is stored in
89
- # $GITHUB_WORKSPACE/.cargo_home. This allows us to cache only the files
90
- # that are needed during the build process. Additionally, this works
91
- # around a bug in the 'cache' action that causes directories outside of
92
- # the workspace dir to be saved/restored incorrectly.
93
- run : echo "CARGO_HOME=$(pwd)/.cargo_home" >> $GITHUB_ENV
94
- - name : Cache
95
- uses : actions/cache@master
96
- with :
97
- # Note: crates from the git repo always get rebuilt
98
- # so we cache only those subdirectories of target/{debug|release} that
99
- # contain the build output for crates that come from the registry.
100
- path : |-
101
- .cargo_home
102
- target/*/.*
103
- target/*/build
104
- target/*/deps
105
- key : ${{ matrix.os }}-${{ matrix.rust }}-${{ hashFiles('Cargo.lock') }}
106
- restore-keys : |
107
- ${{ matrix.os }}-${{ matrix.rust }}-
108
- # # Install sccache
109
- # - uses: actions/cache@master
110
- # with:
111
- # path: ${{ runner.tool_cache }}/cargo-sccache
112
- # key: cargo-sccache-bin-${{ env.CARGO_SCCACHE_VERSION }}
113
- # - name: Install sccache
114
- # run: |
115
- # echo "${{ runner.tool_cache }}/cargo-sccache/bin" >> $GITHUB_PATH
116
- # cargo install sccache --version ${{ env.CARGO_SCCACHE_VERSION }} --root ${{ runner.tool_cache }}/cargo-sccache
117
- # - name: Start sccache
118
- # run: |
119
- # ${{ runner.tool_cache }}/cargo-sccache/bin/sccache --start-server
120
- # ${{ runner.tool_cache }}/cargo-sccache/bin/sscache -s
121
- # echo "RUSTC_WRAPPER=${{ runner.tool_cache }}/cargo-sccache/bin/sccache" >> $GITHUB_ENV
93
+ - name : Setup Rust target
94
+ run : |
95
+ cat << EOF > .cargo/config.toml
96
+ [build]
97
+ target = "${{ matrix.target }}"
98
+ EOF
99
+ if : matrix.target
100
+ - uses : Swatinem/rust-cache@v1
122
101
- name : Install LLVM (Windows)
123
102
if : matrix.os == 'windows-latest'
124
103
shell : cmd
@@ -131,7 +110,7 @@ jobs:
131
110
# echo "LLVM_SYS_100_PREFIX=C:/llvm-10" >> $GITHUB_ENV
132
111
# echo "LIBCLANG_PATH=C:/llvm-10/bin/libclang.dll" >> $GITHUB_ENV
133
112
- name : Install LLVM (Unix)
134
- if : matrix.os != 'windows-latest'
113
+ if : matrix.os != 'windows-latest' && matrix.target != 'aarch64-apple-darwin'
135
114
run : |
136
115
curl --proto '=https' --tlsv1.2 -sSf ${{ matrix.llvm_url }} -L -o llvm.tar.xz
137
116
mkdir -p ${{ env.LLVM_DIR }}
@@ -141,14 +120,25 @@ jobs:
141
120
env :
142
121
LLVM_DIR : ${{ github.workspace }}/llvm-10
143
122
- name : Set up dependencies for Mac OS
144
- run : brew install automake
145
- if : matrix.os == 'macos-latest'
146
- - run : make test
147
- - name : Build and Test C API
123
+ run : |
124
+ brew install automake
125
+ if : matrix.os == 'macos-latest' || matrix.os == 'macos-11.0'
126
+ - name : Test
127
+ run : |
128
+ make test
129
+ if : matrix.target != 'aarch64-apple-darwin'
130
+ - name : Test C API
148
131
run : |
149
132
make test-capi
133
+ if : matrix.os != 'windows-latest' && matrix.target != 'aarch64-apple-darwin' # we can't test yet on Apple Silicon or Windows
134
+ - name : Build C API
135
+ run : |
150
136
make build-capi
151
- if : matrix.os != 'windows-latest'
137
+ if : matrix.os != 'windows-latest' && matrix.target != 'aarch64-apple-darwin'
138
+ - name : Build C API
139
+ run : |
140
+ make build-capi-cranelift-system-libffi
141
+ if : matrix.target == 'aarch64-apple-darwin'
152
142
- name : Build C API on Windows
153
143
run : make build-capi
154
144
if : matrix.os == 'windows-latest'
@@ -158,14 +148,20 @@ jobs:
158
148
- name : Build Wapm binary
159
149
run : |
160
150
make build-wapm
161
- if : needs.setup.outputs.DOING_RELEASE == '1'
162
- - name : Package Wasmer for integration tests
163
- run : make package-without-wapm-for-integration-tests
164
- if : needs.setup.outputs.DOING_RELEASE != '1'
165
- - name : Package Wasmer
151
+ # if: needs.setup.outputs.DOING_RELEASE == '1'
152
+ - name : Copy target binaries
166
153
run : |
167
- make package
168
- if : needs.setup.outputs.DOING_RELEASE == '1'
154
+ mkdir -p target/release
155
+ cp target/${{matrix.target}}/release/wasmer* target/release
156
+ cp target/${{matrix.target}}/release/libwasmer* target/release
157
+ if [ -d "wapm-cli" ]; then
158
+ mkdir -p wapm-cli/target/release
159
+ cp wapm-cli/target/${{matrix.target}}/release/wapm* wapm-cli/target/release
160
+ fi
161
+ if : matrix.target
162
+ - name : Dist
163
+ run : |
164
+ make distribution
169
165
- name : Run integration tests (Windows)
170
166
shell : cmd
171
167
run : |
@@ -220,7 +216,6 @@ jobs:
220
216
path : cross
221
217
- name : Upload Artifacts
222
218
uses : actions/upload-artifact@v2
223
- if : needs.setup.outputs.DOING_RELEASE == '1'
224
219
with :
225
220
name : ${{ matrix.artifact_name }}
226
221
path : dist
@@ -300,7 +295,7 @@ jobs:
300
295
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
301
296
with :
302
297
upload_url : ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
303
- asset_path : artifacts/wasmer-windows-amd64/wasmer-windows .exe
298
+ asset_path : artifacts/wasmer-windows-amd64/WasmerInstaller .exe
304
299
asset_name : wasmer-windows.exe
305
300
asset_content_type : application/vnd.microsoft.portable-executable
306
301
- name : Upload Release Asset Linux amd64
@@ -310,27 +305,37 @@ jobs:
310
305
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
311
306
with :
312
307
upload_url : ${{ steps.create_release.outputs.upload_url }}
313
- asset_path : artifacts/wasmer-linux-amd64/wasmer-linux-amd64 .tar.gz
308
+ asset_path : artifacts/wasmer-linux-amd64/wasmer.tar.gz
314
309
asset_name : wasmer-linux-amd64.tar.gz
315
310
asset_content_type : application/gzip
316
- - name : Upload Release Asset Mac
317
- id : upload-release-asset-mac
311
+ - name : Upload Release Asset Mac amd64
312
+ id : upload-release-asset-mac-amd64
318
313
uses : actions/upload-release-asset@v1
319
314
env :
320
315
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
321
316
with :
322
317
upload_url : ${{ steps.create_release.outputs.upload_url }}
323
- asset_path : artifacts/wasmer-macos-amd64/wasmer-darwin-amd64 .tar.gz
318
+ asset_path : artifacts/wasmer-macos-amd64/wasmer.tar.gz
324
319
asset_name : wasmer-darwin-amd64.tar.gz
325
320
asset_content_type : application/gzip
321
+ - name : Upload Release Asset Mac arm64
322
+ id : upload-release-asset-mac-arm64
323
+ uses : actions/upload-release-asset@v1
324
+ env :
325
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
326
+ with :
327
+ upload_url : ${{ steps.create_release.outputs.upload_url }}
328
+ asset_path : artifacts/wasmer-macos-amd64/wasmer.tar.gz
329
+ asset_name : wasmer-darwin-arm64.tar.gz
330
+ asset_content_type : application/gzip
326
331
- name : Upload Release Asset Linux aarch64
327
332
id : upload-release-asset-linux-aarch64
328
333
uses : actions/upload-release-asset@v1
329
334
env :
330
335
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
331
336
with :
332
337
upload_url : ${{ steps.create_release.outputs.upload_url }}
333
- asset_path : artifacts/wasmer-linux-aarch64/wasmer-linux-aarch64 .tar.gz
338
+ asset_path : artifacts/wasmer-linux-aarch64/wasmer.tar.gz
334
339
asset_name : wasmer-linux-aarch64.tar.gz
335
340
asset_content_type : application/gzip
336
341
0 commit comments