CGGItemSets/.drone.yml

83 lines
2.6 KiB
YAML
Raw Normal View History

2020-06-28 15:50:19 +02:00
kind: pipeline
type: docker
2021-03-15 20:26:52 +01:00
name: windows
2020-06-28 15:50:19 +02:00
steps:
- name: build
2020-06-28 16:20:11 +02:00
image: rust:alpine
2020-06-28 15:50:19 +02:00
commands:
2021-03-15 20:14:28 +01:00
- apk add --no-cache mingw-w64-gcc musl-dev
2021-08-01 09:47:16 +02:00
- mkdir ~/.cargo
2020-06-28 16:20:11 +02:00
- echo -e '[target.x86_64-pc-windows-gnu]\nlinker = "x86_64-w64-mingw32-gcc"\nar = "x86_64-w64-mingw32-gcc-ar"' > ~/.cargo/config
- rustup target add x86_64-pc-windows-gnu
2021-03-14 17:34:25 +01:00
- rustup component add clippy
2021-03-15 23:04:28 +01:00
- cargo test
2021-03-15 20:14:28 +01:00
- cargo clippy --target x86_64-pc-windows-gnu
2020-06-28 16:20:11 +02:00
- cargo build --release --target x86_64-pc-windows-gnu
2021-03-14 17:43:15 +01:00
- strip target/x86_64-pc-windows-gnu/release/cggitem_sets.exe
2021-03-15 20:14:28 +01:00
- name: deploy
image: alpine:latest
commands:
- apk add --no-cache curl
2021-03-28 18:40:56 +02:00
- curl -u drone:$MVN_PWD -X POST 'https://nexus.nyyu.dev/service/rest/v1/components?repository=maven-releases' -F maven2.groupId=dev.nyyu -F maven2.artifactId=cggitem_sets -F maven2.version=$(awk -F ' = ' '$1 ~ /version/ { gsub(/["]/, "", $2); printf("%s",$2) }' Cargo.toml) -F maven2.asset1=@target/x86_64-pc-windows-gnu/release/cggitem_sets.exe -F maven2.asset1.extension=exe -F maven2.asset1.classifier=mingw-x64
2021-03-15 20:26:52 +01:00
environment:
MVN_PWD:
from_secret: maven_password
when:
branch:
- master
---
kind: pipeline
type: docker
name: linux
steps:
- name: build
image: rust:alpine
commands:
2021-03-15 20:30:40 +01:00
- apk add --no-cache musl-dev
2021-03-15 20:27:29 +01:00
- rustup component add clippy
2021-03-15 23:04:28 +01:00
- cargo test
2021-03-15 20:26:52 +01:00
- cargo clippy
- cargo build --release
- strip target/release/cggitem_sets
- name: deploy
image: alpine:latest
commands:
- apk add --no-cache curl
2021-03-28 18:49:39 +02:00
- curl -u drone:$MVN_PWD -X POST 'https://nexus.nyyu.dev/service/rest/v1/components?repository=maven-releases' -F maven2.groupId=dev.nyyu -F maven2.artifactId=cggitem_sets -F maven2.version=$(awk -F ' = ' '$1 ~ /version/ { gsub(/["]/, "", $2); printf("%s",$2) }' Cargo.toml) -F maven2.asset1=@target/release/cggitem_sets -F maven2.asset1.extension=elf -F maven2.asset1.classifier=linux-x64
2021-03-28 17:51:36 +02:00
environment:
MVN_PWD:
from_secret: maven_password
when:
branch:
- master
---
kind: pipeline
type: exec
name: windows-msvc
2021-03-28 17:52:42 +02:00
platform:
os: windows
arch: amd64
2021-03-28 17:51:36 +02:00
steps:
- name: build
commands:
- rustup update
- cargo test
- cargo clippy
- cargo build --release
2021-03-28 18:05:11 +02:00
environment:
CARGO_HOME: c:/drone/cargo
RUSTUP_HOME: c:/drone/rustup
2021-03-28 17:51:36 +02:00
- name: deploy
commands:
2021-03-28 19:07:24 +02:00
- curl.exe -u drone:$Env:MVN_PWD -X POST https://nexus.nyyu.dev/service/rest/v1/components?repository=maven-releases -F maven2.groupId=dev.nyyu -F maven2.artifactId=cggitem_sets -F maven2.version=1.0.0 -F maven2.asset1=@target/release/cggitem_sets.exe -F maven2.asset1.extension=exe -F maven2.asset1.classifier=msvc-x64
2020-06-29 13:26:50 +02:00
environment:
MVN_PWD:
from_secret: maven_password
2021-03-15 20:14:28 +01:00
when:
2021-08-01 09:47:16 +02:00
target:
- windows-msvc