This repository has been archived on 2025-03-19. You can view files and clone it, but cannot push or open issues or pull requests.
batalert/.gitlab-ci.yml
2024-04-23 18:15:57 -06:00

54 lines
1.3 KiB
YAML

# Is performed before the scripts in the stages step
before_script:
- source /etc/profile
# Defines stages which are to be executed
stages:
- build
- upload
- release
# Stage "build"
build:
stage: build
rules:
- if: $VERSION
script:
- apt-get -y install rustup libdbus-glib-1-dev
- rustup default stable
- cargo install cargo-deb
- mkdir ./build;cargo deb --output ./build
# The files which are to be made available in GitLab
artifacts:
paths:
- build/*
untracked: true
upload:
stage: upload
dependencies:
- build
rules:
- if: $VERSION
script:
- file=$( find ./build -name "*.deb" | head -n 1 )
- export filename=$( basename $file )
- package_url="${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/gtkgreet/${VERSION}/${filename}"
- "curl --header \"JOB-TOKEN: $CI_JOB_TOKEN\" --upload-file \"${file}\" \"${package_url}\""
release:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $VERSION
script:
- echo "making release! ${package_url}"
release:
tag_name: "batalert ${VERSION}-${CI_RUNNER_EXECUTABLE_ARCH}"
description: "batalert ${VERSION} ${CI_RUNNER_EXECUTABLE_ARCH}"
assets:
links:
- name: "${CI_RUNNER_EXECUTABLE_ARCH} deb"
url: "$package_url"