Skip to content

Commit 88a4259

Browse files
committed
add riscv64 release target
1 parent 4298f40 commit 88a4259

2 files changed

Lines changed: 36 additions & 20 deletions

File tree

.github/workflows/release-linter.yaml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,44 +18,51 @@ jobs:
1818
build:
1919
- {
2020
NAME: x86_64-linux,
21-
TOOLCHAIN: stable,
2221
TARGET: x86_64-unknown-linux-musl,
2322
}
2423
- {
2524
NAME: aarch64-linux,
26-
TOOLCHAIN: stable,
2725
TARGET: aarch64-unknown-linux-musl,
2826
}
27+
- {
28+
NAME: riscv64-linux,
29+
TARGET: riscv64gc-unknown-linux-musl
30+
}
2931
steps:
3032
- name: Checkout
3133
uses: actions/checkout@v4
34+
3235
- name: Set the release version
3336
shell: bash
3437
run: echo "RELEASE_VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV
38+
3539
- name: Install dependencies
3640
shell: bash
3741
run: |
3842
sudo apt-get update
3943
sudo apt-get install -y --no-install-recommends \
4044
--allow-unauthenticated musl-tools b3sum
45+
4146
- name: Install Rust toolchain
42-
uses: actions-rs/toolchain@v1
47+
uses: dtolnay/rust-toolchain@nightly
48+
with:
49+
targets: ${{ matrix.build.TARGET }}
50+
51+
- name: Install cross-compilation tools
52+
uses: taiki-e/setup-cross-toolchain-action@v1
4353
with:
44-
toolchain: ${{ matrix.build.TOOLCHAIN }}
4554
target: ${{ matrix.build.TARGET }}
46-
override: true
55+
4756
- name: Build
48-
uses: actions-rs/cargo@v1
49-
with:
50-
use-cross: true
51-
command: build
52-
args: --bin sbuild-linter --release --locked --target ${{ matrix.build.TARGET }}
57+
run: RUSTFLAGS="-C target-feature=+crt-static" cargo build --bin sbuild-linter --release --locked --target ${{ matrix.build.TARGET }}
58+
5359
- name: Prepare release assets
5460
shell: bash
5561
run: |
5662
mkdir -p release
5763
cp {LICENSE,README.md} release/
5864
cp "target/${{ matrix.build.TARGET }}/release/sbuild-linter" release/
65+
5966
- name: Create release artifacts
6067
shell: bash
6168
run: |
@@ -66,6 +73,7 @@ jobs:
6673
release/
6774
b3sum sbuild-linter-${{ matrix.build.NAME }}.tar.gz \
6875
> sbuild-linter-${{ matrix.build.NAME }}.tar.gz.b3sum
76+
6977
- name: Publish to GitHub
7078
uses: svenstaro/upload-release-action@v2
7179
with:

.github/workflows/release-sbuild.yaml

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,44 +18,51 @@ jobs:
1818
build:
1919
- {
2020
NAME: x86_64-linux,
21-
TOOLCHAIN: stable,
2221
TARGET: x86_64-unknown-linux-musl,
2322
}
2423
- {
2524
NAME: aarch64-linux,
26-
TOOLCHAIN: stable,
2725
TARGET: aarch64-unknown-linux-musl,
2826
}
27+
- {
28+
NAME: riscv64-linux,
29+
TARGET: riscv64gc-unknown-linux-musl
30+
}
2931
steps:
3032
- name: Checkout
3133
uses: actions/checkout@v4
34+
3235
- name: Set the release version
3336
shell: bash
3437
run: echo "RELEASE_VERSION=${GITHUB_REF:11}" >> $GITHUB_ENV
38+
3539
- name: Install dependencies
3640
shell: bash
3741
run: |
3842
sudo apt-get update
3943
sudo apt-get install -y --no-install-recommends \
4044
--allow-unauthenticated musl-tools b3sum
45+
4146
- name: Install Rust toolchain
42-
uses: actions-rs/toolchain@v1
47+
uses: dtolnay/rust-toolchain@nightly
48+
with:
49+
targets: ${{ matrix.build.TARGET }}
50+
51+
- name: Install cross-compilation tools
52+
uses: taiki-e/setup-cross-toolchain-action@v1
4353
with:
44-
toolchain: ${{ matrix.build.TOOLCHAIN }}
4554
target: ${{ matrix.build.TARGET }}
46-
override: true
55+
4756
- name: Build
48-
uses: actions-rs/cargo@v1
49-
with:
50-
use-cross: true
51-
command: build
52-
args: --bin sbuild --release --locked --target ${{ matrix.build.TARGET }}
57+
run: RUSTFLAGS="-C target-feature=+crt-static" cargo build --bin sbuild --release --locked --target ${{ matrix.build.TARGET }}
58+
5359
- name: Prepare release assets
5460
shell: bash
5561
run: |
5662
mkdir -p release
5763
cp {LICENSE,README.md} release/
5864
cp "target/${{ matrix.build.TARGET }}/release/sbuild" release/
65+
5966
- name: Create release artifacts
6067
shell: bash
6168
run: |
@@ -66,6 +73,7 @@ jobs:
6673
release/
6774
b3sum sbuild-${{ matrix.build.NAME }}.tar.gz \
6875
> sbuild-${{ matrix.build.NAME }}.tar.gz.b3sum
76+
6977
- name: Publish to GitHub
7078
uses: svenstaro/upload-release-action@v2
7179
with:

0 commit comments

Comments
 (0)