-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from flashbots/musl-cross-static-linking
Musl cross static linking
- Loading branch information
Showing
6 changed files
with
30 additions
and
52 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,28 +18,24 @@ jobs: | |
matrix: | ||
toolchain: | ||
- stable | ||
#- beta | ||
#- nightly | ||
|
||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
# https://github.com/dtolnay/rust-toolchain | ||
- name: Setup rust toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
toolchain: ${{ matrix.toolchain }} | ||
|
||
- name: Install Protoc | ||
uses: arduino/setup-protoc@v3 | ||
|
||
# https://github.com/WarpBuilds/rust-cache | ||
|
||
- name: Run WarpBuilds/rust-cache | ||
uses: WarpBuilds/rust-cache@v2 | ||
with: | ||
cache-on-failure: true | ||
|
||
# https://github.com/Mozilla-Actions/sccache-action | ||
- name: Run sccache-action | ||
uses: mozilla-actions/[email protected] | ||
|
||
|
@@ -49,10 +45,7 @@ jobs: | |
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV | ||
- name: Install native dependencies | ||
run: sudo apt-get install -y libsqlite3-dev | ||
|
||
####################################################### | ||
run: sudo apt-get update && sudo apt-get install -y libsqlite3-dev | ||
|
||
# lint and test | ||
- run: make lint | ||
- run: make test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,10 +18,6 @@ on: | |
default: false | ||
|
||
jobs: | ||
# | ||
# extract-version extracts the version from the tag or the branch name, | ||
# for reuse in later jobs | ||
# | ||
extract-version: | ||
name: Extract version | ||
runs-on: warp-ubuntu-latest-x64-16x | ||
|
@@ -50,9 +46,6 @@ jobs: | |
echo "| \`GITHUB_SHA\` | \`${GITHUB_SHA}\` |" >> $GITHUB_STEP_SUMMARY | ||
echo "| \`VERSION\` | \`${VERSION}\` |" >> $GITHUB_STEP_SUMMARY | ||
# | ||
# build-binary builds a release binary for a variety of platforms | ||
# | ||
build-binary: | ||
name: Build binary | ||
needs: extract-version | ||
|
@@ -66,64 +59,40 @@ jobs: | |
strategy: | ||
matrix: | ||
configs: | ||
- target: x86_64-unknown-linux-gnu | ||
- target: x86_64-unknown-linux-musl | ||
runner: warp-ubuntu-latest-x64-16x | ||
- target: aarch64-apple-darwin | ||
runner: warp-macos-14-arm64-6x | ||
|
||
steps: | ||
- name: Checkout sources | ||
uses: actions/checkout@v4 | ||
|
||
# https://github.com/dtolnay/rust-toolchain | ||
- name: Setup rust toolchain | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
target: ${{ matrix.configs.target }} | ||
|
||
- name: Install Protoc | ||
uses: arduino/setup-protoc@v3 | ||
|
||
# https://github.com/WarpBuilds/rust-cache | ||
- name: Run WarpBuilds/rust-cache | ||
uses: WarpBuilds/rust-cache@v2 | ||
with: | ||
cache-on-failure: true | ||
|
||
# https://github.com/Mozilla-Actions/sccache-action | ||
- name: Setup sccache-action | ||
uses: mozilla-actions/[email protected] | ||
|
||
- name: Set env vars | ||
run: | | ||
echo "SCCACHE_GHA_ENABLED=true" >> $GITHUB_ENV | ||
echo "RUSTC_WRAPPER=sccache" >> $GITHUB_ENV | ||
- name: Prepare output filename | ||
run: | | ||
OUTPUT_FILENAME="rbuilder-${VERSION}-${{ matrix.configs.target }}.tar.gz" | ||
echo "OUTPUT_FILENAME=$OUTPUT_FILENAME" >> $GITHUB_ENV | ||
echo "Filename: ${OUTPUT_FILENAME}" | ||
- name: Build rbuilder binary | ||
run: cargo build --release | ||
- uses: taiki-e/install-action@cross | ||
|
||
- name: Build binary | ||
run: cross build --release --target ${{ matrix.configs.target }} | ||
|
||
- name: Prepare artifacts | ||
run: | | ||
mkdir -p artifacts | ||
tar -czf "artifacts/${OUTPUT_FILENAME}" -C target/release rbuilder | ||
tar -czf "artifacts/${OUTPUT_FILENAME}" -C target/${{ matrix.configs.target }}/release rbuilder | ||
# https://github.com/actions/upload-artifact | ||
- name: Upload artifacts | ||
uses: actions/[email protected] | ||
with: | ||
name: ${{ env.OUTPUT_FILENAME }} | ||
path: artifacts/${{ env.OUTPUT_FILENAME }} | ||
|
||
# | ||
# draft-release runs after building for various targets, collects artifacts and prepares a draft release | ||
# (only when running against a tag!) | ||
# | ||
draft-release: | ||
name: Draft release | ||
if: ${{ github.event.inputs.draft-release == 'true' || github.event_name == 'push'}} # when manually triggered or version tagged | ||
|
@@ -137,7 +106,6 @@ jobs: | |
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
# https://github.com/actions/download-artifact | ||
- name: Download artifacts | ||
uses: actions/download-artifact@v4 | ||
with: | ||
|
@@ -151,7 +119,6 @@ jobs: | |
for file in *; do sha256sum "$file" >> sha256sums.txt; done; | ||
cat sha256sums.txt | ||
# https://github.com/softprops/action-gh-release | ||
- name: Create release draft | ||
uses: softprops/[email protected] | ||
id: create-release-draft | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
[target.x86_64-unknown-linux-musl] | ||
pre-build = [ | ||
"apt-get update && apt-get install -y pkg-config libssl-dev curl unzip", | ||
"curl -sSL https://github.com/protocolbuffers/protobuf/releases/download/v24.3/protoc-24.3-linux-x86_64.zip -o protoc.zip", | ||
"unzip protoc.zip -d /usr/local", | ||
"chmod +x /usr/local/bin/protoc" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters