Commit 8b93e024 authored by Maxime Accadia's avatar Maxime Accadia
Browse files

Merge branch '1-utiliser-gitlab-ci-pour-publier-un-paquet-deb' into 'master'

Resolve "Utiliser Gitlab-CI pour publier un paquet .deb"

Closes #1

See merge request !1
parents 5d94dade 9fe3c3ec
stages:
- build
- upload
- release
variables:
# Package version can only contain numbers (0-9), and dots (.).
# Must be in the format of X.Y.Z, i.e. should match /\A\d+\.\d+\.\d+\z/ regular expresion.
# See https://docs.gitlab.com/ee/user/packages/generic_packages/#publish-a-package-file
PACKAGE_VERSION: $CI_COMMIT_TAG
PACKAGE_REGISTRY_URL: "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/design-linux-uga"
DEB_FILE: "design-linux-uga.deb"
build:
stage: build
image: ubuntu:latest
rules:
- if: $CI_COMMIT_TAG
script:
- apt-get update
- apt-get install -y librsvg2-bin imagemagick make dpkg
- 'sed -i "s/<version>/$CI_COMMIT_TAG/g" debian/control'
- bash mkdeb.sh
artifacts:
paths:
- $DEB_FILE
upload:
stage: upload
image: curlimages/curl:latest
rules:
- if: $CI_COMMIT_TAG
script:
- |
ls
echo "Version : $CI_COMMIT_TAG"
curl --header "JOB-TOKEN: ${CI_JOB_TOKEN}" --upload-file ${DEB_FILE} ${PACKAGE_REGISTRY_URL}/${CI_COMMIT_TAG}/${DEB_FILE}
release:
# Caution, as of 2021-02-02 these assets links require a login, see:
# https://gitlab.com/gitlab-org/gitlab/-/issues/299384
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
rules:
- if: $CI_COMMIT_TAG
script:
- |
release-cli create --name "Release $CI_COMMIT_TAG" --tag-name $CI_COMMIT_TAG \
--assets-link "{\"name\":\"${DEB_FILE}\",\"url\":\"${PACKAGE_REGISTRY_URL}/${CI_COMMIT_TAG}/${DEB_FILE}\"}"
......@@ -4,6 +4,6 @@ Section: misc
Priority: optional
Architecture: all
Essential: no
Recommends: plymouth-theme-spinner
Suggest: plymouth-theme-spinner
Maintainer: maxime.accadia@univ-grenoble-alpes.fr
Description: Fonds d'écran et éléments de design UGA pour Linux
......@@ -14,6 +14,7 @@ mkdir -p "$FAKEROOT/usr/share/icons"
mkdir -p "$FAKEROOT/DEBIAN"
cp debian/control "$FAKEROOT/DEBIAN"
sed -i "s/<version>/0.0/g" "$FAKEROOT/DEBIAN/control" # mets la version à 0.0 si il n'y en a pas
cp debian/postinst "$FAKEROOT/DEBIAN"
cp debian/postrm "$FAKEROOT/DEBIAN"
chmod 0755 "$FAKEROOT/DEBIAN/postinst"
......@@ -21,8 +22,12 @@ chmod 0755 "$FAKEROOT/DEBIAN/postrm"
# fonds d'écrans
which inkscape || sudo apt install inkscape
which mogrify || sudo apt install imagemagick
if ! which rsvg-convert; then
echo "rsvg missing" && exit 1
fi
if ! which mogrify; then
echo "imagemagick missing" && exit 1
fi
cd wallpapers
make
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment