matrixion/.gitlab-ci.yml

263 lines
8.5 KiB
YAML
Raw Permalink Normal View History

2020-05-01 02:27:27 +03:00
variables:
CCACHE_COMPILERCHECK: content
CCACHE_DIR: "${CI_PROJECT_DIR}/.ccache"
# prevent configure tzdata hanging apt install commands
DEBIAN_FRONTEND: noninteractive
2021-12-12 02:38:59 +03:00
stages:
- prepare
- build
- deploy
prepare-gcc9-image:
stage: prepare
image:
name: gcr.io/kaniko-project/executor:debug
entrypoint: [""]
tags: [docker]
rules:
- if: $CI_COMMIT_BRANCH
changes:
- .ci/gcc-9/Dockerfile
script:
- mkdir -p /kaniko/.docker
- echo "{\"auths\":{\"$CI_REGISTRY\":{\"username\":\"$CI_REGISTRY_USER\",\"password\":\"$CI_REGISTRY_PASSWORD\"}}}" > /kaniko/.docker/config.json
- /kaniko/executor --whitelist-var-run=false --context $CI_PROJECT_DIR/.ci/gcc-9 --dockerfile $CI_PROJECT_DIR/.ci/gcc-9/Dockerfile --destination $CI_REGISTRY_IMAGE/gcc-9:latest
build-gcc9-meson:
stage: build
image: $CI_REGISTRY_IMAGE/gcc-9:latest
tags: [docker]
needs:
- job: prepare-gcc9-image
optional: true
variables:
QT_PKG: 515
TRAVIS_OS_NAME: linux
GIT_SUBMODULE_STRATEGY: normal
2021-12-12 02:38:59 +03:00
before_script:
- . "/opt/qt${QT_PKG}/bin/qt${QT_PKG}-env.sh" || true
script:
- meson setup builddir
- meson compile -C builddir
cache:
2021-12-23 07:57:44 +03:00
key: "$CI_JOB_NAME"
2021-12-12 04:30:39 +03:00
when: 'always'
2021-12-12 02:38:59 +03:00
paths:
- .ccache
- subprojects/packagecache/
2021-12-12 02:38:59 +03:00
2021-11-18 05:10:04 +03:00
build-gcc9:
2020-05-01 02:27:27 +03:00
stage: build
2021-12-12 02:38:59 +03:00
image: $CI_REGISTRY_IMAGE/gcc-9:latest
2020-05-01 02:27:27 +03:00
tags: [docker]
2021-12-12 02:38:59 +03:00
needs:
- job: prepare-gcc9-image
optional: true
2020-05-01 02:27:27 +03:00
variables:
2021-07-12 01:49:58 +03:00
QT_PKG: 515
2020-05-01 02:27:27 +03:00
TRAVIS_OS_NAME: linux
before_script:
2021-11-18 05:28:26 +03:00
- wget https://github.com/Kitware/CMake/releases/download/v3.19.0/cmake-3.19.0-Linux-x86_64.sh && sh cmake-3.19.0-Linux-x86_64.sh --skip-license --prefix=/usr/local
2021-06-30 13:45:41 +03:00
- rm -rf ../.hunter && mv .hunter ../.hunter || true
2021-12-12 02:38:59 +03:00
- . "/opt/qt${QT_PKG}/bin/qt${QT_PKG}-env.sh" || true
2020-05-01 02:27:27 +03:00
script:
2021-11-18 05:28:26 +03:00
- export PATH="/usr/local/bin/:/usr/lib/ccache:${PATH}"
2020-05-01 02:27:27 +03:00
- export CMAKE_BUILD_PARALLEL_LEVEL=$(cat /proc/cpuinfo | awk '/^processor/{print $3}' | wc -l)
- cmake -GNinja -H. -Bbuild
-DCMAKE_INSTALL_PREFIX=.deps/usr
2021-06-30 13:45:41 +03:00
-DHUNTER_ROOT="../.hunter"
-DHUNTER_ENABLED=ON -DBUILD_SHARED_LIBS=OFF -DUSE_BUNDLED_OPENSSL=ON -DUSE_BUNDLED_LMDB=OFF
-DVOIP=OFF
2020-05-01 02:27:27 +03:00
-DCMAKE_BUILD_TYPE=Release -DHUNTER_CONFIGURATION_TYPES=Release
2021-11-18 05:28:26 +03:00
-DCI_BUILD=ON -DFETCHCONTENT_QUIET=OFF
2020-05-01 02:27:27 +03:00
- cmake --build build
2021-06-30 13:45:41 +03:00
after_script:
- mv ../.hunter .hunter
2020-05-01 02:27:27 +03:00
cache:
key: "$CI_JOB_NAME"
2021-12-12 04:30:39 +03:00
when: 'always'
2020-05-01 02:27:27 +03:00
paths:
- .hunter/
- .ccache
build-macos:
stage: build
tags: [macos]
before_script:
2021-08-05 01:00:37 +03:00
#- brew update
#- brew reinstall --force python3
#- brew bundle --file=./.ci/macos/Brewfile --force --cleanup
2021-06-30 13:45:41 +03:00
- rm -rf ../.hunter && mv .hunter ../.hunter || true
2021-12-12 02:38:59 +03:00
needs: []
2020-05-01 02:27:27 +03:00
script:
2021-08-06 05:22:47 +03:00
- export PATH=/usr/local/opt/qt@5/bin/:${PATH}
- export CMAKE_PREFIX_PATH=/usr/local/opt/qt@5
2020-05-01 02:27:27 +03:00
- cmake -GNinja -H. -Bbuild
-DCMAKE_BUILD_TYPE=RelWithDebInfo
-DCMAKE_INSTALL_PREFIX=.deps/usr
2021-06-30 13:45:41 +03:00
-DHUNTER_ROOT="../.hunter"
2020-05-01 02:27:27 +03:00
-DHUNTER_ENABLED=ON -DBUILD_SHARED_LIBS=OFF
-DCMAKE_BUILD_TYPE=RelWithDebInfo -DHUNTER_CONFIGURATION_TYPES=RelWithDebInfo
-DUSE_BUNDLED_OPENSSL=ON
-DUSE_BUNDLED_BOOST=ON
-DCI_BUILD=ON
- cmake --build build
- (cd build && git clone https://github.com/Nheko-Reborn/qt-jdenticon.git && cd qt-jdenticon && qmake && make -j 4 && cp libqtjdenticon.dylib ../nheko.app/Contents/MacOS)
2020-12-08 23:34:07 +03:00
after_script:
2021-06-30 13:45:41 +03:00
- mv ../.hunter .hunter
2020-12-08 23:34:07 +03:00
artifacts:
paths:
2021-09-03 21:53:31 +03:00
- build/nheko.app
name: nheko-${CI_COMMIT_SHORT_SHA}-macos-app
expose_as: 'macos-app'
public: false
2020-05-01 02:27:27 +03:00
cache:
key: "${CI_JOB_NAME}"
2021-12-12 04:30:39 +03:00
when: 'always'
2020-05-01 02:27:27 +03:00
paths:
- .hunter/
- "${CCACHE_DIR}"
2021-12-24 04:31:44 +03:00
build-macos-meson:
stage: build
tags: [macos]
needs: []
variables:
GIT_SUBMODULE_STRATEGY: normal
script:
- export PATH=/usr/local/opt/qt@5/bin/:${PATH}
2021-12-24 05:13:49 +03:00
- meson setup --prefix=${PWD}/build/nheko.app --bindir=Contents/MacOS --buildtype=debugoptimized build
2021-12-24 04:31:44 +03:00
- meson compile -C build
- meson install --skip-subprojects -C build
artifacts:
paths:
- build/nheko.app
name: nheko-${CI_COMMIT_SHORT_SHA}-macos-app
expose_as: 'macos-app'
public: false
cache:
key: "$CI_JOB_NAME"
when: 'always'
paths:
- .ccache
- subprojects/packagecache/
2021-09-03 21:53:31 +03:00
codesign-macos:
stage: deploy
tags: [macos]
before_script:
- pip3 install dmgbuild
script:
- export PATH=/usr/local/opt/qt@5/bin/:${PATH}
- ./.ci/macos/notarize.sh
after_script:
- ./.ci/upload-nightly-gitlab.sh artifacts/nheko-${CI_COMMIT_SHORT_SHA}.dmg
needs:
2021-12-24 04:35:06 +03:00
- build-macos-meson
2021-09-03 21:53:31 +03:00
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
- if : $CI_COMMIT_TAG
artifacts:
paths:
- artifacts/nheko-${CI_COMMIT_SHORT_SHA}.dmg
name: nheko-${CI_COMMIT_SHORT_SHA}-macos
expose_as: 'macos-dmg'
2020-05-01 02:27:27 +03:00
build-flatpak-amd64:
stage: build
image: ubuntu:latest
#image: 'registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master'
tags: [docker]
2021-12-12 02:38:59 +03:00
needs: []
2020-05-01 02:27:27 +03:00
before_script:
2021-08-07 02:38:46 +03:00
# need flatpak 1.11.1 at least
- apt-get update && apt-get install -y software-properties-common
- add-apt-repository ppa:alexlarsson/flatpak && apt-get update && apt-get -y install flatpak-builder git python curl python3-aiohttp python3-tenacity gir1.2-ostree-1.0
2020-05-01 02:27:27 +03:00
- flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
- flatpak --noninteractive install --user flathub org.kde.Platform//5.15
- flatpak --noninteractive install --user flathub org.kde.Sdk//5.15
2020-05-01 02:27:27 +03:00
script:
- export VERSION=$(git describe)
- mkdir -p build-flatpak
- cd build-flatpak
- flatpak-builder --user --disable-rofiles-fuse --ccache --repo=repo --default-branch=${CI_COMMIT_REF_NAME//\//_} --subject="Build of Nheko ${VERSION} `date`" app ../io.github.NhekoReborn.Nheko.yaml
2021-01-11 01:45:10 +03:00
- flatpak build-bundle repo nheko-amd64.flatpak io.github.NhekoReborn.Nheko ${CI_COMMIT_REF_NAME//\//_}
2020-05-01 02:27:27 +03:00
after_script:
2021-02-23 21:26:26 +03:00
- (cd ./scripts && ./upload-to-flatpak-repo.sh ../build-flatpak/repo) || true
2020-05-01 02:27:27 +03:00
- bash ./.ci/upload-nightly-gitlab.sh build-flatpak/nheko-amd64.flatpak
cache:
key: "$CI_JOB_NAME"
2021-12-12 04:30:39 +03:00
when: 'always'
2020-05-01 02:27:27 +03:00
paths:
- build-flatpak/.flatpak-builder/
artifacts:
expose_as: 'flatpak-amd64'
paths: ['build-flatpak/nheko-amd64.flatpak']
name: flatpak-${CI_COMMIT_REF_NAME}-${VERSION}-amd64
build-flatpak-arm64:
stage: build
image: ubuntu:latest
#image: 'registry.gitlab.gnome.org/gnome/gnome-runtime-images/gnome:master'
tags: [docker-arm64]
2021-12-12 02:38:59 +03:00
needs: []
2020-05-01 02:27:27 +03:00
before_script:
2021-08-07 02:38:46 +03:00
# need flatpak 1.11.1 at least
- apt-get update && apt-get install -y software-properties-common
- add-apt-repository ppa:alexlarsson/flatpak && apt-get update && apt-get -y install flatpak-builder git python curl python3-aiohttp python3-tenacity gir1.2-ostree-1.0
2020-05-01 02:27:27 +03:00
- flatpak remote-add --user --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
- flatpak --noninteractive install --user flathub org.kde.Platform//5.15
- flatpak --noninteractive install --user flathub org.kde.Sdk//5.15
2020-05-01 02:27:27 +03:00
script:
- export VERSION=$(git describe)
- mkdir -p build-flatpak
- cd build-flatpak
- flatpak-builder --user --disable-rofiles-fuse --ccache --repo=repo --default-branch=${CI_COMMIT_REF_NAME//\//_} --subject="Build of Nheko ${VERSION} `date` for arm64" app ../io.github.NhekoReborn.Nheko.yaml
2021-01-11 01:45:10 +03:00
- flatpak build-bundle repo nheko-arm64.flatpak io.github.NhekoReborn.Nheko ${CI_COMMIT_REF_NAME//\//_}
2020-05-01 02:27:27 +03:00
after_script:
2021-02-23 21:26:26 +03:00
- (cd ./scripts && ./upload-to-flatpak-repo.sh ../build-flatpak/repo) || true
2020-05-01 02:27:27 +03:00
- bash ./.ci/upload-nightly-gitlab.sh build-flatpak/nheko-arm64.flatpak
cache:
key: "$CI_JOB_NAME"
2021-12-12 04:30:39 +03:00
when: 'always'
2020-05-01 02:27:27 +03:00
paths:
- build-flatpak/.flatpak-builder/
artifacts:
expose_as: 'flatpak-arm64'
paths: ['build-flatpak/nheko-arm64.flatpak']
name: flatpak-${CI_COMMIT_REF_NAME}-${VERSION}-arm64
2021-12-16 07:31:14 +03:00
build-windows-meson:
stage: build
image: win10-base
tags: [windows]
variables:
BUILD: ${CI_BUILDS_DIR}
GIT_SUBMODULE_STRATEGY: normal
2021-12-16 07:31:14 +03:00
script:
- PATH=${PATH##/usr/local/bin:/usr/bin:/bin:} ./.ci/windows/build-meson.cmd
- ls -la
after_script:
- PATH=${PATH##/usr/local/bin:/usr/bin:/bin:} ./.ci/windows/deploy-meson.cmd
cache:
key: "$CI_JOB_NAME"
2021-12-23 07:57:44 +03:00
when: 'always'
2021-12-16 07:31:14 +03:00
paths:
- subprojects/packagecache/
2021-12-16 07:31:14 +03:00
2020-05-01 02:27:27 +03:00
linting:
stage: build
image: alpine:latest
tags: [docker]
2021-12-12 02:38:59 +03:00
needs: []
2020-05-01 02:27:27 +03:00
before_script:
2021-06-16 02:23:28 +03:00
- apk update && apk add clang-extra-tools make git python3 py3-pip
2021-03-05 02:35:15 +03:00
- export PATH="$PATH:/root/.local/bin"
- pip3 install --user reuse
2020-05-01 02:27:27 +03:00
script:
- make lint
2021-03-05 02:35:15 +03:00
- make license
2020-12-25 21:14:32 +03:00