Skip to content
Snippets Groups Projects
Commit 9365b805 authored by poka's avatar poka
Browse files

build debian package in CI

parent bfb85c07
No related branches found
No related tags found
No related merge requests found
Pipeline #37064 passed
......@@ -4,28 +4,32 @@
image: "rust:latest"
stages:
- build
- build_and_package
- release
build:
stage: build
# image used for this build
image: rust
# build script
build_and_package:
stage: build_and_package
image: rust:slim-buster
script:
# Build the project
- cargo build --release
# output file
# Install cargo-deb
- cargo install cargo-deb
# Create Debian package
- cargo deb --no-build
- ls target/debian/*.deb | head -n 1 > debian_package.txt
artifacts:
paths:
- target/release/gcli
# use cache to avoid re-downloading and re-building all dependencies
- target/debian/*.deb
- debian_package.txt
cache:
key:
files:
- Cargo.lock
paths:
- target/release
# only build gcli when adding a tag
- target/debian
only:
- tags
......@@ -48,11 +52,16 @@ release:
# Attach the artifact to the release
assets:
links:
- name: "gcli v$CI_COMMIT_TAG for Linux"
url: "$CI_PROJECT_URL/-/jobs/artifacts/$CI_COMMIT_TAG/raw/target/release/gcli?job=build"
- name: "gcli v$CI_COMMIT_TAG for Linux (binary)"
url: "$CI_PROJECT_URL/-/jobs/artifacts/$CI_COMMIT_TAG/raw/target/release/gcli?job=build_and_package"
- name: "gcli v$CI_COMMIT_TAG Debian Package"
url: "$CI_PROJECT_URL/-/jobs/artifacts/$CI_COMMIT_TAG/raw/$(cat debian_package.txt)?job=build_and_package"
# Trigger release creation only for tagged commits
only:
- tags
# Not necessary but clearly shows the dependency
dependencies:
- build
- build_and_package
artifacts:
paths:
- debian_package.txt
......@@ -2092,7 +2092,7 @@ dependencies = [
[[package]]
name = "gcli"
version = "0.2.10"
version = "0.2.11"
dependencies = [
"age",
"anyhow",
......
......@@ -9,7 +9,7 @@ rust-version = "1.75.0"
license = "AGPL-3.0-only"
name = "gcli"
repository = "https://git.duniter.org/clients/rust/gcli-v2s"
version = "0.2.10"
version = "0.2.11"
[dependencies]
# subxt is main dependency
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment