diff --git a/.drone.yml b/.drone.yml index 086e2dd..aa697c5 100644 --- a/.drone.yml +++ b/.drone.yml @@ -8,15 +8,14 @@ platform: arch: amd64 steps: - - &build-test - name: build and test + - name: build and test image: rust:1 pull: always commands: - apt-get update -y - - apt-get install -y libnftnl-dev libmnl-dev libclang-dev - - curl -o ${RUSTC_WRAPPER} https://assets.paulbsd.com/sccache_linux_${DRONE_STAGE_ARCH} - - chmod +x ${RUSTC_WRAPPER} + - apt-get install -y libnftnl-dev libmnl-dev + - curl -o /usr/bin/sccache https://assets.paulbsd.com/sccache_linux_amd64 + - chmod +x /usr/bin/sccache - cargo build --verbose --all - cargo test --verbose --all environment: @@ -32,15 +31,14 @@ steps: event: exclude: - tag - - &release - name: release + - name: release image: rust:1 pull: always commands: - apt-get update -y - - apt-get install -y libnftnl-dev libmnl-dev libclang-dev - - curl -o ${RUSTC_WRAPPER} https://assets.paulbsd.com/sccache_linux_${DRONE_STAGE_ARCH} - - chmod +x ${RUSTC_WRAPPER} + - apt-get install -y libnftnl-dev libmnl-dev + - curl -o /usr/bin/sccache https://assets.paulbsd.com/sccache_linux_amd64 + - chmod +x /usr/bin/sccache - cargo build --release --verbose --all - cd target/release - tar -czvf ipblc-${DRONE_TAG}-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}.tar.gz ipblc @@ -56,8 +54,7 @@ steps: when: event: - tag - - &publish - name: publish + - name: publish image: plugins/gitea-release settings: base_url: https://git.paulbsd.com @@ -90,9 +87,67 @@ platform: arch: arm64 steps: - - *build_test - - *release - - *publish + - name: build and test + image: rust:1 + pull: always + commands: + - apt-get update -y + - apt-get install -y libnftnl-dev libmnl-dev + - curl -o /usr/bin/sccache https://assets.paulbsd.com/sccache_linux_arm64 + - chmod +x /usr/bin/sccache + - cargo build --verbose --all + - cargo test --verbose --all + environment: + RUSTC_WRAPPER: /usr/bin/sccache + SCCACHE_WEBDAV_ENDPOINT: https://sccache.paulbsd.com + SCCACHE_WEBDAV_KEY_PREFIX: sccache + volumes: + - name: cargo + path: /usr/local/cargo/registry + - name: apt + path: /var/cache/apt + when: + event: + exclude: + - tag + - name: release + image: rust:1 + pull: always + commands: + - apt-get update -y + - apt-get install -y libnftnl-dev libmnl-dev + - curl -o /usr/bin/sccache https://assets.paulbsd.com/sccache_linux_arm64 + - chmod +x /usr/bin/sccache + - cargo build --release --verbose --all + - cd target/release + - tar -czvf ipblc-${DRONE_TAG}-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}.tar.gz ipblc + environment: + RUSTC_WRAPPER: /usr/bin/sccache + SCCACHE_WEBDAV_ENDPOINT: https://sccache.paulbsd.com + SCCACHE_WEBDAV_KEY_PREFIX: sccache + volumes: + - name: cargo + path: /usr/local/cargo/registry + - name: apt + path: /var/cache/apt + when: + event: + - tag + - name: publish + image: plugins/gitea-release + settings: + base_url: https://git.paulbsd.com + api_key: + from_secret: gitea_token + files: "target/release/*.tar.gz" + #checksum: + # - sha256 + # - sha512 + environment: + PLUGIN_TITLE: "" + when: + event: + - tag volumes: - name: cargo host: