-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
70 lines (61 loc) · 1.7 KB
/
.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# SPDX-FileCopyrightText: 2022 Robin Vobruba <hoijui.quaero@gmail.com>
# SPDX-FileCopyrightText: 2020 Armin Becher <becherarmin@gmail.com>
#
# SPDX-License-Identifier: Unlicense
image: "rust:latest"
variables:
RUST_BACKTRACE: "FULL"
stages:
- build
- release
build_osx:
image: joseluisq/rust-linux-darwin-builder:latest
stage: build
artifacts:
paths:
- apple-darwin.zip
script:
- apt-get update
- apt-get install zip -y
- cargo build --release --target x86_64-apple-darwin
- zip -r apple-darwin.zip /builds/hoijui/mle_ci/target/x86_64-apple-darwin/release/
build_linux:
stage: build
artifacts:
paths:
- target/release/mle
script:
- cargo build --verbose --release
test_latest:
stage: build
script:
- cargo test --all --verbose
test_nightly:
stage: build
image: rustlang/rust:nightly
script:
- cargo test --all --verbose
allow_failure: true
release_github_artifact:
stage: release
image: golang:latest
script:
- go get github.com/aktau/github-release
- github-release release --user hoijui --repo mle --tag $CI_COMMIT_TAG
- github-release upload --user hoijui --repo mle --tag $CI_COMMIT_TAG --name "mle-x86_64-linux" --file target/release/mle
- github-release upload --user hoijui --repo mle --tag $CI_COMMIT_TAG --name "mle-x86_64-apple-darwin" --file apple-darwin.zip
only:
- tags
release_docker:
stage: release
image: docker:stable
services:
- docker:dind
script:
- docker login -u $DOCKER_USERNAME -p $DOCKER_PASSWORD
- docker build -t hoijui/mle .
- version="${CI_COMMIT_TAG:1}"
- docker tag hoijui/mle hoijui/mle:$version
- docker push hoijui/mle
only:
- tags