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