131 lines
4.3 KiB
YAML
131 lines
4.3 KiB
YAML
stages:
|
|
- check
|
|
- test
|
|
- build
|
|
- doc
|
|
- deploy
|
|
|
|
variables:
|
|
MANIFEST_PATH: "build-aux/org.gnome.Fractal.Devel.json"
|
|
FLATPAK_MODULE: "fractal"
|
|
APP_ID: "org.gnome.Fractal.Devel"
|
|
RUNTIME_REPO: "https://nightly.gnome.org/gnome-nightly.flatpakrepo"
|
|
|
|
.build_template: &build_template
|
|
image: 'registry.gitlab.gnome.org/gnome/gnome-runtime-images/rust_bundle:master'
|
|
tags:
|
|
- flatpak
|
|
script:
|
|
- rewrite-flatpak-manifest ${MANIFEST_PATH} ${FLATPAK_MODULE} ${CONFIG_OPTS}
|
|
- >
|
|
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
|
|
|
|
# Configure and run code checks
|
|
# Exits and fails if an error is encountered
|
|
checks:
|
|
image: "rustlang/rust:nightly-slim"
|
|
stage: check
|
|
script:
|
|
- scripts/checks.sh --verbose --force-install
|
|
|
|
# Lint the code
|
|
cargo-clippy:
|
|
image: 'registry.gitlab.gnome.org/gnome/gnome-runtime-images/rust_bundle:master'
|
|
stage: check
|
|
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}
|
|
|
|
# Build a debug version of the flatpak
|
|
# Except on main
|
|
flatpak:
|
|
<<: *build_template
|
|
stage: test
|
|
variables:
|
|
BUNDLE: "fractal-devel.flatpak"
|
|
CONFIG_OPTS: "-Dprofile=development"
|
|
except:
|
|
- main
|
|
|
|
# Build the nightly version of the flatpak
|
|
# Only on main
|
|
build:
|
|
<<: *build_template
|
|
stage: build
|
|
variables:
|
|
BUNDLE: "fractal-nightly.flatpak"
|
|
CONFIG_OPTS: "-Dprofile=nightly"
|
|
only:
|
|
- main
|
|
|
|
# Build the docs
|
|
# Only on main
|
|
pages:
|
|
image: 'registry.gitlab.gnome.org/gnome/gnome-runtime-images/rust_bundle:master'
|
|
stage: doc
|
|
tags:
|
|
- flatpak
|
|
variables:
|
|
RUSTDOCFLAGS: >
|
|
-Z unstable-options
|
|
--enable-index-page
|
|
--extern-html-root-url=gio=https://gtk-rs.org/gtk-rs-core/stable/latest/docs/gio/
|
|
--extern-html-root-url=gsk4=https://gtk-rs.org/gtk4-rs/stable/latest/docs/gsk4/
|
|
--extern-html-root-url=gdk4=https://gtk-rs.org/gtk4-rs/stable/latest/docs/gdk4/
|
|
--extern-html-root-url=gtk4=https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/
|
|
--extern-html-root-url=glib=https://gtk-rs.org/gtk-rs-core/stable/latest/docs/glib/
|
|
--extern-html-root-url=libadwaita=https://world.pages.gitlab.gnome.org/Rust/libadwaita-rs/stable/latest/docs/libadwaita/
|
|
--extern-html-root-url=matrix-sdk=https://matrix-org.github.io/matrix-rust-sdk/matrix_sdk
|
|
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 "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
|
|
artifacts:
|
|
paths:
|
|
- 'public'
|
|
only:
|
|
refs:
|
|
- main
|
|
|
|
# Publish the nightly version
|
|
# Only on main
|
|
publish_nightly:
|
|
image: 'registry.gitlab.gnome.org/gnome/gnome-runtime-images/flat-manager-client'
|
|
stage: 'deploy'
|
|
timeout: '100m'
|
|
dependencies: ['build']
|
|
needs: ['build']
|
|
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
|