Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 30 additions & 10 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ jobs:
deploy:
needs: test
if: ${{ github.event_name == 'release' }}
runs-on: ubuntu-20.04
runs-on: ubuntu-latest
strategy:
matrix:
target: [i686-unknown-linux-gnu, x86_64-unknown-linux-gnu]
Expand All @@ -55,18 +55,38 @@ jobs:
- name: "Set up Cloud SDK"
uses: google-github-actions/setup-gcloud@v2.1.1

- name: Install dependencies
run: |
sudo dpkg --add-architecture i386
sudo apt update
sudo apt install -y gcc-multilib libssl-dev:i386 # required to build for 32-bit arch
- name: Cache cargo registry and build artifacts
uses: actions/cache@v4
with:
path: |
~/.cargo-container/registry
~/.cargo-container/git
target
key: ${{ runner.os }}-release-cargo-${{ matrix.target }}-${{ hashFiles('Cargo.lock') }}
restore-keys: |
${{ runner.os }}-release-cargo-${{ matrix.target }}-

# Build inside the official Rust image on Debian bullseye (glibc 2.31, the same floor
# as Ubuntu 20.04) so the binaries run on older systems and the toolchain ships in the
# image instead of being downloaded on every run. gcc-multilib provides the 32-bit
# toolchain for the i686 target; reqwest uses rustls-tls, so no OpenSSL is needed. The
# image tag pins the toolchain to the MSRV. Cargo caches are mounted in and ownership
# normalised afterwards so the cache and gsutil can read the root-owned tree.
- name: Cargo build
run: |
export I686_UNKNOWN_LINUX_GNU_OPENSSL_LIB_DIR=/usr/lib/i386-linux-gnu # required to build for 32-bit arch
export I686_UNKNOWN_LINUX_GNU_OPENSSL_INCLUDE_DIR=/usr/include/i386-linux-gnu # required to build for 32-bit arch
rustup target add ${{ matrix.target }}
cargo build -p tmc --release --verbose --target ${{ matrix.target }}
mkdir -p "$HOME/.cargo-container/registry" "$HOME/.cargo-container/git"
docker run --rm \
-v "$PWD":/w -w /w \
-v "$HOME/.cargo-container/registry":/usr/local/cargo/registry \
-v "$HOME/.cargo-container/git":/usr/local/cargo/git \
rust:1.88.0-bullseye bash -euo pipefail -c '
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y gcc-multilib
rustup target add ${{ matrix.target }}
cargo build -p tmc --release --verbose --target ${{ matrix.target }}
'
sudo chown -R "$(id -u):$(id -g)" target "$HOME/.cargo-container"

- name: Get the version
id: get_version
Expand Down
Loading
Loading