Compare commits
9 commits
Author | SHA1 | Date | |
---|---|---|---|
|
adaafaab8b | ||
|
b4a62f2f37 | ||
d0ea91abf4 | |||
9fa49ef435 | |||
7088893a88 | |||
f6c953c62f | |||
3aeba46830 | |||
fa9276855e | |||
7cb50a53b2 |
1 changed files with 39 additions and 22 deletions
|
@ -8,34 +8,57 @@ stages:
|
||||||
- upload
|
- upload
|
||||||
- release
|
- release
|
||||||
|
|
||||||
# Stage "build"
|
.setup_script: &setup_scripts
|
||||||
build:
|
|
||||||
stage: build
|
|
||||||
rules:
|
|
||||||
- if: $VERSION
|
|
||||||
script:
|
|
||||||
- apt-get -y install rustup libdbus-glib-1-dev
|
- apt-get -y install rustup libdbus-glib-1-dev
|
||||||
- rustup default stable
|
- rustup default stable
|
||||||
- cargo install cargo-deb
|
- cargo install cargo-deb
|
||||||
- mkdir ./build;cargo deb --output ./build
|
|
||||||
|
|
||||||
# The files which are to be made available in GitLab
|
# Stage "build"
|
||||||
|
.compile: &compile
|
||||||
|
stage: compile
|
||||||
|
rules:
|
||||||
|
- if: $VERSION
|
||||||
|
script:
|
||||||
|
- *setup_scripts
|
||||||
|
- mkdir -p ./build;cargo deb --output ./build
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- build/*
|
- build/*
|
||||||
untracked: true
|
untracked: true
|
||||||
|
|
||||||
|
build:x86_64:
|
||||||
|
<<: *compile
|
||||||
|
stage: build
|
||||||
|
tags:
|
||||||
|
- x86_64
|
||||||
|
|
||||||
|
build:aarch64:
|
||||||
|
<<: *compile
|
||||||
|
stage: build
|
||||||
|
tags:
|
||||||
|
- aarch64
|
||||||
|
|
||||||
upload:
|
upload:
|
||||||
stage: upload
|
stage: upload
|
||||||
dependencies:
|
dependencies:
|
||||||
- build
|
- build:x86_64
|
||||||
|
- build:aarch64
|
||||||
rules:
|
rules:
|
||||||
- if: $VERSION
|
- if: $VERSION
|
||||||
script:
|
script:
|
||||||
- file=$( find ./build -name "*.deb" | head -n 1 )
|
- find ./build -name "*.deb"
|
||||||
- export filename=$( basename $file )
|
- debs=( $( find ./build -name "*.deb" ) )
|
||||||
- package_url="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/gtkgreet/${VERSION}/${filename}"
|
- assets=""
|
||||||
- "curl --header \"JOB-TOKEN: $CI_JOB_TOKEN\" --upload-file \"${file}\" \"${package_url}\""
|
- for d in ${debs[@]};do
|
||||||
|
- file=$( basename ${d} )
|
||||||
|
- url="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/batalert/${VERSION}/${file}"
|
||||||
|
- assets="${assets} --assets-link {\"name\":\"${file}\",\"url\":\"${url}\",\"link_type\":\"other\"} "
|
||||||
|
- "curl --header \"JOB-TOKEN: $CI_JOB_TOKEN\" --upload-file \"${d}\" \"${url}\""
|
||||||
|
- done
|
||||||
|
- echo "ASSETS_ARG=${assets}" >> assets.env
|
||||||
|
artifacts:
|
||||||
|
reports:
|
||||||
|
dotenv: assets.env
|
||||||
|
|
||||||
release:
|
release:
|
||||||
stage: release
|
stage: release
|
||||||
|
@ -43,12 +66,6 @@ release:
|
||||||
rules:
|
rules:
|
||||||
- if: $VERSION
|
- if: $VERSION
|
||||||
script:
|
script:
|
||||||
- echo "making release! ${package_url}"
|
- echo "making release!"
|
||||||
release:
|
- echo ${ASSETS_ARG}
|
||||||
tag_name: "${VERSION}-${CI_RUNNER_EXECUTABLE_ARCH#*/}"
|
- release-cli create --name "Release ${VERSION}" --tag-name "${VERSION}" ${ASSETS_ARG}
|
||||||
description: "batalert ${VERSION} ${CI_RUNNER_EXECUTABLE_ARCH}"
|
|
||||||
assets:
|
|
||||||
links:
|
|
||||||
- name: "${CI_RUNNER_EXECUTABLE_ARCH} deb"
|
|
||||||
url: "$package_url"
|
|
||||||
|
|
||||||
|
|
Reference in a new issue