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
stages:
- test
- build
- release
variables:
CARGO_HOME: $CI_PROJECT_DIR/.cargo
cache:
key: ${CI_COMMIT_REF_SLUG}
paths:
- .cargo/
- target/
# Quick tests on every push (but not master to avoid duplicates with MR)
test:
stage: test
image: rust:latest
rules:
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
- if: $CI_COMMIT_BRANCH && $CI_COMMIT_BRANCH != "master"
script:
- rustup component add clippy rustfmt
- cargo fmt -- --check
- cargo clippy -- -D warnings
# Create release with binaries ONLY on tag pushes
create-release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG =~ /^v/
before_script:
- apk add --no-cache curl
script:
# Create release
- |
release-cli create \
--name "${CI_COMMIT_TAG}" \
--description "# ByteArrayOps Library ${CI_COMMIT_TAG}
This release provides source assets to integrate this with your library via cargo please run `cargo add byte-array-ops`
## Changes
For detailed changes in this release, see the [Changelog](${CI_PROJECT_URL}/-/blob/master/CHANGELOG.md).
For more details, see the [README](${CI_PROJECT_URL}/-/blob/master/README.md)." \
--tag-name "${CI_COMMIT_TAG}" \