kopia lustrzana https://gitlab.com/gridtracker.org/gridtracker
Merge branch 'deploy-to-deb-repo' into 'flatpaks'
Deploy to deb repo See merge request gridtracker.org/gridtracker!296 If this is changing anything in the UI or operational behavior, please prepare to update the wiki!merge-requests/237/head lin_flatpaks
commit
c9bc96c981
119
.gitlab-ci.yml
119
.gitlab-ci.yml
|
@ -59,7 +59,7 @@ win:package:
|
|||
stage: package
|
||||
rules:
|
||||
# only do this with a manual tag starting with v or test_
|
||||
- if: '$CI_COMMIT_TAG =~ /^(v|test_).*/'
|
||||
- if: '$CI_COMMIT_TAG =~ /^(v|test_|win_).*/'
|
||||
artifacts:
|
||||
paths:
|
||||
- artifacts/
|
||||
|
@ -121,7 +121,7 @@ linux:package:
|
|||
stage: package
|
||||
rules:
|
||||
# only do this with a manual tag starting with v or test_
|
||||
- if: '$CI_COMMIT_TAG =~ /^(v|test_).*/'
|
||||
- if: '$CI_COMMIT_TAG =~ /^(v|test_|lin_).*/'
|
||||
artifacts:
|
||||
paths:
|
||||
- artifacts/
|
||||
|
@ -140,6 +140,14 @@ linux:package:
|
|||
mkdir -p artifacts
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apt_get[collapsed=true]\r\e[0KGetting Build Dependencies"
|
||||
apt-get update && apt-get upgrade -y
|
||||
apt-get install gnupg -y
|
||||
curl --silent "https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files/-/raw/main/installer" | bash
|
||||
export GPG_TTY=$(tty)
|
||||
gpg --pinentry-mode loopback --passphrase ${GPG_PASS} --import .secure_files/debiankey.asc
|
||||
echo ${GPG_TRUST} | gpg --import-ownertrust
|
||||
echo 'use-agent' >> ~/.gnupg/gpg.conf
|
||||
echo 'pinentry-mode loopback' >> ~/.gnupg/gpg.conf
|
||||
echo 'allow-loopback-pinentry' >> ~/.gnupg/gpg-agent.conf
|
||||
apt-get install flatpak flatpak-builder -y
|
||||
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||
flatpak install org.freedesktop.Sdk//22.08 -y
|
||||
|
@ -162,6 +170,8 @@ linux:package:
|
|||
fi
|
||||
done
|
||||
(cd dist; mv *.tar.gz ../artifacts/)
|
||||
gpg --batch --no-tty --detach-sign --armor --passphrase ${GPG_PASS} artifacts/GridTracker*x86.tar.gz
|
||||
gpg --batch --no-tty --detach-sign --armor --passphrase ${GPG_PASS} artifacts/GridTracker*x64.tar.gz
|
||||
echo -e "\e[0Ksection_end:`date +%s`:native_build\e[0K"
|
||||
# This section does debian DEBs
|
||||
echo -e "\e[0Ksection_start:`date +%s`:debian_build[collapsed=true]\r\e[0KBuilding Debian packages"
|
||||
|
@ -180,7 +190,7 @@ mac:package:
|
|||
stage: package
|
||||
rules:
|
||||
# only do this with a manual tag starting with v or test_
|
||||
- if: '$CI_COMMIT_TAG =~ /^(v|test_).*/'
|
||||
- if: '$CI_COMMIT_TAG =~ /^(v|test_|mac_).*/'
|
||||
artifacts:
|
||||
paths:
|
||||
- artifacts/
|
||||
|
@ -220,7 +230,7 @@ arm:package:
|
|||
NWJS64_BUILD: "nw54-arm64_2021-07-10"
|
||||
rules:
|
||||
# only do this with a manual tag starting with v or test_
|
||||
- if: '$CI_COMMIT_TAG =~ /^(v|test_).*/'
|
||||
- if: '$CI_COMMIT_TAG =~ /^(v|test_|lin_).*/'
|
||||
artifacts:
|
||||
paths:
|
||||
- artifacts/
|
||||
|
@ -240,6 +250,14 @@ arm:package:
|
|||
#dpkg --add-architecture armhf
|
||||
echo -e "\e[0Ksection_start:`date +%s`:apt_get[collapsed=true]\r\e[0KGetting Build Dependencies"
|
||||
apt-get update && apt-get upgrade -y
|
||||
apt-get install gnupg -y
|
||||
curl --silent "https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files/-/raw/main/installer" | bash
|
||||
export GPG_TTY=$(tty)
|
||||
gpg --pinentry-mode loopback --passphrase ${GPG_PASS} --import .secure_files/debiankey.asc
|
||||
echo ${GPG_TRUST} | gpg --import-ownertrust
|
||||
echo 'use-agent' >> ~/.gnupg/gpg.conf
|
||||
echo 'pinentry-mode loopback' >> ~/.gnupg/gpg.conf
|
||||
echo 'allow-loopback-pinentry' >> ~/.gnupg/gpg-agent.conf
|
||||
apt-get build-dep .
|
||||
apt-get install flatpak flatpak-builder -y
|
||||
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
||||
|
@ -287,6 +305,16 @@ arm:package:
|
|||
rm nwjs-$NWJS_VERSION-linux-arm64/locales/*.info
|
||||
echo "Merging $nwjs-$NWJS_VERSION-linux-arm64 binary with GridTracker..."
|
||||
mv nwjs-$NWJS_VERSION-linux-arm64/nw nwjs-$NWJS_VERSION-linux-arm64/GridTracker
|
||||
version=`node ./version.js`
|
||||
mkdir GridTracker-$version-linux-arm64
|
||||
cp -r nwjs-$NWJS_VERSION-linux-arm64/* GridTracker-$version-linux-arm64/
|
||||
cp -r arm/* GridTracker-$version-linux-arm64/
|
||||
cp -r package.nw GridTracker-$version-linux-arm64/
|
||||
cp LICENSE GridTracker-$version-linux-arm64/
|
||||
tar -czf GridTracker-$version-linux-arm64.tar.gz GridTracker-$version-linux-arm64
|
||||
mv GridTracker-$version-linux-arm64.tar.gz artifacts/
|
||||
gpg --batch --no-tty --detach-sign --armor --passphrase ${GPG_PASS} artifacts/GridTracker*arm32.tar.gz
|
||||
gpg --batch --no-tty --detach-sign --armor --passphrase ${GPG_PASS} artifacts/GridTracker*arm64.tar.gz
|
||||
VER=`node version.js`
|
||||
mkdir GridTracker-${VER}-linux-arm64
|
||||
cp -r nwjs-$NWJS_VERSION-linux-arm64/* GridTracker-${VER}-linux-arm64/
|
||||
|
@ -321,7 +349,7 @@ upload-Google:
|
|||
variables:
|
||||
GIT_STRATEGY: none
|
||||
rules:
|
||||
- if: '$CI_COMMIT_TAG =~ /^(v|test_).*/'
|
||||
- if: '$CI_COMMIT_TAG =~ /^(v|test_|win_|mac_|lin_).*/'
|
||||
script:
|
||||
- |
|
||||
echo $GCP_SERVICE_KEY > gcloud-service-key.json
|
||||
|
@ -329,6 +357,49 @@ upload-Google:
|
|||
gcloud config set project $GCLOUD_PROJECT_ID
|
||||
gsutil -m cp -R artifacts/* $GCLOUD_DEPLOY_PATH/
|
||||
|
||||
update_deb_repo:
|
||||
stage: deploy
|
||||
rules:
|
||||
- if: '$CI_COMMIT_TAG =~ /^(v|test_|lin_).*/'
|
||||
before_script:
|
||||
- |
|
||||
apt-get update && apt-get upgrade -y
|
||||
apt-get install apt apt-utils apt-transport-https ca-certificates gnupg -y
|
||||
echo "deb [signed-by=/usr/share/keyrings/cloud.google.asc] https://packages.cloud.google.com/apt cloud-sdk main" | tee -a /etc/apt/sources.list.d/google-cloud-sdk.list
|
||||
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | tee /usr/share/keyrings/cloud.google.asc
|
||||
apt-get update && apt-get install google-cloud-cli -y
|
||||
curl --silent "https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files/-/raw/main/installer" | bash
|
||||
echo $GCP_SERVICE_KEY > gcloud-service-key.json
|
||||
export GPG_TTY=$(tty)
|
||||
gpg --pinentry-mode loopback --passphrase ${GPG_PASS} --import .secure_files/debiankey.asc
|
||||
echo ${GPG_TRUST} | gpg --import-ownertrust
|
||||
echo 'use-agent' >> ~/.gnupg/gpg.conf
|
||||
echo 'pinentry-mode loopback' >> ~/.gnupg/gpg.conf
|
||||
echo 'allow-loopback-pinentry' >> ~/.gnupg/gpg-agent.conf
|
||||
gcloud auth activate-service-account --key-file gcloud-service-key.json
|
||||
gcloud config set project $GCLOUD_PROJECT_ID
|
||||
script:
|
||||
- |
|
||||
VER=`node version.js`
|
||||
mkdir debianrepo
|
||||
gsutil cp gs://debian.gridtracker.org/debian/* debianrepo/
|
||||
cp artifacts/gridtracker_${VER}_all.deb debianrepo/
|
||||
cd debianrepo
|
||||
rm InRelease
|
||||
rm Release.gpg
|
||||
apt-ftparchive packages . > Packages
|
||||
apt-ftparchive release . > Release
|
||||
gpg --batch --no-tty --passphrase ${GPG_PASS} --clearsign -o InRelease Release
|
||||
gpg --batch --no-tty --passphrase ${GPG_PASS} -abs -o Release.gpg Release
|
||||
if [[ ${CI_COMMIT_TAG} = test_* ]] || [[ ${CI_COMMIT_TAG} = lin_* ]]
|
||||
then
|
||||
gsutil cp ./* gs://debian.gridtracker.org/test/
|
||||
fi
|
||||
if [[ ${CI_COMMIT_TAG} = v* ]]
|
||||
then
|
||||
gsutil cp ./* gs://debian.gridtracker.org/debian/
|
||||
fi
|
||||
|
||||
update_arch_aur:
|
||||
stage: deploy
|
||||
image: archlinux:base-devel
|
||||
|
@ -427,7 +498,7 @@ sourcerelease:
|
|||
virustotal_push:
|
||||
stage: publish
|
||||
rules:
|
||||
- if: '$CI_COMMIT_TAG =~ /^(v|test_).*/'
|
||||
- if: '$CI_COMMIT_TAG =~ /^(v|test_|win_).*/'
|
||||
script:
|
||||
- |
|
||||
echo "Pushing release URLs to VirusTotal"
|
||||
|
@ -438,24 +509,38 @@ virustotal_push:
|
|||
discord_notify:
|
||||
stage: publish
|
||||
rules:
|
||||
- if: '$CI_COMMIT_TAG =~ /^(v|test_).*/'
|
||||
- if: '$CI_COMMIT_TAG =~ /^(v|test_|win_|mac_|lin_).*/'
|
||||
script:
|
||||
- |
|
||||
echo "Notifying Discord #developer-den that a release has built"
|
||||
BASEURL="http://downloads.gridtracker.org/${CI_COMMIT_TAG}/"
|
||||
VER=`node version.js`
|
||||
WIN_MD5=($(md5sum artifacts/GridTracker-Installer.${VER}.exe))
|
||||
MAC_MD5=($(md5sum artifacts/GridTracker-${VER}-mac-x64.zip))
|
||||
LINARM32_MD5=($(md5sum artifacts/GridTracker-${VER}-linux-arm32.tar.gz))
|
||||
LINARM64_MD5=($(md5sum artifacts/GridTracker-${VER}-linux-arm64.tar.gz))
|
||||
LINx86_MD5=($(md5sum artifacts/GridTracker-${VER}-linux-x86.tar.gz))
|
||||
LINx64_MD5=($(md5sum artifacts/GridTracker-${VER}-linux-x64.tar.gz))
|
||||
DEB_MD5=($(md5sum artifacts/gridtracker_${VER}_all.deb))
|
||||
FLATx64_MD5=($(md5sum artifacts/GridTracker-${VER}-x86_64.flatpak))
|
||||
FLATARM64_MD5=($(md5sum artifacts/GridTracker-${VER}-arm64.flatpak))
|
||||
if [[ ${CI_COMMIT_TAG} = v* ]] || [[ ${CI_COMMIT_TAG} = test_* ]] || [[ ${CI_COMMIT_TAG} = win_* ]]
|
||||
then
|
||||
WIN_MD5=($(md5sum artifacts/GridTracker-Installer.${VER}.exe))
|
||||
WIN_STRING="**GridTracker-Installer.${VER}.exe**\nmd5: ${WIN_MD5}\n${BASEURL}GridTracker-Installer.${VER}.exe\n\n"
|
||||
fi
|
||||
if [[ ${CI_COMMIT_TAG} = v* ]] || [[ ${CI_COMMIT_TAG} = test_* ]] || [[ ${CI_COMMIT_TAG} = mac_* ]]
|
||||
then
|
||||
MAC_MD5=($(md5sum artifacts/GridTracker-${VER}-mac-x64.zip))
|
||||
MAC_STRING="**GridTracker-${VER}-mac-x64.zip**\nMD5: ${MAC_MD5}\n${BASEURL}GridTracker-${VER}-mac-x64.zip\n\n"
|
||||
fi
|
||||
if [[ ${CI_COMMIT_TAG} = v* ]] || [[ ${CI_COMMIT_TAG} = test_* ]] || [[ ${CI_COMMIT_TAG} = lin_* ]]
|
||||
then
|
||||
LINARM32_MD5=($(md5sum artifacts/GridTracker-${VER}-linux-arm32.tar.gz))
|
||||
LINARM32_STRING="**GridTracker-${VER}-linux-arm32.tar.gz**\nMD5: ${LINARM32_MD5}\n${BASEURL}GridTracker-${VER}-linux-arm32.tar.gz\n${BASEURL}GridTracker-${VER}-linux-arm32.tar.gz.asc\n\n"
|
||||
LINARM64_MD5=($(md5sum artifacts/GridTracker-${VER}-linux-arm64.tar.gz))
|
||||
LINARM64_STRING="**GridTracker-${VER}-linux-arm64.tar.gz**\nMD5: ${LINARM64_MD5}\n${BASEURL}GridTracker-${VER}-linux-arm64.tar.gz\n${BASEURL}GridTracker-${VER}-linux-arm64.tar.gz.asc\n\n"
|
||||
LINx86_MD5=($(md5sum artifacts/GridTracker-${VER}-linux-x86.tar.gz))
|
||||
LINx86_STRING="**GridTracker-${VER}-linux-x86.tar.gz**\nMD5: ${LINx86_MD5}\n${BASEURL}GridTracker-${VER}-linux-x86.tar.gz\n${BASEURL}GridTracker-${VER}-linux-x86.tar.gz.asc\n\n"
|
||||
LINx64_MD5=($(md5sum artifacts/GridTracker-${VER}-linux-x64.tar.gz))
|
||||
LINx64_STRING="**GridTracker-${VER}-linux-x64.tar.gz**\nMD5: ${LINx64_MD5}\n${BASEURL}GridTracker-${VER}-linux-x64.tar.gz\n${BASEURL}GridTracker-${VER}-linux-x86.tar.gz.asc\n\n"
|
||||
DEB_MD5=($(md5sum artifacts/gridtracker_${VER}_all.deb))
|
||||
DEB_STRING="**gridtracker_${VER}_all.deb**\nMD5: ${DEB_MD5} - ${BASEURL}gridtracker_${VER}_all.deb"
|
||||
fi
|
||||
curl -H "Content-Type: application/json" -X POST $DISCORD_WEBHOOK --data-binary @- << EOM
|
||||
{
|
||||
"content": "**GridTracker-Installer.${VER}.exe**\nmd5: ${WIN_MD5} - ${BASEURL}GridTracker-Installer.${VER}.exe\n\n**GridTracker-${VER}-mac-x64.zip**\nMD5: ${MAC_MD5} - ${BASEURL}GridTracker-${VER}-mac-x64.zip\n\n**GridTracker-${VER}-linux-arm32.tar.gz**\nMD5: ${LINARM32_MD5} - ${BASEURL}GridTracker-${VER}-linux-arm32.tar.gz\n\n**GridTracker-${VER}-linux-arm64.tar.gz**\nMD5: ${LINARM64_MD5} - ${BASEURL}GridTracker-${VER}-linux-arm64.tar.gz\n\n**GridTracker-${VER}-linux-x86.tar.gz**\nMD5: ${LINx86_MD5} - ${BASEURL}GridTracker-${VER}-linux-x86.tar.gz\n\n**GridTracker-${VER}-linux-x64.tar.gz**\nMD5: ${LINx64_MD5} - ${BASEURL}GridTracker-${VER}-linux-x64.tar.gz\n\n**gridtracker_${VER}_all.deb**\nMD5: ${DEB_MD5} - ${BASEURL}gridtracker_${VER}_all.deb\n\n**GridTracker-${VER}-x86_64.flatpak**\nMD5: ${FLATx64_MD5} - ${BASEURL}GridTracker-${VER}-x86_64.flatpak\n\n**GridTracker-${VER}-arm64.flatpak**\nMD5: ${FLATARM64_MD5} - ${BASEURL}GridTracker-${VER}-arm64.flatpak",
|
||||
"content": "${CI_COMMIT_TAG_MESSAGE}\n\n${WIN_STRING}${MAC_STRING}${LINARM32_STRING}${LINARM64_STRING}${LINx86_STRING}${LINx64_STRING}${DEB_STRING}",
|
||||
"tts": false,
|
||||
"embeds": [],
|
||||
"components": {},
|
||||
|
|
Ładowanie…
Reference in New Issue