stages: [check, build, release] # ----------------------------------------------- # Stage 1: Check for a Git tag on the current commit # ----------------------------------------------- check_tag: stage: check script: - | # Check if there is a Git tag pointing to HEAD if git tag --points-at HEAD | grep .; then echo "TAG_EXISTS=true" >> tag_check.env else echo "TAG_EXISTS=false" >> tag_check.env fi artifacts: reports: dotenv: tag_check.env # Pass the TAG_EXISTS variable to the next stage build_cloudflared_macos: &build stage: build id_tokens: VAULT_ID_TOKEN: aud: https://vault.cfdata.org secrets: APPLE_DEV_CA_CERT: vault: gitlab/cloudflare/tun/cloudflared/_dev/apple_dev_ca_cert/data@kv file: false CFD_CODE_SIGN_CERT: vault: gitlab/cloudflare/tun/cloudflared/_dev/cfd_codesign_cert/data@kv file: false CFD_CODE_SIGN_KEY: vault: gitlab/cloudflare/tun/cloudflared/_dev/cfd_codesign_key/data@kv file: false CFD_CODE_SIGN_PASS: vault: gitlab/cloudflare/tun/cloudflared/_dev/cfd_codesign_pass/data@kv file: false CFD_INSTALLER_CERT: vault: gitlab/cloudflare/tun/cloudflared/_dev/cfd_installer_cert/data@kv file: false CFD_INSTALLER_KEY: vault: gitlab/cloudflare/tun/cloudflared/_dev/cfd_installer_key/data@kv file: false CFD_INSTALLER_PASS: vault: gitlab/cloudflare/tun/cloudflared/_dev/cfd_installer_pass/data@kv file: false tags: - "macstadium-${RUNNER_ARCH}" parallel: matrix: - RUNNER_ARCH: [arm, intel] artifacts: paths: - artifacts/* script: - '[ "${RUNNER_ARCH}" = "arm" ] && export TARGET_ARCH=arm64' - '[ "${RUNNER_ARCH}" = "intel" ] && export TARGET_ARCH=amd64' - ARCH=$(uname -m) - echo ARCH=$ARCH - TARGET_ARCH=$TARGET_ARCH - ./.teamcity/mac/install-cloudflare-go.sh - export PATH="/tmp/go/bin:$PATH" - BUILD_SCRIPT=.teamcity/mac/build.sh - if [[ ! -x ${BUILD_SCRIPT} ]] ; then exit ; fi - set -euo pipefail - echo "Executing ${BUILD_SCRIPT}" - exec ${BUILD_SCRIPT} build_cloudflared_macos_tagged_release: stage: release dependencies: - build_cloudflared_macos script: - echo "Running build because tag exists." - ls -lrth artifacts/