Skip to content

Commit 9b93592

Browse files
author
E Shattow
committed
Build for riscv64
1 parent 2266634 commit 9b93592

4 files changed

Lines changed: 12 additions & 122 deletions

File tree

.github/workflows/ci.yml

Lines changed: 8 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
- variant: gnu
3333
- variant: musl
3434
name: Merge image / ${{matrix.variant}}
35-
runs-on: ubuntu-latest
35+
runs-on: ubuntu-24.04-riscv
3636
permissions:
3737
id-token: write
3838
contents: read
@@ -111,49 +111,20 @@ jobs:
111111
fail-fast: false
112112
matrix:
113113
include:
114-
- target: x86_64-unknown-linux-gnu
115-
platform: linux/amd64
114+
- target: riscv64-unknown-linux-gnu
115+
platform: linux/riscv64
116116
suffix: ""
117117
build_env: ""
118-
- target: x86_64-unknown-linux-musl
119-
platform: linux/amd64
120-
suffix: "-alpine"
121-
build_env: ""
122-
- target: aarch64-unknown-linux-gnu
123-
platform: linux/arm64
124-
suffix: ""
125-
build_env: "JEMALLOC_SYS_WITH_LG_PAGE=16 "
126-
- target: aarch64-unknown-linux-musl
127-
platform: linux/arm64
128-
suffix: "-alpine"
129-
build_env: "JEMALLOC_SYS_WITH_LG_PAGE=16 "
130-
- target: armv7-unknown-linux-gnueabihf
131-
platform: linux/arm/v7
132-
suffix: ""
133-
build_env: "JEMALLOC_SYS_WITH_LG_PAGE=16 "
134-
- target: armv7-unknown-linux-musleabihf
135-
platform: linux/arm/v7
136-
suffix: "-alpine"
137-
build_env: "JEMALLOC_SYS_WITH_LG_PAGE=16 "
138-
- target: arm-unknown-linux-gnueabihf
139-
platform: linux/arm/v6
140-
suffix: ""
141-
build_env: ""
142-
- target: arm-unknown-linux-musleabihf
143-
platform: linux/arm/v6
118+
- target: riscv64-unknown-linux-musl
119+
platform: linux/riscv64
144120
suffix: "-alpine"
145121
build_env: ""
146122
name: Build / ${{matrix.target}}
147-
runs-on: ubuntu-latest
123+
runs-on: ubuntu-24.04-riscv
148124
steps:
149125
- name: Checkout
150126
uses: actions/checkout@v6.0.1
151127

152-
- name: Set up QEMU
153-
uses: docker/setup-qemu-action@v3
154-
with:
155-
platforms: "arm64,arm"
156-
157128
- name: Set up Docker Buildx
158129
uses: docker/setup-buildx-action@v3
159130
with:
@@ -289,96 +260,15 @@ jobs:
289260
if-no-files-found: error
290261
retention-days: 1
291262

292-
windows:
293-
name: Build / ${{matrix.target}}
294-
runs-on: windows-latest
295-
strategy:
296-
fail-fast: false
297-
matrix:
298-
include:
299-
# - target: aarch64-pc-windows-msvc
300-
- target: x86_64-pc-windows-msvc
301-
302-
steps:
303-
- name: Checkout
304-
uses: actions/checkout@v6.0.1
305-
306-
- name: Run sccache-cache
307-
uses: mozilla-actions/sccache-action@v0.0.9
308-
with:
309-
disable_annotations: true
310-
311-
- name: Build
312-
run: |
313-
rustup target add ${{matrix.target}}
314-
cargo build --release --target ${{matrix.target}} -p stalwart --no-default-features --features "sqlite postgres mysql rocks s3 redis azure nats enterprise"
315-
cargo build --release --target ${{matrix.target}} -p stalwart-cli
316-
mkdir -p artifacts
317-
mv ./target/${{matrix.target}}/release/stalwart.exe ./artifacts/stalwart.exe
318-
mv ./target/${{matrix.target}}/release/stalwart-cli.exe ./artifacts/stalwart-cli.exe
319-
320-
- name: Upload Artifacts
321-
uses: actions/upload-artifact@v6
322-
with:
323-
name: artifact-${{matrix.target}}
324-
path: artifacts
325-
326-
macos:
327-
name: Build / ${{matrix.target}}
328-
runs-on: macos-latest
329-
strategy:
330-
fail-fast: false
331-
matrix:
332-
include:
333-
- target: aarch64-apple-darwin
334-
- target: x86_64-apple-darwin
335-
steps:
336-
- name: Checkout
337-
uses: actions/checkout@v6.0.1
338-
339-
- name: Run sccache-cache
340-
uses: mozilla-actions/sccache-action@v0.0.9
341-
with:
342-
disable_annotations: true
343-
344-
#- name: Build FoundationDB Edition
345-
# env:
346-
# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
347-
# run: |
348-
# rustup target add ${{matrix.target}}
349-
# # Get latest FoundationDB installer
350-
# curl --retry 5 -Lso foundationdb.pkg "$(gh api -X GET /repos/apple/foundationdb/releases --jq '.[] | select(.prerelease == false) | .assets[] | select(.name | test("${{startsWith(matrix.target, 'x86') && 'x86_64' || 'arm64'}}" + ".pkg$")) | .browser_download_url' | head -n1)"
351-
# echo "=== Package contents ==="
352-
# pkgutil --payload-files foundationdb.pkg || true
353-
# sudo installer -allowUntrusted -verbose -dumplog -pkg foundationdb.pkg -target /
354-
# cargo build --release --target ${{matrix.target}} -p stalwart --no-default-features --features "foundationdb s3 redis nats enterprise"
355-
# mkdir -p artifacts
356-
# mv ./target/${{matrix.target}}/release/stalwart ./artifacts/stalwart-foundationdb
357-
358-
- name: Build
359-
run: |
360-
rustup target add ${{matrix.target}}
361-
cargo build --release --target ${{matrix.target}} -p stalwart --no-default-features --features "sqlite postgres mysql rocks s3 redis azure nats enterprise"
362-
cargo build --release --target ${{matrix.target}} -p stalwart-cli
363-
mkdir -p artifacts
364-
mv ./target/${{matrix.target}}/release/stalwart ./artifacts/stalwart
365-
mv ./target/${{matrix.target}}/release/stalwart-cli ./artifacts/stalwart-cli
366-
367-
- name: Upload Artifacts
368-
uses: actions/upload-artifact@v6
369-
with:
370-
name: artifact-${{matrix.target}}
371-
path: artifacts
372-
373263
release:
374264
name: Release
375265
permissions:
376266
id-token: write
377267
contents: write
378268
attestations: write
379269
if: github.event_name == 'push' || inputs.Release
380-
needs: [linux, windows, macos]
381-
runs-on: ubuntu-latest
270+
needs: [linux]
271+
runs-on: ubuntu-24.04-riscv
382272
steps:
383273
- name: Download Artifacts
384274
uses: actions/download-artifact@v7

.github/workflows/scorecard.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ permissions: read-all
2020
jobs:
2121
analysis:
2222
name: Scorecard analysis
23-
runs-on: ubuntu-latest
23+
runs-on: ubuntu-24.04-riscv
2424
# `publish_results: true` only works when run from the default branch. conditional can be removed if disabled.
2525
if: github.event.repository.default_branch == github.ref_name || github.event_name == 'pull_request'
2626
permissions:

.github/workflows/test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
jobs:
77
style:
88
name: Check Style
9-
runs-on: ubuntu-latest
9+
runs-on: ubuntu-24.04-riscv
1010
steps:
1111
- name: Checkout
1212
uses: actions/checkout@v6.0.1
@@ -17,7 +17,7 @@ jobs:
1717
test:
1818
name: Test
1919
needs: style
20-
runs-on: ubuntu-latest
20+
runs-on: ubuntu-24.04-riscv
2121

2222
steps:
2323
- name: Checkout

.github/workflows/trivy.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
security-events: write # for github/codeql-action/upload-sarif to upload SARIF results
2222
actions: read # only required for a private repository by github/codeql-action/upload-sarif to get the Action run status
2323
name: Check
24-
runs-on: ubuntu-latest
24+
runs-on: ubuntu-24.04-riscv
2525
steps:
2626
- name: Checkout code
2727
uses: actions/checkout@v6.0.1

0 commit comments

Comments
 (0)