Skip to content

Commit c4dfbca

Browse files
committed
ci(cross): gnu => musl
1 parent 844b5d0 commit c4dfbca

File tree

2 files changed

+19
-6
lines changed

2 files changed

+19
-6
lines changed

.github/workflows/cross-x64.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ env:
1414
RUBYOPT: "--disable=gems"
1515
cargo_build_profile: thin
1616
ghcr_repo: 'ghcr.io/2cd/pkgs'
17+
cargo_target: 'x86_64-unknown-linux-musl'
1718

1819
jobs:
1920
build:
@@ -68,7 +69,17 @@ jobs:
6869
- name: cargo build
6970
run: |
7071
pp `cargo -Vv`
71-
%w[cargo b --profile ${{env.cargo_build_profile}}]
72+
%w[rustup target add ${{env.cargo_target}}].then(&run)
73+
apt = %w[sudo apt-get]
74+
apt.dup.push('update').then(&run)
75+
apt.concat(%w[install -y musl-tools]).then(&run)
76+
{
77+
cargo: nil,
78+
build: nil,
79+
profile: ${{env.cargo_build_profile}},
80+
target: ${{env.cargo_target}},
81+
}
82+
.then(&hash_to_args)
7283
.then(&run)
7384
7485
- uses: actions/checkout@v4
@@ -96,8 +107,7 @@ jobs:
96107
docker_file: 'pkgs/ci/cross.dockerfile',
97108
pkg_name: 'cross',
98109
suffix: '',
99-
# target: 'x86_64-unknown-linux-gnu',
100-
target: '',
110+
target: '${{env.cargo_target}}',
101111
}
102112
103113
[cfg, cfg.merge({pkg_name: 'cross-util'})].each do |x|

docs/Readme.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22

33
1. cross-rs
44

5-
```sh
6-
docker run -v $PWD:/host --rm ghcr.io/2cd/pkgs:cross-x64 cp -a . /host
5+
github actions:
76

8-
./cross
7+
```yaml
8+
- name: fetch cross-rs bin
9+
run: docker run -v /usr/local/bin:/host --rm ghcr.io/2cd/pkgs:cross-x64 cp cross /host
10+
- name: run cross
11+
run: cross build --release --target riscv64gc-unknown-linux-musl
912
```

0 commit comments

Comments
 (0)