2021-02-04 19:25:29 +00:00
|
|
|
stages:
|
|
|
|
- check
|
|
|
|
- test
|
2022-04-05 10:17:07 +00:00
|
|
|
- build
|
2022-01-19 15:28:54 +00:00
|
|
|
- doc
|
2022-03-30 14:42:23 +00:00
|
|
|
- deploy
|
2021-02-04 19:25:29 +00:00
|
|
|
|
2022-04-05 10:17:07 +00:00
|
|
|
variables:
|
|
|
|
FLATPAK_MODULE: "fractal"
|
|
|
|
RUNTIME_REPO: "https://nightly.gnome.org/gnome-nightly.flatpakrepo"
|
2022-08-03 10:11:57 +00:00
|
|
|
CI_IMAGE: "quay.io/gnome_infrastructure/gnome-runtime-images:gnome-master"
|
2022-07-07 16:58:40 +00:00
|
|
|
|
|
|
|
.hack:
|
|
|
|
variables:
|
|
|
|
MANIFEST_PATH: "build-aux/org.gnome.Fractal.Hack.json"
|
|
|
|
APP_ID: "org.gnome.Fractal.Hack"
|
2022-04-13 17:36:36 +00:00
|
|
|
|
2022-07-07 16:58:40 +00:00
|
|
|
.devel:
|
2022-04-13 17:36:36 +00:00
|
|
|
variables:
|
|
|
|
MANIFEST_PATH: "build-aux/org.gnome.Fractal.Devel.json"
|
|
|
|
APP_ID: "org.gnome.Fractal.Devel"
|
|
|
|
|
2022-07-07 16:58:40 +00:00
|
|
|
.build_template:
|
2022-07-29 07:46:20 +00:00
|
|
|
image: '${CI_IMAGE}'
|
2022-07-07 16:58:40 +00:00
|
|
|
script:
|
|
|
|
- >
|
|
|
|
xvfb-run -a -s "-screen 0 1024x768x24"
|
|
|
|
flatpak-builder --keep-build-dirs --user --disable-rofiles-fuse flatpak_app --repo=repo ${BRANCH:+--default-branch=$BRANCH} ${MANIFEST_PATH}
|
|
|
|
- flatpak build-bundle repo ${BUNDLE} --runtime-repo=${RUNTIME_REPO} ${APP_ID} ${BRANCH}
|
|
|
|
- mkdir logs
|
|
|
|
- mv .flatpak-builder/build/${FLATPAK_MODULE}/_flatpak_build/meson-logs/meson-log.txt logs/
|
|
|
|
- mv .flatpak-builder/build/${FLATPAK_MODULE}/_flatpak_build/meson-logs/testlog.txt logs/
|
|
|
|
- tar cf repo.tar repo/
|
|
|
|
artifacts:
|
|
|
|
name: 'Flatpak artifacts'
|
|
|
|
expose_as: 'Get Flatpak bundle here'
|
|
|
|
when: 'always'
|
|
|
|
paths:
|
|
|
|
- "${BUNDLE}"
|
|
|
|
- 'repo.tar'
|
|
|
|
- 'logs'
|
|
|
|
expire_in: 14 days
|
|
|
|
|
|
|
|
.build_x86_64:
|
|
|
|
extends: .build_template
|
|
|
|
tags:
|
|
|
|
- flatpak
|
|
|
|
|
|
|
|
.build_aarch64:
|
|
|
|
extends: .build_template
|
|
|
|
tags:
|
|
|
|
- flatpak-aarch64
|
|
|
|
|
|
|
|
.publish_nightly_template:
|
2022-07-29 07:46:20 +00:00
|
|
|
image: 'quay.io/gnome_infrastructure/gnome-runtime-images:flat-manager-client'
|
2022-07-07 16:58:40 +00:00
|
|
|
stage: 'deploy'
|
|
|
|
timeout: '100m'
|
|
|
|
script:
|
|
|
|
- tar xf repo.tar
|
|
|
|
- flatpak build-update-repo --generate-static-deltas repo/
|
|
|
|
- BUILD_ID=$(flat-manager-client create ${FLAT_MANAGER_URL} ${FLATPAK_REPO})
|
|
|
|
- flat-manager-client push --commit --publish --wait ${BUILD_ID} repo/ || result=$?
|
|
|
|
- flat-manager-client purge ${BUILD_ID}
|
|
|
|
- exit $result
|
|
|
|
variables:
|
|
|
|
FLAT_MANAGER_URL: https://flat-manager.gnome.org/
|
|
|
|
FLATPAK_REPO: nightly
|
|
|
|
only:
|
|
|
|
refs:
|
|
|
|
- main
|
|
|
|
variables:
|
|
|
|
- $REPO_TOKEN
|
|
|
|
|
2022-01-14 22:20:55 +00:00
|
|
|
# Configure and run code checks
|
|
|
|
# Exits and fails if an error is encountered
|
|
|
|
checks:
|
2022-01-20 08:08:11 +00:00
|
|
|
image: "rustlang/rust:nightly-slim"
|
2022-01-14 22:20:55 +00:00
|
|
|
stage: check
|
2021-02-04 19:25:29 +00:00
|
|
|
script:
|
2022-01-14 22:20:55 +00:00
|
|
|
- scripts/checks.sh --verbose --force-install
|
2021-04-24 15:08:53 +00:00
|
|
|
|
2022-04-05 10:17:07 +00:00
|
|
|
# Lint the code
|
2022-01-14 21:50:42 +00:00
|
|
|
cargo-clippy:
|
2022-07-07 16:58:40 +00:00
|
|
|
extends: .hack
|
2022-07-29 07:46:20 +00:00
|
|
|
image: '${CI_IMAGE}'
|
2022-01-18 00:04:36 +00:00
|
|
|
stage: check
|
2022-01-14 21:50:42 +00:00
|
|
|
tags:
|
|
|
|
- flatpak
|
|
|
|
script:
|
|
|
|
- flatpak-builder --keep-build-dirs --user --disable-rofiles-fuse --stop-at=${FLATPAK_MODULE} flatpak_app --repo=repo ${BRANCH:+--default-branch=$BRANCH} ${MANIFEST_PATH}
|
|
|
|
- echo "cargo clippy -- -D warnings" | flatpak-builder --disable-rofiles-fuse --build-shell=${FLATPAK_MODULE} flatpak_app ${MANIFEST_PATH}
|
|
|
|
|
2022-07-07 16:58:40 +00:00
|
|
|
# Build a debug version of the flatpak
|
|
|
|
# Except on main
|
|
|
|
flatpak:
|
|
|
|
extends:
|
|
|
|
- .hack
|
|
|
|
- .build_x86_64
|
|
|
|
stage: test
|
|
|
|
variables:
|
|
|
|
BUNDLE: "fractal-hack.flatpak"
|
|
|
|
except:
|
|
|
|
- main
|
|
|
|
|
|
|
|
# Build the nightly version of the flatpak
|
|
|
|
# Only on main
|
2022-04-08 15:20:19 +00:00
|
|
|
build-x86_64:
|
2022-04-13 17:36:36 +00:00
|
|
|
extends:
|
2022-07-07 16:58:40 +00:00
|
|
|
- .devel
|
|
|
|
- .build_x86_64
|
2022-04-08 15:20:19 +00:00
|
|
|
stage: build
|
|
|
|
variables:
|
2022-07-07 16:58:40 +00:00
|
|
|
MANIFEST_PATH: "build-aux/org.gnome.Fractal.Devel.json"
|
|
|
|
APP_ID: "org.gnome.Fractal.Devel"
|
2022-04-13 17:36:36 +00:00
|
|
|
BUNDLE: "fractal-devel-x86_64.flatpak"
|
2022-07-07 16:58:40 +00:00
|
|
|
only:
|
|
|
|
- main
|
2022-04-08 15:20:19 +00:00
|
|
|
build-aarch64:
|
2022-04-13 17:36:36 +00:00
|
|
|
extends:
|
2022-07-07 16:58:40 +00:00
|
|
|
- .devel
|
|
|
|
- .build_aarch64
|
2022-04-05 10:17:07 +00:00
|
|
|
stage: build
|
|
|
|
variables:
|
2022-07-07 16:58:40 +00:00
|
|
|
MANIFEST_PATH: "build-aux/org.gnome.Fractal.Devel.json"
|
|
|
|
APP_ID: "org.gnome.Fractal.Devel"
|
2022-04-13 17:36:36 +00:00
|
|
|
BUNDLE: "fractal-devel-aarch64.flatpak"
|
2022-07-07 16:58:40 +00:00
|
|
|
only:
|
|
|
|
- main
|
2022-04-05 10:17:07 +00:00
|
|
|
|
|
|
|
# Build the docs
|
|
|
|
# Only on main
|
2021-04-24 15:08:53 +00:00
|
|
|
pages:
|
2022-07-07 16:58:40 +00:00
|
|
|
extends: .devel
|
2022-07-29 07:46:20 +00:00
|
|
|
image: '${CI_IMAGE}'
|
2022-04-05 10:17:07 +00:00
|
|
|
stage: doc
|
|
|
|
tags:
|
|
|
|
- flatpak
|
2021-04-24 15:08:53 +00:00
|
|
|
script:
|
2022-09-03 07:58:01 +00:00
|
|
|
- flatpak install --user --noninteractive org.freedesktop.Sdk.Extension.rust-nightly//22.08
|
2022-05-12 11:13:37 +00:00
|
|
|
- sed -i 's|rust-stable|rust-nightly|g' ${MANIFEST_PATH}
|
2022-01-19 15:28:54 +00:00
|
|
|
- flatpak-builder --keep-build-dirs --user --disable-rofiles-fuse --stop-at=${FLATPAK_MODULE} flatpak_app --repo=repo ${BRANCH:+--default-branch=$BRANCH} ${MANIFEST_PATH}
|
|
|
|
- echo "ninja src/doc" | flatpak-builder --disable-rofiles-fuse --build-shell=${FLATPAK_MODULE} flatpak_app ${MANIFEST_PATH}
|
|
|
|
- mv .flatpak-builder/build/${FLATPAK_MODULE}/_flatpak_build/src/doc public
|
|
|
|
- chmod -R a=rwx public
|
2021-04-24 15:08:53 +00:00
|
|
|
artifacts:
|
|
|
|
paths:
|
2022-01-19 15:28:54 +00:00
|
|
|
- 'public'
|
2021-04-24 15:08:53 +00:00
|
|
|
only:
|
|
|
|
refs:
|
2022-03-31 09:58:32 +00:00
|
|
|
- main
|
2022-03-29 08:56:46 +00:00
|
|
|
|
2022-04-05 10:17:07 +00:00
|
|
|
# Publish the nightly version
|
|
|
|
# Only on main
|
2022-04-08 15:20:19 +00:00
|
|
|
publish_nightly-x86_64:
|
2022-07-07 16:58:40 +00:00
|
|
|
extends: .publish_nightly_template
|
2022-04-08 15:20:19 +00:00
|
|
|
dependencies: ['build-x86_64']
|
|
|
|
needs: ['build-x86_64']
|
|
|
|
publish_nightly-aarch64:
|
2022-07-07 16:58:40 +00:00
|
|
|
extends: .publish_nightly_template
|
2022-04-08 15:20:19 +00:00
|
|
|
dependencies: ['build-aarch64']
|
|
|
|
needs: ['build-aarch64']
|