empede/.drone.yml

129 lines
3.8 KiB
YAML
Raw Normal View History

kind: pipeline
type: docker
name: default
platform:
os: linux
2023-04-28 13:26:45 +00:00
arch: amd64
steps:
2023-05-02 22:31:10 +00:00
- name: restore-cache-with-filesystem
image: meltwater/drone-cache
pull: true
settings:
backend: "filesystem"
restore: true
cache_key: "volume"
mount:
- target
- /usr/local/cargo/env
volumes:
- name: cache
path: /tmp/cache
2023-05-02 22:23:35 +00:00
- name: lint
image: rust:latest
commands:
- rustup component add rustfmt clippy
- cargo fmt --check
- cargo clippy
2023-05-02 22:31:10 +00:00
depends_on:
- restore-cache-with-filesystem
2023-05-02 22:23:35 +00:00
2023-04-28 13:55:34 +00:00
- name: build-x86_64-unknown-linux-gnu
image: rust:latest
2023-04-28 10:02:40 +00:00
commands:
2023-04-28 13:31:58 +00:00
- cargo build --release
2023-04-28 10:02:40 +00:00
- strip target/release/empede
2023-05-02 22:31:10 +00:00
depends_on:
- restore-cache-with-filesystem
2023-04-28 10:02:40 +00:00
2023-04-28 13:55:34 +00:00
- name: build-aarch64-unknown-linux-gnu
2023-04-28 10:02:40 +00:00
image: rust:latest
commands:
- apt-get update
2023-04-28 13:55:34 +00:00
- apt-get install -y gcc-aarch64-linux-gnu binutils-aarch64-linux-gnu
- rustup target add aarch64-unknown-linux-gnu
- cargo build --target=aarch64-unknown-linux-gnu --release --config target.aarch64-unknown-linux-gnu.linker=\"aarch64-linux-gnu-gcc\"
- aarch64-linux-gnu-strip target/aarch64-unknown-linux-gnu/release/empede
2023-04-27 23:19:28 +00:00
when:
event: tag
2023-05-02 22:31:10 +00:00
depends_on:
- restore-cache-with-filesystem
2023-04-28 10:02:40 +00:00
- name: build-x86_64-pc-windows-gnu
2023-04-27 23:11:21 +00:00
image: rust:latest
commands:
2023-04-28 10:02:40 +00:00
- apt-get update && apt-get install -y mingw-w64
- rustup target add x86_64-pc-windows-gnu
2023-04-28 13:31:58 +00:00
- cargo build --target=x86_64-pc-windows-gnu --release --config target.x86_64-pc-windows-gnu.linker=\"x86_64-w64-mingw32-gcc\"
2023-04-28 10:02:40 +00:00
- x86_64-w64-mingw32-strip target/x86_64-pc-windows-gnu/release/empede.exe
when:
event: tag
2023-05-02 22:31:10 +00:00
depends_on:
- restore-cache-with-filesystem
2023-04-27 23:11:21 +00:00
- name: package
image: alpine
commands:
2023-04-28 10:02:40 +00:00
- apk add --no-cache tar gzip zip
2023-04-27 23:11:21 +00:00
2023-04-28 10:02:40 +00:00
# x86_64-unknown-linux-gnu
2023-05-02 09:40:50 +00:00
- mkdir empede-x86_64-unknown-linux-gnu-${DRONE_TAG}
- cp -r target/release/empede static/ README.md empede-x86_64-unknown-linux-gnu-${DRONE_TAG}/
2023-05-02 22:31:10 +00:00
- tar czf empede-x86_64-unknown-linux-gnu-${DRONE_TAG}.tar.gz empede-x86_64-unknown-linux-gnu-${DRONE_TAG}/
2023-04-27 23:11:21 +00:00
2023-04-28 10:02:40 +00:00
# aarch64-unknown-linux-gnu
2023-05-02 09:40:50 +00:00
- mkdir empede-aarch64-unknown-linux-gnu-${DRONE_TAG}
- cp -r target/aarch64-unknown-linux-gnu/release/empede static/ README.md empede-aarch64-unknown-linux-gnu-${DRONE_TAG}/
2023-05-02 22:31:10 +00:00
- tar czf empede-aarch64-unknown-linux-gnu-${DRONE_TAG}.tar.gz empede-aarch64-unknown-linux-gnu-${DRONE_TAG}/
2023-04-28 10:02:40 +00:00
# x86_64-pc-windows-gnu
2023-05-02 09:40:50 +00:00
- mkdir empede-x86_64-pc-windows-gnu-${DRONE_TAG}
- cp -r target/x86_64-pc-windows-gnu/release/empede.exe static/ README.md empede-x86_64-pc-windows-gnu-${DRONE_TAG}/
- zip -r empede-x86_64-pc-windows-gnu-${DRONE_TAG}.zip empede-x86_64-pc-windows-gnu-${DRONE_TAG}/
2023-04-27 23:19:28 +00:00
depends_on:
- build-aarch64-unknown-linux-gnu
2023-04-28 10:02:40 +00:00
- build-x86_64-unknown-linux-gnu
- build-x86_64-pc-windows-gnu
when:
event: tag
- name: gitea_release
image: plugins/gitea-release
settings:
api_key:
from_secret: GITEA_TOKEN
base_url: https://git.sijman.nl
files:
2023-05-02 09:40:50 +00:00
- empede-aarch64-unknown-linux-gnu-${DRONE_TAG}.tar.gz
- empede-x86_64-unknown-linux-gnu-${DRONE_TAG}.tar.gz
- empede-x86_64-pc-windows-gnu-${DRONE_TAG}.zip
2023-04-27 23:19:28 +00:00
depends_on:
- package
when:
event: tag
2023-04-27 23:11:21 +00:00
2023-05-02 22:31:10 +00:00
- name: rebuild-cache-with-filesystem
image: meltwater/drone-cache
pull: true
settings:
backend: "filesystem"
rebuild: true
cache_key: "volume"
mount:
- target
- /usr/local/cargo/env
volumes:
- name: cache
path: /tmp/cache
depends_on:
- build-aarch64-unknown-linux-gnu
- build-x86_64-unknown-linux-gnu
- build-x86_64-pc-windows-gnu
- lint
2023-04-27 23:11:21 +00:00
2023-05-02 22:31:10 +00:00
volumes:
- name: cache
host:
path: /var/lib/cache