-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
37 lines (33 loc) · 918 Bytes
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
variables:
PACKAGE_NAME: qad
CARGO_HOME: "$CI_PROJECT_DIR/.cargo"
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/${PACKAGE_NAME}/${CI_COMMIT_TAG}/${PACKAGE_NAME}"
include:
- local: '/cicd/test.gitlab-ci.yml'
- local: '/cicd/release.gitlab-ci.yml'
stages:
- test
- release
cache: &global_cache
key: one-key-to-rule-them-all
paths:
- .cargo/
- target/
policy: pull
build:
image: rust:latest
stage: release
script:
- cargo install cargo-deb cargo-generate-rpm cargo-bump
- cargo build --release $(if [ "$FEATURES" != NONE ]; then echo --features "$FEATURES"; fi)
- test "$CI_COMMIT_TAG" == "$(target/release/${PACKAGE_NAME} --version)"
- mkdir bin
- cp target/release/${PACKAGE_NAME} bin/${PACKAGE_NAME}
artifacts:
paths:
- bin
rules:
- if: $CI_COMMIT_TAG
cache:
<<: *global_cache
policy: pull-push