Skip to content

Commit

Permalink
Clean up woodpecker config
Browse files Browse the repository at this point in the history
  • Loading branch information
windsource committed Jul 14, 2024
1 parent 937f7a9 commit 4cbb204
Showing 1 changed file with 31 additions and 21 deletions.
52 changes: 31 additions & 21 deletions .woodpecker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,37 +14,47 @@ clone:
branch: main

steps:
build-x86:
- name: build-x86
image: *rust
commands:
- export CARGO_HOME=$(pwd)/.cargo/
- cargo test
- cargo build --release
- mkdir -p target/linux/amd64
- cp target/release/picus target/linux/amd64/picus
commands: |
if [ "$CI_SYSTEM_PLATFORM" = "linux/amd64" ]; then
export CARGO_HOME=$(pwd)/.cargo/
cargo test
cargo build --release
mkdir -p target/linux/amd64
cp target/release/picus target/linux/amd64/picus
else
echo Unsupported platform!
exit1
fi
when:
- event: pull_request
- event: [push, tag, manual]
branch: main

build-arm64:
- name: build-arm64
image: *rust
commands:
- dpkg --add-architecture arm64
- apt-get update
- export DEBIAN_FRONTED=noninteractive
- apt-get -y install --no-install-recommends gcc-aarch64-linux-gnu libssl-dev:arm64 libc6-dev:arm64
- rustup target add aarch64-unknown-linux-gnu
- export CARGO_HOME=$(pwd)/.cargo/
- RUSTFLAGS="-C linker=aarch64-linux-gnu-gcc" PKG_CONFIG_SYSROOT_DIR=/ cargo build --target aarch64-unknown-linux-gnu --release
- mkdir -p target/linux/arm64
- cp target/aarch64-unknown-linux-gnu/release/picus target/linux/arm64/
commands: |
if [ "$CI_SYSTEM_PLATFORM" = "linux/amd64" ]; then
dpkg --add-architecture arm64
apt-get update
export DEBIAN_FRONTED=noninteractive
apt-get -y install --no-install-recommends gcc-aarch64-linux-gnu libssl-dev:arm64 libc6-dev:arm64
rustup target add aarch64-unknown-linux-gnu
export CARGO_HOME=$(pwd)/.cargo/
RUSTFLAGS="-C linker=aarch64-linux-gnu-gcc" PKG_CONFIG_SYSROOT_DIR=/ cargo build --target aarch64-unknown-linux-gnu --release
mkdir -p target/linux/arm64
cp target/aarch64-unknown-linux-gnu/release/picus target/linux/arm64/
else
echo Unsupported platform!
exit1
fi
when:
- event: pull_request
- event: [push, tag, manual]
branch: main

check-licenses:
- name: check-licenses
image: *rust
commands:
- export CARGO_HOME=$(pwd)/.cargo/
Expand All @@ -55,7 +65,7 @@ steps:
- event: [push, tag, manual]
branch: main

publish-distroless:
- name: publish-distroless
image: *buildx_plugin
settings:
platforms: linux/amd64,linux/arm64
Expand All @@ -79,7 +89,7 @@ steps:
event: [push, tag, manual]
branch: main

publish-debian:
- name: publish-debian
image: *buildx_plugin
settings:
platforms: linux/amd64,linux/arm64
Expand Down

0 comments on commit 4cbb204

Please sign in to comment.