Fix release workflow: add git clone fallback for all build jobs
Some checks failed
CI / test (push) Has been cancelled
Build & Release / build-linux-x86_64 (push) Failing after 1m4s
Build & Release / build-linux-aarch64 (push) Failing after 1m12s
Build & Release / build-linux-armv7 (push) Failing after 58s
Build & Release / release (push) Has been skipped
Some checks failed
CI / test (push) Has been cancelled
Build & Release / build-linux-x86_64 (push) Failing after 1m4s
Build & Release / build-linux-aarch64 (push) Failing after 1m12s
Build & Release / build-linux-armv7 (push) Failing after 58s
Build & Release / release (push) Has been skipped
Same fix as CI — workspace may be empty when using container jobs. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -11,11 +11,19 @@ jobs:
|
||||
container:
|
||||
image: rust:1.86-slim
|
||||
steps:
|
||||
- name: Install musl toolchain
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
apt-get update && apt-get install -y --no-install-recommends musl-tools
|
||||
apt-get update && apt-get install -y --no-install-recommends git musl-tools
|
||||
rustup target add x86_64-unknown-linux-musl
|
||||
|
||||
- name: Ensure code is present
|
||||
run: |
|
||||
git config --global --add safe.directory '*'
|
||||
if [ ! -f "Cargo.toml" ]; then
|
||||
git clone --depth 1 --branch ${GITHUB_REF_NAME} ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git /tmp/src
|
||||
cp -a /tmp/src/. .
|
||||
fi
|
||||
|
||||
- name: Build
|
||||
run: cargo build --release --target x86_64-unknown-linux-musl
|
||||
|
||||
@@ -37,10 +45,21 @@ jobs:
|
||||
container:
|
||||
image: rust:1.86-slim
|
||||
steps:
|
||||
- name: Install cross toolchain
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
apt-get update && apt-get install -y --no-install-recommends gcc-aarch64-linux-gnu
|
||||
apt-get update && apt-get install -y --no-install-recommends git gcc-aarch64-linux-gnu
|
||||
rustup target add aarch64-unknown-linux-musl
|
||||
|
||||
- name: Ensure code is present
|
||||
run: |
|
||||
git config --global --add safe.directory '*'
|
||||
if [ ! -f "Cargo.toml" ]; then
|
||||
git clone --depth 1 --branch ${GITHUB_REF_NAME} ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git /tmp/src
|
||||
cp -a /tmp/src/. .
|
||||
fi
|
||||
|
||||
- name: Configure cross-linker
|
||||
run: |
|
||||
mkdir -p .cargo
|
||||
cat > .cargo/config.toml << 'TOML'
|
||||
[target.aarch64-unknown-linux-musl]
|
||||
@@ -69,10 +88,21 @@ jobs:
|
||||
container:
|
||||
image: rust:1.86-slim
|
||||
steps:
|
||||
- name: Install cross toolchain
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
apt-get update && apt-get install -y --no-install-recommends gcc-arm-linux-gnueabihf
|
||||
apt-get update && apt-get install -y --no-install-recommends git gcc-arm-linux-gnueabihf
|
||||
rustup target add armv7-unknown-linux-musleabihf
|
||||
|
||||
- name: Ensure code is present
|
||||
run: |
|
||||
git config --global --add safe.directory '*'
|
||||
if [ ! -f "Cargo.toml" ]; then
|
||||
git clone --depth 1 --branch ${GITHUB_REF_NAME} ${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}.git /tmp/src
|
||||
cp -a /tmp/src/. .
|
||||
fi
|
||||
|
||||
- name: Configure cross-linker
|
||||
run: |
|
||||
mkdir -p .cargo
|
||||
cat > .cargo/config.toml << 'TOML'
|
||||
[target.armv7-unknown-linux-musleabihf]
|
||||
|
||||
Reference in New Issue
Block a user