# Copyright (C) 2018-2020 Brian Douglass # Copyright (C) 2022 abmyii # Copyright (C) 2022-2023 Jonatan Hatakeyama Zeidler # Copyright (C) 2022 Guido Berhoerster # Copyright (C) 2023 Alexander Richards # # SPDX-License-Identifier: GPL-3.0-only # # This file is part of Lomiri Weather App # # Lomiri Weather App is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # Lomiri Weather App is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . ############################################################################### # Define defaults and template anchors ############################################################################### variables: GIT_SUBMODULE_STRATEGY: recursive DOCKER_DRIVER: overlay2 CLICKABLE_VERSION: "8" UT_VERSION: "20.04" # https://stackoverflow.com/a/77477765 workflow: rules: - if: $CI_PROJECT_NAMESPACE =~ /^ubports\// variables: # Use our own GitLab runner RUNNER_TAG: "ubports" - if: $CI_PROJECT_NAMESPACE !~ /^ubports\// variables: # Use shared runner if run outside our namespace RUNNER_TAG: "saas-linux-small-amd64" .node_anchors: amd64: &amd64 variables: ARCH: "amd64" ARCH_TRIPLET: "x86_64-linux-gnu" arm64: &arm64 variables: ARCH: "arm64" ARCH_TRIPLET: "aarch64-linux-gnu" armhf: &armhf variables: ARCH: "armhf" ARCH_TRIPLET: "arm-linux-gnueabihf" default: image: "clickable/ci-$UT_VERSION-$ARCH:$CLICKABLE_VERSION" tags: - $RUNNER_TAG ############################################################################### # Define stages ############################################################################### stages: - build - publish - release ############################################################################### # `build` stage: build clicks for all architectures ############################################################################### .build: stage: build artifacts: expire_in: 1 week paths: - "build/$ARCH_TRIPLET/app" script: - clickable build --clean --accept-review-errors build-amd64: <<: *amd64 extends: .build build-arm64: <<: *arm64 extends: .build build-armhf: <<: *armhf extends: .build ############################################################################### # `publish` stage: upload to OpenStore on tags ############################################################################### publish: <<: *amd64 stage: publish artifacts: expire_in: 1 week paths: - build/x86_64-linux-gnu/app/*.click - build/aarch64-linux-gnu/app/*.click - build/arm-linux-gnueabihf/app/*.click rules: - if: $CI_COMMIT_TAG script: - 'clickable publish --arch amd64 -- "$CI_COMMIT_MESSAGE"' - 'clickable publish --arch arm64' - 'clickable publish --arch armhf' ############################################################################### # `release` stage: create a gitlab release in addition to the tag ############################################################################### release_job: stage: release image: registry.gitlab.com/gitlab-org/release-cli:latest rules: - if: $CI_COMMIT_TAG # Run this job when a tag is created script: - echo "running release_job" release: # See https://docs.gitlab.com/ee/ci/yaml/#release for available properties tag_name: '$CI_COMMIT_TAG' description: "$CI_COMMIT_MESSAGE"