This commit is contained in:
parent
da8793f3f5
commit
6c3719222c
1 changed files with 47 additions and 3 deletions
50
.drone.yml
50
.drone.yml
|
@ -7,18 +7,36 @@ platform:
|
||||||
arch: amd64
|
arch: amd64
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
|
- 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
|
||||||
|
|
||||||
- name: lint
|
- name: lint
|
||||||
image: rust:latest
|
image: rust:latest
|
||||||
commands:
|
commands:
|
||||||
- rustup component add rustfmt clippy
|
- rustup component add rustfmt clippy
|
||||||
- cargo fmt --check
|
- cargo fmt --check
|
||||||
- cargo clippy
|
- cargo clippy
|
||||||
|
depends_on:
|
||||||
|
- restore-cache-with-filesystem
|
||||||
|
|
||||||
- name: build-x86_64-unknown-linux-gnu
|
- name: build-x86_64-unknown-linux-gnu
|
||||||
image: rust:latest
|
image: rust:latest
|
||||||
commands:
|
commands:
|
||||||
- cargo build --release
|
- cargo build --release
|
||||||
- strip target/release/empede
|
- strip target/release/empede
|
||||||
|
depends_on:
|
||||||
|
- restore-cache-with-filesystem
|
||||||
|
|
||||||
- name: build-aarch64-unknown-linux-gnu
|
- name: build-aarch64-unknown-linux-gnu
|
||||||
image: rust:latest
|
image: rust:latest
|
||||||
|
@ -30,6 +48,8 @@ steps:
|
||||||
- aarch64-linux-gnu-strip target/aarch64-unknown-linux-gnu/release/empede
|
- aarch64-linux-gnu-strip target/aarch64-unknown-linux-gnu/release/empede
|
||||||
when:
|
when:
|
||||||
event: tag
|
event: tag
|
||||||
|
depends_on:
|
||||||
|
- restore-cache-with-filesystem
|
||||||
|
|
||||||
- name: build-x86_64-pc-windows-gnu
|
- name: build-x86_64-pc-windows-gnu
|
||||||
image: rust:latest
|
image: rust:latest
|
||||||
|
@ -40,6 +60,8 @@ steps:
|
||||||
- x86_64-w64-mingw32-strip target/x86_64-pc-windows-gnu/release/empede.exe
|
- x86_64-w64-mingw32-strip target/x86_64-pc-windows-gnu/release/empede.exe
|
||||||
when:
|
when:
|
||||||
event: tag
|
event: tag
|
||||||
|
depends_on:
|
||||||
|
- restore-cache-with-filesystem
|
||||||
|
|
||||||
- name: package
|
- name: package
|
||||||
image: alpine
|
image: alpine
|
||||||
|
@ -49,13 +71,13 @@ steps:
|
||||||
# x86_64-unknown-linux-gnu
|
# x86_64-unknown-linux-gnu
|
||||||
- mkdir empede-x86_64-unknown-linux-gnu-${DRONE_TAG}
|
- 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}/
|
- cp -r target/release/empede static/ README.md empede-x86_64-unknown-linux-gnu-${DRONE_TAG}/
|
||||||
- tar czf empede-x86_64-unknown-linux-gnu-${DRONE_TAG}.tar.gz empede-x86_64-unknown-linux-gnu-${DRONE_TAG}/
|
- tar czf empede-x86_64-unknown-linux-gnu-${DRONE_TAG}.tar.gz empede-x86_64-unknown-linux-gnu-${DRONE_TAG}/
|
||||||
|
|
||||||
# aarch64-unknown-linux-gnu
|
# aarch64-unknown-linux-gnu
|
||||||
- mkdir empede-aarch64-unknown-linux-gnu-${DRONE_TAG}
|
- 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}/
|
- cp -r target/aarch64-unknown-linux-gnu/release/empede static/ README.md empede-aarch64-unknown-linux-gnu-${DRONE_TAG}/
|
||||||
- tar czf empede-aarch64-unknown-linux-gnu-${DRONE_TAG}.tar.gz empede-aarch64-unknown-linux-gnu-${DRONE_TAG}/
|
- tar czf empede-aarch64-unknown-linux-gnu-${DRONE_TAG}.tar.gz empede-aarch64-unknown-linux-gnu-${DRONE_TAG}/
|
||||||
|
|
||||||
# x86_64-pc-windows-gnu
|
# x86_64-pc-windows-gnu
|
||||||
- mkdir empede-x86_64-pc-windows-gnu-${DRONE_TAG}
|
- 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}/
|
- cp -r target/x86_64-pc-windows-gnu/release/empede.exe static/ README.md empede-x86_64-pc-windows-gnu-${DRONE_TAG}/
|
||||||
|
@ -82,4 +104,26 @@ steps:
|
||||||
when:
|
when:
|
||||||
event: tag
|
event: tag
|
||||||
|
|
||||||
|
- 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
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
- name: cache
|
||||||
|
host:
|
||||||
|
path: /var/lib/cache
|
Loading…
Reference in a new issue