Skip to content

Commit

Permalink
feat (ci): jobs use native compile (#2777)
Browse files Browse the repository at this point in the history
Signed-off-by: Henrik Gerdes <[email protected]>
  • Loading branch information
hegerdes authored Jan 19, 2025
1 parent 3f9bd81 commit 6aca0ac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 25 deletions.
18 changes: 5 additions & 13 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ on:
push:
branches: ["*"]

env:
# Cross-compilation for aarch64 requires a different linker
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc

permissions:
contents: read

Expand All @@ -27,9 +23,9 @@ jobs:
include:
- os: windows-2022
target: x86_64-pc-windows-msvc
- os: ubuntu-20.04
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
- os: ubuntu-20.04
- os: ubuntu-22.04-arm
target: aarch64-unknown-linux-gnu
- os: macos-13
target: x86_64-apple-darwin
Expand All @@ -44,13 +40,6 @@ jobs:
with:
toolchain: ${{ matrix.rustup_toolchain }}

- name: Install Rust crosscompile tools
if: ${{ contains(matrix.target, 'aarch64-unknown-linux-gnu') }}
run: |
sudo apt-get update -y
sudo apt-get install -y make g++ libssl-dev gcc-aarch64-linux-gnu
rustup target add aarch64-unknown-linux-gnu
- name: Cargo build (Native TLS)
run: |
cargo build --all --no-default-features --features=native-tls
Expand All @@ -64,3 +53,6 @@ jobs:

- name: Cargo fmt
run: cargo fmt --check

- name: Show version
run: ./zola --version
18 changes: 6 additions & 12 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ on:
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
# Cross-compilation for aarch64 requires a different linker
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER: aarch64-linux-gnu-gcc

permissions:
contents: read
Expand All @@ -32,9 +30,9 @@ jobs:
include:
- os: windows-2022
target: x86_64-pc-windows-msvc
- os: ubuntu-20.04
- os: ubuntu-22.04
target: x86_64-unknown-linux-gnu
- os: ubuntu-20.04
- os: ubuntu-22.04-arm
target: aarch64-unknown-linux-gnu
- os: macos-13
target: x86_64-apple-darwin
Expand All @@ -49,16 +47,12 @@ jobs:
with:
toolchain: ${{ matrix.rustup_toolchain }}

- name: Install Rust crosscompile tools
if: ${{ contains(matrix.target, 'aarch64-unknown-linux-gnu') }}
run: |
sudo apt-get update -y
sudo apt-get install -y make g++ libssl-dev gcc-aarch64-linux-gnu
rustup target add aarch64-unknown-linux-gnu
- name: Cargo build
run: cargo build --release --target ${{ matrix.target }}

- name: Show version
run: ./target/${{ matrix.target }}/release/zola --version

- name: Archive (UNIX)
run: |
mkdir -p artifacts
Expand All @@ -74,7 +68,7 @@ jobs:
if: ${{ startsWith(matrix.os, 'windows') }}

- name: Attest Build Provenance
uses: actions/attest-build-provenance@v1
uses: actions/attest-build-provenance@v2
continue-on-error: true
with:
subject-path: ${{ github.event.repository.name }}-${{ github.ref_name }}-${{ matrix.target }}.*
Expand Down

0 comments on commit 6aca0ac

Please sign in to comment.