2020-11-04 01:22:11 +00:00
|
|
|
# This file is a template, and might need editing before it works on your project.
|
|
|
|
# see https://docs.gitlab.com/ee/ci/yaml/README.html for all available options
|
|
|
|
|
2020-11-04 01:40:43 +00:00
|
|
|
variables:
|
2023-10-14 20:42:44 +00:00
|
|
|
DEFAULT_IMAGE: registry.gitlab.com/gridtracker.org/gtbuilder:v1-3
|
2020-11-11 00:34:09 +00:00
|
|
|
APT_CACHE_DIR: $CI_PROJECT_DIR/.cache/apt
|
2020-11-11 17:38:42 +00:00
|
|
|
NPM_CONFIG_CACHE: $CI_PROJECT_DIR/.cache/npm
|
2020-11-20 23:23:04 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# We have code in here for releasing on both GS and S3, control it through variables
|
|
|
|
# on GitLab, do not change it in this file.
|
|
|
|
#
|
2022-05-02 02:47:01 +00:00
|
|
|
GCLOUD_PROJECT_ID: "cent7-288417"
|
2020-11-11 18:00:15 +00:00
|
|
|
GCLOUD_SERVICE_ACCOUNT: /dev/null
|
2022-10-14 22:05:23 +00:00
|
|
|
GCLOUD_DEPLOY_PATH: gs://downloads.gridtracker.org/$CI_COMMIT_TAG
|
2021-03-15 17:02:13 +00:00
|
|
|
NR0Q_SERVER_ADDRESS: ""
|
|
|
|
NR0Q_SERVER_PASSWORD: ""
|
2020-11-12 06:40:44 +00:00
|
|
|
|
2020-11-20 23:23:04 +00:00
|
|
|
# nothing in this file ill be allowed to run automatically except for:
|
2020-11-12 06:40:44 +00:00
|
|
|
# 1. merge requests
|
|
|
|
# 2. manual tagging
|
|
|
|
# 3. committing to the default branch
|
|
|
|
include:
|
|
|
|
- template: "Workflows/MergeRequest-Pipelines.gitlab-ci.yml"
|
2021-11-16 03:56:53 +00:00
|
|
|
- template: "Security/Dependency-Scanning.gitlab-ci.yml"
|
2021-11-16 04:10:31 +00:00
|
|
|
- template: "Security/Secret-Detection.gitlab-ci.yml"
|
2021-11-16 04:11:44 +00:00
|
|
|
- template: "Security/SAST.gitlab-ci.yml"
|
2021-11-16 04:10:31 +00:00
|
|
|
|
2020-11-11 05:57:38 +00:00
|
|
|
stages:
|
|
|
|
- build
|
|
|
|
- test
|
2021-12-15 17:19:00 +00:00
|
|
|
- staging
|
2020-11-11 18:00:15 +00:00
|
|
|
- package
|
2021-12-15 17:19:00 +00:00
|
|
|
- pre-deploy
|
2020-11-11 05:57:38 +00:00
|
|
|
- deploy
|
2023-10-21 01:34:08 +00:00
|
|
|
- publish
|
2020-11-11 05:57:38 +00:00
|
|
|
|
2020-11-04 01:40:43 +00:00
|
|
|
default:
|
|
|
|
image: ${DEFAULT_IMAGE}
|
|
|
|
interruptible: true
|
2020-11-04 01:22:11 +00:00
|
|
|
|
2020-11-12 06:40:44 +00:00
|
|
|
# just do a quick syntax check job, we don't need to "build" anything here other than the
|
|
|
|
# outer dev environment for gridtracker
|
2021-12-15 17:19:00 +00:00
|
|
|
npm:test:
|
2020-11-11 18:00:15 +00:00
|
|
|
stage: test
|
|
|
|
image: node:latest
|
|
|
|
script:
|
|
|
|
- npm install
|
|
|
|
- npm test
|
|
|
|
|
|
|
|
# test2:
|
|
|
|
# stage: test
|
|
|
|
# script:
|
|
|
|
# - echo "Do another parallel test here"
|
|
|
|
# - echo "For example run a lint test"
|
|
|
|
|
2020-11-12 06:40:44 +00:00
|
|
|
# package binaries and create build artifacts that may be used in later stages
|
2021-12-15 17:19:00 +00:00
|
|
|
win:package:
|
2021-03-23 01:15:00 +00:00
|
|
|
stage: package
|
|
|
|
rules:
|
|
|
|
# only do this with a manual tag starting with v or test_
|
|
|
|
- if: '$CI_COMMIT_TAG =~ /^(v|test_).*/'
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- artifacts/
|
|
|
|
name: '$CI_COMMIT_REF_SLUG'
|
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- .cache/
|
|
|
|
- node_modules/
|
|
|
|
key:
|
|
|
|
files:
|
|
|
|
- package.json
|
|
|
|
- package.nw/package.json
|
2021-12-15 17:19:00 +00:00
|
|
|
before_script:
|
2021-03-23 01:15:00 +00:00
|
|
|
- |
|
2021-12-15 17:19:00 +00:00
|
|
|
mkdir -p $NPM_CONFIG_CACHE
|
2021-03-23 01:15:00 +00:00
|
|
|
mkdir -p artifacts
|
|
|
|
echo -e "\e[0Ksection_start:`date +%s`:apt_get[collapsed=true]\r\e[0KGetting Build Dependencies"
|
2021-12-15 17:19:00 +00:00
|
|
|
apt-get update && apt-get upgrade -y
|
2023-10-14 20:42:44 +00:00
|
|
|
apt-get install curl p7zip -y
|
2021-03-23 01:15:00 +00:00
|
|
|
wget https://nsis.sourceforge.io/mediawiki/images/4/47/Registry.zip
|
2022-01-25 04:57:42 +00:00
|
|
|
unzip -bj Registry.zip Desktop/Plugin/registry.dll -d /usr/share/nsis/Plugins/x86-unicode/
|
|
|
|
unzip -bj Registry.zip Desktop/Include/Registry.nsh -d /usr/share/nsis/Include/
|
|
|
|
wget https://nsis.sourceforge.io/mediawiki/images/1/18/NsProcess.zip
|
|
|
|
7zr e NsProcess.zip -y -o/usr/share/nsis/Include/ Include/nsProcess.nsh
|
|
|
|
7zr e NsProcess.zip -y -o/usr/share/nsis/Plugins/x86-unicode/ Plugin/nsProcessW.dll
|
|
|
|
mv /usr/share/nsis/Plugins/x86-unicode/nsProcessW.dll /usr/share/nsis/Plugins/x86-unicode/nsProcess.dll
|
2023-10-14 20:42:44 +00:00
|
|
|
curl --silent "https://gitlab.com/gitlab-org/incubation-engineering/mobile-devops/download-secure-files/-/raw/main/installer" | bash
|
2022-10-16 19:46:49 +00:00
|
|
|
echo -e "\e[0Ksection_end:`date +%s`:apt_get\r\e[0K"
|
2021-12-15 17:19:00 +00:00
|
|
|
script:
|
2021-03-23 01:15:00 +00:00
|
|
|
- |
|
2021-12-15 17:19:00 +00:00
|
|
|
# Making our Windows packages
|
|
|
|
test `node version.js` = `dpkg-parsechangelog -S version` || (echo "package.nw/package.json and debian/changelog version mismatch"; exit 1)
|
2022-10-16 19:46:49 +00:00
|
|
|
echo -e "\e[0Ksection_start:`date +%s`:native_build[collapsed=true]\r\e[0KBuilding native packages"
|
2021-03-23 01:15:00 +00:00
|
|
|
npm install --prefer-offline
|
|
|
|
npm run dist-win
|
|
|
|
for dir in dist/*-win-* ; do
|
2022-10-08 23:00:56 +00:00
|
|
|
if [ -f $dir ] && [[ "$dir" == *"-Setup.exe" ]] ; then
|
|
|
|
echo "deleting broken installer $dir"
|
|
|
|
rm $dir
|
|
|
|
fi
|
2021-03-23 01:15:00 +00:00
|
|
|
done
|
2022-10-08 23:00:56 +00:00
|
|
|
rm dist/*-win-*/locales/*.info
|
2021-12-15 17:19:00 +00:00
|
|
|
# Now we need to sign the executable before it get's stuffed into Nullsoft
|
|
|
|
# using mono signcode
|
2023-10-16 19:57:58 +00:00
|
|
|
echo $SIGN_PASS | signcode -a sha256 -n GridTracker -i https://gridtracker.org -spc .secure_files/beau-gunderson.spc -v .secure_files/beau-gunderson.pvk dist/GridTracker-*-win-x86/GridTracker.exe
|
|
|
|
rm dist/*win*/*.bak
|
2021-12-15 17:19:00 +00:00
|
|
|
# Now the executable should be signed
|
2022-01-25 04:57:42 +00:00
|
|
|
sed "s#<versionplaceholder>#`node version.js`#g" windows/win_installer.nsi > windows/setup.nsi.tmp.1
|
|
|
|
sed "s#<buildplaceholder>#`pwd`#g" windows/setup.nsi.tmp.1 > windows/setup.nsi
|
2021-03-23 01:15:00 +00:00
|
|
|
makensis windows/setup.nsi
|
|
|
|
# clean up generated files
|
|
|
|
rm windows/setup.nsi
|
2021-03-23 02:37:39 +00:00
|
|
|
rm windows/setup.nsi.tmp.1
|
2023-10-16 19:57:58 +00:00
|
|
|
echo $SIGN_PASS | signcode -a sha256 -n GridTracker -i https://gridtracker.org -spc .secure_files/beau-gunderson.spc -v .secure_files/beau-gunderson.pvk dist/GridTracker-Installer.*.exe
|
2021-03-26 19:09:24 +00:00
|
|
|
(cd dist ; mv GridTracker-Installer.*.exe ../artifacts)
|
2021-03-23 01:15:00 +00:00
|
|
|
echo -e "\e[0Ksection_end:`date +%s`:native_build\e[0K"
|
|
|
|
|
2021-12-15 17:19:00 +00:00
|
|
|
linux:package:
|
2020-11-11 18:00:15 +00:00
|
|
|
stage: package
|
|
|
|
rules:
|
2020-11-12 06:40:44 +00:00
|
|
|
# only do this with a manual tag starting with v or test_
|
2020-11-11 18:00:15 +00:00
|
|
|
- if: '$CI_COMMIT_TAG =~ /^(v|test_).*/'
|
|
|
|
artifacts:
|
|
|
|
paths:
|
2021-03-09 04:49:44 +00:00
|
|
|
- artifacts/
|
2020-11-11 18:00:15 +00:00
|
|
|
name: '$CI_COMMIT_REF_SLUG'
|
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- .cache/
|
|
|
|
- node_modules/
|
|
|
|
key:
|
|
|
|
files:
|
|
|
|
- package.json
|
|
|
|
- package.nw/package.json
|
2021-12-15 17:19:00 +00:00
|
|
|
before_script:
|
2021-03-09 04:49:44 +00:00
|
|
|
- |
|
2021-12-15 17:19:00 +00:00
|
|
|
mkdir -p $NPM_CONFIG_CACHE
|
|
|
|
mkdir -p artifacts
|
2021-03-09 04:49:44 +00:00
|
|
|
echo -e "\e[0Ksection_start:`date +%s`:apt_get[collapsed=true]\r\e[0KGetting Build Dependencies"
|
2021-12-15 17:19:00 +00:00
|
|
|
apt-get update && apt-get upgrade -y
|
2022-10-16 14:30:35 +00:00
|
|
|
apt-get install flatpak flatpak-builder -y
|
2022-10-16 14:45:17 +00:00
|
|
|
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
|
|
|
flatpak install org.freedesktop.Sdk//22.08 -y
|
2022-10-16 15:24:54 +00:00
|
|
|
flatpak install org.freedesktop.Platform//22.08 -y
|
2021-03-09 04:49:44 +00:00
|
|
|
echo -e "\e[0Ksection_end:`date +%s`:apt_get\r\e[0K"
|
2021-12-15 17:19:00 +00:00
|
|
|
script:
|
2021-03-09 04:49:44 +00:00
|
|
|
- |
|
2021-12-15 17:19:00 +00:00
|
|
|
# Making our distro agnostic Linux packages
|
|
|
|
test `node version.js` = `dpkg-parsechangelog -S version` || (echo "package.nw/package.json and debian/changelog version mismatch"; exit 1)
|
2023-10-21 17:31:10 +00:00
|
|
|
VER=`node version.js`
|
2022-10-16 19:46:49 +00:00
|
|
|
echo -e "\e[0Ksection_start:`date +%s`:native_build[collapsed=true]\r\e[0KBuilding native packages"
|
2021-03-09 04:49:44 +00:00
|
|
|
npm install --prefer-offline
|
2021-03-23 01:15:00 +00:00
|
|
|
npm run dist-nix
|
2023-10-09 19:48:21 +00:00
|
|
|
chmod 755 dist/*-linux-*/GridTracker dist/*-linux-*/lib dist/*-linux-*/locales dist/*-linux-*/swiftshader/ dist/*-linux-*/chrome_crashpad_handler
|
2021-03-15 17:02:13 +00:00
|
|
|
for dir in dist/*-linux-* ; do
|
|
|
|
if [ -d $dir ] ; then
|
|
|
|
cp package.nw/img/gridtracker.png $dir/
|
2021-03-27 02:25:50 +00:00
|
|
|
rm $dir/locales/*.info
|
2021-03-15 17:02:13 +00:00
|
|
|
tar -C dist -czf ${dir}.tar.gz `basename $dir`
|
|
|
|
fi
|
|
|
|
done
|
2021-12-15 17:19:00 +00:00
|
|
|
(cd dist; mv *.tar.gz ../artifacts/)
|
2021-03-09 04:49:44 +00:00
|
|
|
echo -e "\e[0Ksection_end:`date +%s`:native_build\e[0K"
|
2021-12-15 17:19:00 +00:00
|
|
|
# This section does debian DEBs
|
2022-10-16 19:46:49 +00:00
|
|
|
echo -e "\e[0Ksection_start:`date +%s`:debian_build[collapsed=true]\r\e[0KBuilding Debian packages"
|
2021-12-15 17:19:00 +00:00
|
|
|
dpkg-buildpackage -b --no-sign
|
|
|
|
mv ../*.{deb,buildinfo,changes} artifacts/
|
|
|
|
echo -e "\e[0Ksection_end:`date +%s`:debian_build\r\e[0K"
|
2022-10-16 16:55:31 +00:00
|
|
|
echo -e "\e[0Ksection_start:`date +%s`:flatpaks\e[0KBuilding Flatpak"
|
2022-10-16 17:24:18 +00:00
|
|
|
flatpak-builder flatpak flatpak_x64_manifest.yml --force-clean --repo=flatpakrepo
|
2023-10-21 17:31:10 +00:00
|
|
|
flatpak build-bundle flatpakrepo GridTracker-${VER}-x86_64.flatpak org.gridtracker.GridTracker
|
2022-10-16 15:24:54 +00:00
|
|
|
mv *.flatpak artifacts/
|
2022-10-16 14:31:20 +00:00
|
|
|
echo -e "\e[0Ksection_end:`date +%s`:flatpaks\r\e[0K"
|
2021-12-15 17:19:00 +00:00
|
|
|
echo "we made LINUX packages!"
|
|
|
|
ls -laR artifacts
|
|
|
|
|
|
|
|
mac:package:
|
|
|
|
stage: package
|
|
|
|
rules:
|
|
|
|
# only do this with a manual tag starting with v or test_
|
|
|
|
- if: '$CI_COMMIT_TAG =~ /^(v|test_).*/'
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- artifacts/
|
|
|
|
name: '$CI_COMMIT_REF_SLUG'
|
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- .cache/
|
|
|
|
- node_modules/
|
|
|
|
key:
|
|
|
|
files:
|
|
|
|
- package.json
|
|
|
|
- package.nw/package.json
|
|
|
|
before_script:
|
2021-03-09 04:49:44 +00:00
|
|
|
- |
|
2021-12-15 17:19:00 +00:00
|
|
|
mkdir -p $NPM_CONFIG_CACHE
|
|
|
|
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
|
|
|
|
echo -e "\e[0Ksection_end:`date +%s`:apt_get\r\e[0K"
|
|
|
|
script:
|
2021-03-15 17:02:13 +00:00
|
|
|
- |
|
2021-12-15 17:19:00 +00:00
|
|
|
# Making our MacOS packages
|
|
|
|
test `node version.js` = `dpkg-parsechangelog -S version` || (echo "package.nw/package.json and debian/changelog version mismatch"; exit 1)
|
|
|
|
echo -e "\e[0Ksection_start:`date +%s`:native_build\r\e[0KBuilding native packages"
|
|
|
|
npm install --prefer-offline
|
|
|
|
npm run dist-mac
|
|
|
|
(cd dist; mv *.zip ../artifacts/)
|
|
|
|
echo -e "\e[0Ksection_end:`date +%s`:native_build\e[0K"
|
|
|
|
echo "we made MAC packages!"
|
2021-03-15 17:02:13 +00:00
|
|
|
ls -laR artifacts
|
|
|
|
|
2021-12-15 17:19:00 +00:00
|
|
|
arm:package:
|
2021-03-15 17:02:13 +00:00
|
|
|
stage: package
|
2021-09-27 18:04:00 +00:00
|
|
|
variables:
|
|
|
|
NWJS_VERSION: "v0.54.2"
|
|
|
|
NWJS32_BUILD: "nw54_2021-07-09"
|
|
|
|
NWJS64_BUILD: "nw54-arm64_2021-07-10"
|
2021-03-15 17:02:13 +00:00
|
|
|
rules:
|
|
|
|
# only do this with a manual tag starting with v or test_
|
|
|
|
- if: '$CI_COMMIT_TAG =~ /^(v|test_).*/'
|
|
|
|
artifacts:
|
|
|
|
paths:
|
|
|
|
- artifacts/
|
|
|
|
name: '$CI_COMMIT_REF_SLUG'
|
|
|
|
cache:
|
|
|
|
paths:
|
|
|
|
- .cache/
|
|
|
|
- node_modules/
|
|
|
|
key:
|
|
|
|
files:
|
|
|
|
- package.json
|
|
|
|
- package.nw/package.json
|
2021-12-15 17:19:00 +00:00
|
|
|
before_script:
|
2021-03-15 17:02:13 +00:00
|
|
|
- |
|
2021-12-15 17:19:00 +00:00
|
|
|
mkdir -p $NPM_CONFIG_CACHE
|
|
|
|
mkdir -p artifacts
|
|
|
|
#dpkg --add-architecture armhf
|
2021-03-15 17:02:13 +00:00
|
|
|
echo -e "\e[0Ksection_start:`date +%s`:apt_get[collapsed=true]\r\e[0KGetting Build Dependencies"
|
2021-12-15 17:19:00 +00:00
|
|
|
apt-get update && apt-get upgrade -y
|
|
|
|
apt-get build-dep .
|
2022-10-16 15:34:46 +00:00
|
|
|
apt-get install flatpak flatpak-builder -y
|
2022-10-16 15:44:22 +00:00
|
|
|
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
|
2022-10-16 15:24:54 +00:00
|
|
|
flatpak install org.freedesktop.Sdk//22.08 -y
|
2022-10-16 15:56:41 +00:00
|
|
|
flatpak install org.freedesktop.Platform//22.08 -y
|
2021-03-15 17:02:13 +00:00
|
|
|
echo -e "\e[0Ksection_end:`date +%s`:apt_get\r\e[0K"
|
2021-12-15 17:19:00 +00:00
|
|
|
script:
|
2021-03-15 17:02:13 +00:00
|
|
|
- |
|
2021-12-15 17:19:00 +00:00
|
|
|
# This is for ARM 32 arch build
|
|
|
|
test `node version.js` = `dpkg-parsechangelog -S version` || (echo "package.nw/package.json and debian/changelog version mismatch"; exit 1)
|
2023-10-21 17:31:10 +00:00
|
|
|
VER=`node version.js`
|
2022-10-16 17:39:05 +00:00
|
|
|
echo "Getting Upstream NWJS arm32 Binary"
|
2022-10-16 17:08:32 +00:00
|
|
|
wget -q https://github.com/LeonardLaszlo/nw.js-armv7-binaries/releases/download/$NWJS32_BUILD/$NWJS32_BUILD.tar.gz
|
2022-10-16 18:00:31 +00:00
|
|
|
echo "Extracting $NWJS32_BUILD.tar.gz...."
|
2021-09-27 18:04:00 +00:00
|
|
|
tar -xf $NWJS32_BUILD.tar.gz
|
2022-10-16 16:38:30 +00:00
|
|
|
rm $NWJS32_BUILD.tar.gz
|
2022-10-16 18:00:31 +00:00
|
|
|
echo "Extracting $nwjs-$NWJS_VERSION-linux-arm.tar.gz..."
|
2021-09-27 18:04:00 +00:00
|
|
|
tar -xf usr/docker/dist/nwjs-chromium-ffmpeg-branding/nwjs-$NWJS_VERSION-linux-arm.tar.gz
|
2022-10-16 16:38:30 +00:00
|
|
|
rm -rf usr/
|
2022-10-16 18:00:31 +00:00
|
|
|
echo "Removing unused locales/*.info files..."
|
2021-09-27 18:04:00 +00:00
|
|
|
rm nwjs-$NWJS_VERSION-linux-arm/locales/*.info
|
2022-10-16 18:00:31 +00:00
|
|
|
echo "Merging $nwjs-$NWJS_VERSION-linux-arm binary with GridTracker..."
|
2021-09-27 18:04:00 +00:00
|
|
|
mv nwjs-$NWJS_VERSION-linux-arm/nw nwjs-$NWJS_VERSION-linux-arm/GridTracker
|
2021-03-15 17:02:13 +00:00
|
|
|
version=`node ./version.js`
|
2023-10-21 17:31:10 +00:00
|
|
|
mkdir GridTracker-${VER}-linux-arm32
|
|
|
|
cp -r nwjs-$NWJS_VERSION-linux-arm/* GridTracker-${VER}-linux-arm32/
|
|
|
|
cp -r arm/* GridTracker-${VER}-linux-arm32/
|
|
|
|
cp -r package.nw GridTracker-${VER}-linux-arm32/
|
|
|
|
cp LICENSE GridTracker-${VER}-linux-arm32/
|
|
|
|
echo "Compressing GridTracker-${VER}-linux-arm32.tar.gz..."
|
|
|
|
tar -czf GridTracker-${VER}-linux-arm32.tar.gz GridTracker-${VER}-linux-arm32
|
|
|
|
mv GridTracker-${VER}-linux-arm32.tar.gz artifacts/
|
|
|
|
echo "GridTracker-${VER}-linux-arm32.tar.gz built."
|
2022-10-16 16:38:30 +00:00
|
|
|
rm -rf nwjs-$NWJS_VERSION-linux-arm
|
2021-12-15 17:19:00 +00:00
|
|
|
# This is for ARM 64 arch build
|
2022-10-16 17:39:05 +00:00
|
|
|
echo "Getting Upstream NWJS arm64 Binary"
|
2022-10-16 17:08:32 +00:00
|
|
|
wget -q https://github.com/LeonardLaszlo/nw.js-armv7-binaries/releases/download/$NWJS64_BUILD/$NWJS64_BUILD.tar.gz
|
2022-10-16 18:00:31 +00:00
|
|
|
echo "Extracting $NWJS64_BUILD.tar.gz...."
|
2021-09-27 18:04:00 +00:00
|
|
|
tar -xf $NWJS64_BUILD.tar.gz
|
2022-10-16 16:38:30 +00:00
|
|
|
rm $NWJS64_BUILD.tar.gz
|
2022-10-16 18:00:31 +00:00
|
|
|
echo "Extracting $nwjs-$NWJS_VERSION-linux-arm64.tar.gz..."
|
2021-09-27 18:04:00 +00:00
|
|
|
tar -xf usr/docker/dist/nwjs-chromium-ffmpeg-branding/nwjs-$NWJS_VERSION-linux-arm64.tar.gz
|
2022-10-16 16:38:30 +00:00
|
|
|
rm -rf usr
|
2022-10-16 18:00:31 +00:00
|
|
|
echo "Removing unused locales/*.info files..."
|
2021-09-27 18:04:00 +00:00
|
|
|
rm nwjs-$NWJS_VERSION-linux-arm64/locales/*.info
|
2022-10-16 18:00:31 +00:00
|
|
|
echo "Merging $nwjs-$NWJS_VERSION-linux-arm64 binary with GridTracker..."
|
2021-09-27 18:04:00 +00:00
|
|
|
mv nwjs-$NWJS_VERSION-linux-arm64/nw nwjs-$NWJS_VERSION-linux-arm64/GridTracker
|
2023-10-21 16:33:48 +00:00
|
|
|
VER=`node version.js`
|
|
|
|
mkdir GridTracker-${VER}-linux-arm64
|
|
|
|
cp -r nwjs-$NWJS_VERSION-linux-arm64/* GridTracker-${VER}-linux-arm64/
|
|
|
|
cp -r arm/* GridTracker-${VER}-linux-arm64/
|
|
|
|
cp -r package.nw GridTracker-${VER}-linux-arm64/
|
|
|
|
cp LICENSE GridTracker-${VER}-linux-arm64/
|
|
|
|
echo "Compressing GridTracker-${VER}-linux-arm64.tar.gz..."
|
|
|
|
tar -czf GridTracker-${VER}-linux-arm64.tar.gz GridTracker-${VER}-linux-arm64
|
|
|
|
mv GridTracker-${VER}-linux-arm64.tar.gz artifacts/
|
|
|
|
echo "GridTracker-${VER}-linux-arm32.tar.gz built."
|
2022-10-16 16:38:30 +00:00
|
|
|
rm -rf nwjs-$NWJS-VERSION-linux-arm64
|
2022-10-16 19:46:49 +00:00
|
|
|
# This is for ARM 64 Flatpaks
|
2022-10-16 18:00:31 +00:00
|
|
|
echo -e "\e[0Ksection_start:`date +%s`:flatpaks[collapsed=true]\r\e[0KBuilding Flatpak"
|
|
|
|
echo "Creating workdir..."
|
2022-10-16 18:25:19 +00:00
|
|
|
mkdir -p dist
|
2023-10-21 16:33:48 +00:00
|
|
|
echo "Copying GridTracker-${VER}-linux-arm64 to workdir..."
|
|
|
|
mv GridTracker-${VER}-linux-arm64 dist/
|
|
|
|
cp dist/GridTracker-${VER}-linux-arm64/package.nw/gridview.png dist/GridTracker-${VER}-linux-arm64/gridview.png
|
2022-10-16 18:00:31 +00:00
|
|
|
echo "Building flatpak source..."
|
2022-10-16 17:24:18 +00:00
|
|
|
flatpak-builder flatpak flatpak_arm64_manifest.yml --force-clean --repo=flatpakrepo
|
2022-10-16 18:00:31 +00:00
|
|
|
echo "Exporting single-file flatpak..."
|
2023-10-21 16:33:48 +00:00
|
|
|
flatpak build-bundle flatpakrepo GridTracker-${VER}-arm64.flatpak org.gridtracker.GridTracker
|
2022-10-16 15:24:54 +00:00
|
|
|
mv *.flatpak artifacts/
|
2022-10-16 18:00:31 +00:00
|
|
|
echo -e "\e[0Ksection_end:`date +%s`:flatpaks\r\e[0K"
|
2021-12-15 17:19:00 +00:00
|
|
|
echo "we made ARM packages!"
|
2021-03-15 17:02:13 +00:00
|
|
|
ls -laR artifacts
|
|
|
|
|
2022-05-02 02:47:01 +00:00
|
|
|
# copy test assets to Google Storage
|
|
|
|
upload-Google:
|
2021-03-15 17:02:13 +00:00
|
|
|
stage: deploy
|
2022-05-02 02:47:01 +00:00
|
|
|
image: google/cloud-sdk
|
2021-09-27 18:04:00 +00:00
|
|
|
variables:
|
|
|
|
GIT_STRATEGY: none
|
2021-03-15 17:02:13 +00:00
|
|
|
rules:
|
2022-05-02 02:47:01 +00:00
|
|
|
- if: '$CI_COMMIT_TAG =~ /^(v|test_).*/'
|
2021-03-15 17:02:13 +00:00
|
|
|
script:
|
|
|
|
- |
|
2022-05-02 02:47:01 +00:00
|
|
|
echo $GCP_SERVICE_KEY > gcloud-service-key.json
|
|
|
|
gcloud auth activate-service-account --key-file gcloud-service-key.json
|
|
|
|
gcloud config set project $GCLOUD_PROJECT_ID
|
|
|
|
gsutil -m cp -R artifacts/* $GCLOUD_DEPLOY_PATH/
|
2020-11-11 18:00:15 +00:00
|
|
|
|
2021-12-15 17:19:00 +00:00
|
|
|
update_arch_aur:
|
|
|
|
stage: deploy
|
|
|
|
image: archlinux:base-devel
|
|
|
|
rules:
|
|
|
|
# only do this with a manual tag starting with v
|
|
|
|
- if: '$CI_COMMIT_TAG =~ /^v.*/ && $AUR_KEY != ""'
|
2022-10-14 22:35:59 +00:00
|
|
|
# Allow AUR to fail without failing the whole pipeline
|
|
|
|
allow_failure: true
|
2021-12-15 17:19:00 +00:00
|
|
|
before_script:
|
|
|
|
- |
|
|
|
|
pacman -Sy; pacman -S --needed --noconfirm openssh git
|
|
|
|
eval $(ssh-agent -s)
|
|
|
|
echo "$AUR_KEY" | tr -d '\r' | ssh-add -
|
|
|
|
mkdir -p ~/.ssh; chmod 700 ~/.ssh
|
|
|
|
git config --global user.name "nr0q"
|
|
|
|
git config --global user.email "nr0q@gridtracker.org"
|
|
|
|
script:
|
|
|
|
# generate the PKGBUILD
|
|
|
|
- |
|
|
|
|
cd arch-linux
|
|
|
|
curl -o gridtracker.tar.gz "https://gitlab.com/gridtracker.org/gridtracker/-/archive/${CI_COMMIT_TAG}/gridtracker-${CI_COMMIT_TAG}.tar.gz"
|
|
|
|
SHASUM=$(sha256sum gridtracker.tar.gz | cut -d ' ' -f1)
|
|
|
|
sed "s/REPLACE_WITH_VERSION/${CI_COMMIT_TAG#v}/;s/REPLACE_WITH_SHASUM/${SHASUM}/" PKGBUILD.template > PKGBUILD
|
|
|
|
# test that it builds
|
|
|
|
- |
|
|
|
|
useradd builder -m
|
|
|
|
passwd -d builder
|
|
|
|
printf 'builder ALL=(ALL) ALL\n' | tee -a /etc/sudoers
|
|
|
|
# build nwjs-bin
|
|
|
|
sudo -u builder bash -c 'git clone https://aur.archlinux.org/nwjs-bin.git nwjs-bin && cd nwjs-bin && makepkg -si --noconfirm'
|
|
|
|
# build gridtracker
|
|
|
|
sudo -u builder makepkg -si --noconfirm PKGBUILD
|
|
|
|
# push the new version
|
|
|
|
- |
|
2022-01-15 21:56:07 +00:00
|
|
|
sudo -u builder makepkg --printsrcinfo > .SRCINFO
|
2021-12-15 17:19:00 +00:00
|
|
|
git clone ssh://aur@aur.archlinux.org/gridtracker.git
|
|
|
|
cp PKGBUILD gridtracker/PKGBUILD
|
|
|
|
cp .SRCINFO gridtracker/.SRCINFO
|
|
|
|
cd gridtracker
|
|
|
|
git add PKGBUILD .SRCINFO && git commit -m "upgpkg: gridtracker ${CI_COMMIT_TAG#v}" && git push
|
|
|
|
|
2023-10-21 01:34:08 +00:00
|
|
|
# this only creates a "source code release" -- gitlab doesn't specify binaries
|
|
|
|
# except as links to external storage, which is suboptimal for now
|
|
|
|
|
|
|
|
sourcerelease:
|
|
|
|
stage: publish
|
|
|
|
image: registry.gitlab.com/gitlab-org/release-cli:latest
|
|
|
|
variables:
|
|
|
|
GIT_STRATEGY: none
|
|
|
|
rules:
|
|
|
|
- if: '$CI_COMMIT_TAG =~ /^(v).*/'
|
|
|
|
release:
|
|
|
|
tag_name: $CI_COMMIT_TAG
|
|
|
|
name: GridTracker $CI_COMMIT_TAG
|
|
|
|
description: GridTracker release $CI_COMMIT_TAG
|
|
|
|
ref: '$CI_COMMIT_SHA'
|
|
|
|
assets:
|
|
|
|
links:
|
|
|
|
- name: Windows Package for $CI_COMMIT_TAG
|
|
|
|
url: https://downloads.gridtracker.org/$CI_COMMIT_TAG/GridTracker-Installer.${CI_COMMIT_TAG#v}.exe
|
|
|
|
external: true
|
|
|
|
link_type: package
|
|
|
|
- name: Mac x64 ZIP Package for $CI_COMMIT_TAG
|
|
|
|
url: https://downloads.gridtracker.org/$CI_COMMIT_TAG/GridTracker-${CI_COMMIT_TAG#v}-mac-x64.zip
|
|
|
|
external: true
|
|
|
|
link_type: package
|
|
|
|
- name: Linux Arm32 GZIP Package for $CI_COMMIT_TAG
|
|
|
|
url: https://downloads.gridtracker.org/$CI_COMMIT_TAG/GridTracker-${CI_COMMIT_TAG#v}-linux-arm32.tar.gz
|
|
|
|
external: true
|
|
|
|
link_type: package
|
|
|
|
- name: Linux Arm64 GZIP Package for $CI_COMMIT_TAG
|
|
|
|
url: https://downloads.gridtracker.org/$CI_COMMIT_TAG/GridTracker-${CI_COMMIT_TAG#v}-linux-arm64.tar.gz
|
|
|
|
external: true
|
|
|
|
link_type: package
|
|
|
|
- name: Linux x86 GZIP Package for $CI_COMMIT_TAG
|
|
|
|
url: https://downloads.gridtracker.org/$CI_COMMIT_TAG/GridTracker-${CI_COMMIT_TAG#v}-linux-x86.tar.gz
|
|
|
|
external: true
|
|
|
|
link_type: package
|
|
|
|
- name: Linux x64 GZIP Package for $CI_COMMIT_TAG
|
|
|
|
url: https://downloads.gridtracker.org/$CI_COMMIT_TAG/GridTracker-${CI_COMMIT_TAG#v}-linux-x64.tar.gz
|
|
|
|
external: true
|
|
|
|
link_type: package
|
|
|
|
- name: Debian Linux Package for $CI_COMMIT_TAG
|
|
|
|
url: https://downloads.gridtracker.org/$CI_COMMIT_TAG/gridtracker-${CI_COMMIT_TAG#v}_all.deb
|
|
|
|
external: true
|
|
|
|
link_type: package
|
2023-10-21 16:33:48 +00:00
|
|
|
- name: Linux x86 Flatpak package for $CI_COMMIT_TAG
|
|
|
|
url: https://downloads.gridtracker.org/$CI_COMMIT_TAG/GridTracker-${CI_COMMIT_TAG#v}-x86_64.flatpak
|
|
|
|
external: true
|
|
|
|
- name: Linux ARM64 Flatpak package for $CI_COMMIT_TAG
|
|
|
|
url: https://downloads.gridtracker.org/$CI_COMMIT_TAG/GridTracker-${CI_COMMIT_TAG#v}-arm64.flatpak
|
|
|
|
external: true
|
2023-10-21 01:34:08 +00:00
|
|
|
script:
|
|
|
|
- echo 'Release for $CI_COMMIT_TAG'
|
|
|
|
|
|
|
|
virustotal_push:
|
|
|
|
stage: publish
|
|
|
|
rules:
|
2023-10-21 01:40:29 +00:00
|
|
|
- if: '$CI_COMMIT_TAG =~ /^(v|test_).*/'
|
2023-10-21 01:34:08 +00:00
|
|
|
script:
|
|
|
|
- |
|
|
|
|
echo "Pushing release URLs to VirusTotal"
|
2023-10-21 01:55:40 +00:00
|
|
|
VER=`node version.js`
|
2023-10-21 02:57:21 +00:00
|
|
|
BASEURL="http://downloads.gridtracker.org/${CI_COMMIT_TAG}/"
|
2023-10-21 02:29:04 +00:00
|
|
|
curl --request POST --url "https://www.virustotal.com/api/v3/urls" --form url="${BASEURL}GridTracker-Installer.${VER}.exe" --header "x-apikey: ${VT_API_KEY}"
|
2023-10-21 01:34:08 +00:00
|
|
|
|
|
|
|
discord_notify:
|
|
|
|
stage: publish
|
|
|
|
rules:
|
2023-10-21 01:40:29 +00:00
|
|
|
- if: '$CI_COMMIT_TAG =~ /^(v|test_).*/'
|
2023-10-21 01:34:08 +00:00
|
|
|
script:
|
|
|
|
- |
|
|
|
|
echo "Notifying Discord #developer-den that a release has built"
|
2023-10-21 02:57:21 +00:00
|
|
|
BASEURL="http://downloads.gridtracker.org/${CI_COMMIT_TAG}/"
|
2023-10-21 02:52:03 +00:00
|
|
|
VER=`node version.js`
|
2023-10-21 01:55:40 +00:00
|
|
|
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))
|
2023-10-21 16:33:48 +00:00
|
|
|
FLATx64_MD5=($(md5sum artifacts/GridTracker-${VER}-x86_64.flatpak))
|
|
|
|
FLATARM64_MD5=($(md5sum artifacts/GridTracker-${VER}-arm64.flatpak))
|
2023-10-21 01:34:08 +00:00
|
|
|
curl -H "Content-Type: application/json" -X POST $DISCORD_WEBHOOK --data-binary @- << EOM
|
|
|
|
{
|
2023-10-21 16:33:48 +00:00
|
|
|
"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",
|
2023-10-21 01:34:08 +00:00
|
|
|
"tts": false,
|
|
|
|
"embeds": [],
|
|
|
|
"components": {},
|
|
|
|
"username": "GridTracker Release Bot",
|
|
|
|
"avatar_url": "http://gridtracker.org/images/icons/gridtracker32.png"
|
|
|
|
}
|
|
|
|
EOM
|
|
|
|
echo "Discord notified"
|