2023-01-20 15:43:17 +00:00
|
|
|
stages:
|
|
|
|
- build
|
|
|
|
|
|
|
|
variables:
|
2023-01-25 15:33:34 +00:00
|
|
|
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/installer"
|
2023-01-20 15:43:17 +00:00
|
|
|
|
2023-01-25 12:25:12 +00:00
|
|
|
build:
|
2023-01-20 15:43:17 +00:00
|
|
|
stage: build
|
|
|
|
image: rust:alpine
|
2023-01-20 15:56:42 +00:00
|
|
|
rules:
|
|
|
|
- if: $CI_COMMIT_BRANCH == "installer"
|
2023-01-20 15:43:17 +00:00
|
|
|
script:
|
2023-01-25 15:14:13 +00:00
|
|
|
- export CARGO_HOME="${PWD}/.cargo"
|
2023-01-25 15:33:34 +00:00
|
|
|
- apk add pkgconf musl-dev curl
|
2023-01-25 12:25:12 +00:00
|
|
|
- RUSTFLAGS='-C target-feature=+crt-static -C link-self-contained=yes -C link-arg=-s' cargo build --release --target x86_64-unknown-linux-musl
|
|
|
|
- cp target/x86_64-unknown-linux-musl/release/dotfiles_installer ./installer-amd64
|
2023-01-25 15:33:34 +00:00
|
|
|
- 'curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file installer-amd64 "${PACKAGE_REGISTRY_URL}/dev-$CI_COMMIT_SHORT_SHA/installer-amd64"'
|
2023-01-20 15:43:17 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2023-01-25 12:25:12 +00:00
|
|
|
- installer-amd64
|
2023-01-25 15:14:13 +00:00
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- .cargo/
|