From 5bdd4e21b0e9d767045bc24d9875786a7fba2478 Mon Sep 17 00:00:00 2001 From: Chewing_Bever Date: Sat, 12 Aug 2023 14:09:22 +0200 Subject: [PATCH] chore(ci): modernize config --- .woodpecker/arch-release.yml | 14 +++++++------- .woodpecker/build.yml | 15 ++++++++------- .woodpecker/clippy.yml | 15 ++++++++------- .woodpecker/lint.yml | 15 ++++++++------- .woodpecker/release.yml | 15 +++++++-------- 5 files changed, 38 insertions(+), 36 deletions(-) diff --git a/.woodpecker/arch-release.yml b/.woodpecker/arch-release.yml index ece2c52..1bd073f 100644 --- a/.woodpecker/arch-release.yml +++ b/.woodpecker/arch-release.yml @@ -3,11 +3,15 @@ matrix: - 'linux/amd64' # - linux/arm64 -platform: ${PLATFORM} -branches: [ main ] +labels: + platform: ${PLATFORM} + +when: + event: tag + skip_clone: true -pipeline: +steps: build: image: 'menci/archlinuxarm:base-devel' pull: true @@ -23,8 +27,6 @@ pipeline: - su builder - curl -OL "https://git.rustybever.be/Chewing_Bever/alex/raw/tag/$CI_COMMIT_TAG/PKGBUILD" - makepkg -s --noconfirm --needed - when: - event: tag publish: image: 'curlimages/curl' @@ -33,5 +35,3 @@ pipeline: - 'for pkg in $(ls -1 *.pkg*); do curl -XPOST -T "$pkg" -H "X-API-KEY: $VIETER_API_KEY" https://arch.r8r.be/bur/publish; done' secrets: - vieter_api_key - when: - event: tag diff --git a/.woodpecker/build.yml b/.woodpecker/build.yml index a1722be..768e2c8 100644 --- a/.woodpecker/build.yml +++ b/.woodpecker/build.yml @@ -3,19 +3,20 @@ matrix: - 'amd64' - 'arm64' -platform: "linux/${ARCH}" +labels: + platform: "linux/${ARCH}" -branches: - exclude: [main] +when: + branch: + exclude: [main] + event: push -pipeline: +steps: build: - image: 'rust:1.70-alpine3.18' + image: 'rust:1.71-alpine3.18' commands: - apk add --no-cache build-base - cargo build --verbose - cargo test --verbose # Binaries, even debug ones, should be statically compiled - '[ "$(readelf -d target/debug/alex | grep NEEDED | wc -l)" = 0 ]' - when: - event: [push] diff --git a/.woodpecker/clippy.yml b/.woodpecker/clippy.yml index 61b150d..5f23363 100644 --- a/.woodpecker/clippy.yml +++ b/.woodpecker/clippy.yml @@ -1,13 +1,14 @@ -platform: 'linux/amd64' +labels: + platform: 'linux/amd64' -branches: - exclude: [main] +when: + branch: + exclude: [ main ] + event: push -pipeline: +steps: clippy: - image: 'rust:1.70' + image: 'rust:1.71' commands: - rustup component add clippy - cargo clippy -- --no-deps -Dwarnings - when: - event: [push] diff --git a/.woodpecker/lint.yml b/.woodpecker/lint.yml index b74d26d..15e45dc 100644 --- a/.woodpecker/lint.yml +++ b/.woodpecker/lint.yml @@ -1,13 +1,14 @@ -platform: 'linux/amd64' +labels: + platform: 'linux/amd64' -branches: - exclude: [main] +when: + branch: + exclude: [ main ] + event: push -pipeline: +steps: lint: - image: 'rust:1.70' + image: 'rust:1.71' commands: - rustup component add rustfmt - cargo fmt -- --check - when: - event: [push] diff --git a/.woodpecker/release.yml b/.woodpecker/release.yml index f7d44db..892dced 100644 --- a/.woodpecker/release.yml +++ b/.woodpecker/release.yml @@ -3,20 +3,21 @@ matrix: - 'linux/amd64' - 'linux/arm64' -platform: ${PLATFORM} -branches: [ main ] +labels: + platform: ${PLATFORM} -pipeline: +when: + event: tag + +steps: build: - image: 'rust:1.70-alpine3.18' + image: 'rust:1.71-alpine3.18' commands: - apk add --no-cache build-base - cargo build --release --verbose # Ensure the release binary is also statically compiled - '[ "$(readelf -d target/release/alex | grep NEEDED | wc -l)" = 0 ]' - du -h target/release/alex - when: - event: tag publish: image: 'curlimages/curl' @@ -28,5 +29,3 @@ pipeline: --user "Chewing_Bever:$GITEA_PASSWORD" --upload-file target/release/alex https://git.rustybever.be/api/packages/Chewing_Bever/generic/alex/"${CI_COMMIT_TAG}"/alex-"$(echo '${PLATFORM}' | sed 's:/:-:g')" - when: - event: tag