ipblc/.drone.yml

130 lines
2.7 KiB
YAML

---
kind: pipeline
type: docker
name: default-amd64
platform:
os: linux
arch: amd64
steps:
- name: test and build
image: rust:1
commands:
- apt-get update -y
- apt-get install -y libnftnl-dev libmnl-dev
- cargo build --verbose --all
- cargo test --verbose --all
volumes:
- name: cargo
path: /usr/local/cargo/registry
- name: apt
path: /var/cache/apt
when:
event:
exclude:
- tag
- name: release
image: rust:1
commands:
- apt-get update -y
- apt-get install -y libnftnl-dev libmnl-dev
- cargo build --release --verbose --all
- cd target/release
- tar -czvf ipblc-${DRONE_TAG}-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}.tar.gz ipblc
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:
path: /home/drone/cache/cargo
- name: apt
host:
path: /home/drone/cache/apt
---
kind: pipeline
type: docker
name: default-arm64
platform:
os: linux
arch: arm64
steps:
- name: test and build
image: rust:1
commands:
- apt-get update -y
- apt-get install -y libnftnl-dev libmnl-dev
- cargo build --verbose --all
- cargo test --verbose --all
volumes:
- name: cargo
path: /usr/local/cargo/registry
- name: apt
path: /var/cache/apt
when:
event:
exclude:
- tag
- name: release
image: rust:1
commands:
- apt-get update -y
- apt-get install -y libnftnl-dev libmnl-dev
- cargo build --release --verbose --all
- cd target/release
- tar -czvf ipblc-${DRONE_TAG}-${DRONE_STAGE_OS}-${DRONE_STAGE_ARCH}.tar.gz ipblc
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:
path: /home/drone/cache/cargo
- name: apt
host:
path: /home/drone/cache/apt