Skip to content

Commit

Permalink
ci: ensure cross uses version-mode variable
Browse files Browse the repository at this point in the history
The ARM builds are done using a tool called `cross`, which uses Docker containers, and therefore the
compile-time variables need to be passed to the containers. This is done using the
`CROSS_CONTAINER_OPTS` variable.

I tested this locally to confirm the desired effect.
  • Loading branch information
jacderida authored and bochaco committed Apr 5, 2024
1 parent 65924b8 commit 3233f69
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ jobs:
- name: build release artifacts
shell: bash
run: |
# make sure the version env variable is set
export NETWORK_VERSION_MODE=${{ env.NETWORK_VERSION_MODE }}
echo "NETWORK_VERSION_MODE=$NETWORK_VERSION_MODE"
just build-release-artifacts "${{ matrix.target }}"
- uses: actions/upload-artifact@main
Expand Down
6 changes: 6 additions & 0 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,12 @@ build-release-artifacts arch:
rm -rf artifacts
mkdir artifacts
cargo clean

if [[ -n "${NETWORK_VERSION_MODE+x}"]]; then
echo "The NETWORK_VERSION_MODE variable is set to $NETWORK_VERSION_MODE"
export CROSS_CONTAINER_OPTS="--env NETWORK_VERSION_MODE=$NETWORK_VERSION_MODE"
fi

if [[ $arch == arm* || $arch == armv7* || $arch == aarch64* ]]; then
cargo install cross
cross build --release --features="network-contacts,distribution" --target $arch --bin safe
Expand Down

0 comments on commit 3233f69

Please sign in to comment.