File tree 3 files changed +40
-8
lines changed
3 files changed +40
-8
lines changed Original file line number Diff line number Diff line change 9
9
runs-on : ${{ matrix.os }}
10
10
strategy :
11
11
matrix :
12
- os : [ubuntu-latest, macos-latest, windows-latest]
12
+ target :
13
+ - aarch64-unknown-linux-musl
14
+ - x86_64-unknown-linux-gnu
15
+ - x86_64-unknown-linux-musl
16
+ - x86_64-apple-darwin
17
+ - x86_64-pc-windows-msvc
18
+ include :
19
+ - target : aarch64-unknown-linux-musl
20
+ os : ubuntu-latest
21
+ - target : x86_64-unknown-linux-gnu
22
+ os : ubuntu-latest
23
+ - target : x86_64-unknown-linux-musl
24
+ os : ubuntu-latest
25
+ - target : x86_64-apple-darwin
26
+ os : macos-latest
27
+ - target : x86_64-pc-windows-msvc
28
+ os : windows-latest
13
29
steps :
14
30
- uses : actions/checkout@master
15
31
- name : Install hub
16
32
run : ci/install-hub.sh ${{ matrix.os }}
17
33
shell : bash
18
34
- name : Install Rust
19
- run : ci/install-rust.sh stable
35
+ run : ci/install-rust.sh stable ${{ matrix.target }}
20
36
shell : bash
21
37
- name : Build and deploy artifacts
22
38
env :
23
39
GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
24
- run : ci/make-release.sh ${{ matrix.os }}
40
+ run : ci/make-release.sh ${{ matrix.os }} ${{ matrix.target }}
25
41
shell : bash
26
42
pages :
27
43
name : GitHub Pages
Original file line number Diff line number Diff line change @@ -13,6 +13,17 @@ TOOLCHAIN="$1"
13
13
rustup set profile minimal
14
14
rustup component remove --toolchain=$TOOLCHAIN rust-docs || echo " already removed"
15
15
rustup update --no-self-update $TOOLCHAIN
16
+ if [ -n " $2 " ]
17
+ then
18
+ TARGET=" $2 "
19
+ HOST=$( rustc -Vv | grep ^host: | sed -e " s/host: //g" )
20
+ if [ " $HOST " != " $TARGET " ]
21
+ then
22
+ rustup component add llvm-tools-preview --toolchain=$TOOLCHAIN
23
+ rustup component add rust-std-$TARGET --toolchain=$TOOLCHAIN
24
+ fi
25
+ fi
26
+
16
27
rustup default $TOOLCHAIN
17
28
rustup -V
18
29
rustc -Vv
Original file line number Diff line number Diff line change 11
11
TAG=${GITHUB_REF#*/ tags/ }
12
12
13
13
host=$( rustc -Vv | grep ^host: | sed -e " s/host: //g" )
14
+ target=$2
15
+ if [ " $host " != " $target " ]
16
+ then
17
+ export " CARGO_TARGET_$( echo $target | tr a-z- A-Z_) _LINKER" =rust-lld
18
+ fi
14
19
export CARGO_PROFILE_RELEASE_LTO=true
15
- cargo build --bin mdbook --release
16
- cd target/release
20
+ cargo build --bin mdbook --release --target $target
21
+ cd target/$target / release
17
22
case $1 in
18
23
ubuntu* )
19
- asset=" mdbook-$TAG -$host .tar.gz"
24
+ asset=" mdbook-$TAG -$target .tar.gz"
20
25
tar czf ../../$asset mdbook
21
26
;;
22
27
macos* )
23
- asset=" mdbook-$TAG -$host .tar.gz"
28
+ asset=" mdbook-$TAG -$target .tar.gz"
24
29
# There is a bug with BSD tar on macOS where the first 8MB of the file are
25
30
# sometimes all NUL bytes. See https://github.com/actions/cache/issues/403
26
31
# and https://github.com/rust-lang/cargo/issues/8603 for some more
@@ -30,7 +35,7 @@ case $1 in
30
35
tar czf ../../$asset mdbook
31
36
;;
32
37
windows* )
33
- asset=" mdbook-$TAG -$host .zip"
38
+ asset=" mdbook-$TAG -$target .zip"
34
39
7z a ../../$asset mdbook.exe
35
40
;;
36
41
* )
You can’t perform that action at this time.
0 commit comments