Skip to content

Bumped minimum Cmake version to fix build issues on Cmake 4.0. #1776

Bumped minimum Cmake version to fix build issues on Cmake 4.0.

Bumped minimum Cmake version to fix build issues on Cmake 4.0. #1776

Workflow file for this run

name: Packaging(MacOS)
on:
push:
branches:
- master
- fix*
paths-ignore:
- 'README.md'
- 'LICENSE'
- 'docs/**'
pull_request:
paths-ignore:
- 'README.md'
- 'LICENSE'
- 'docs/**'
env:
PRODUCT: flameshot
jobs:
dmg-pack:
name: Build dmg on ${{ matrix.dist.os }} ${{ matrix.dist.arch }}
strategy:
fail-fast: false
matrix:
dist:
- {
os: macos-13,
arch: x86_64
}
- {
os: macos-14,
arch: arm64
}
runs-on: ${{ matrix.dist.os }}
env:
APP_NAME: flameshot
DIR_BULD: build
DIR_PKG: build/src
HELPERS_SCRIPTS_PATH: ../../packaging/macos
# Apple developer identity, example: "Developer ID Application: <user name> (code)"
# Note: no signing and notarization will be proceed if this variable is not set
APPLE_DEV_IDENTITY: ${{ secrets.APPLE_DEV_IDENTITY }}
# Apple ID user
APPLE_DEV_USER: ${{ secrets.APPLE_DEV_USER }}
# Apple ID user password
APPLE_DEV_PASS: ${{ secrets.APPLE_DEV_PASS }}
# Apple certificate with private and public keys in base64 format
APPLE_DEVELOPER_ID_APPLICATION_CERT_DATA: ${{ secrets.APPLE_DEVELOPER_ID_APPLICATION_CERT_DATA }}
# Apple certificate password
APPLE_DEVELOPER_ID_APPLICATION_CERT_PASS: ${{ secrets.APPLE_DEVELOPER_ID_APPLICATION_CERT_PASS }}
# Any temporary password for keychain, which will be created on github actions CI
APPLE_TEMP_CI_KEYCHAIN_PASS: ${{ secrets.APPLE_TEMP_CI_KEYCHAIN_PASS }}
# Temporary variable for internal use, it will be set on the "Build dmg" step
NOTARIZATION_CHECK: false
steps:
- name: Check architecture
if: matrix.dist.arch == 'x86_64'
shell: bash
run: |
platform_arch=$(uname -m)
if [[ $platform_arch != "x86_64" ]]; then
echo "$platform_arch detected. This build must be run on x86_64."
exit -1
fi
echo "$platform_arch detected."
- name: Check architecture
if: matrix.dist.arch == 'arm64'
shell: bash
run: |
platform_arch=$(uname -m)
if [[ $platform_arch != "arm64" ]]; then
echo "$platform_arch detected. This build must be run on arm64."
exit -1
fi
echo "$platform_arch detected."
- name: Checkout Source code
uses: actions/checkout@v4
- name: Set env & Print flameshot version
shell: bash
run: |
last_committed_tag=$(git tag -l --sort=-v:refname | head -1)
git_revno=$(git rev-list $(git describe --tags --abbrev=0)..HEAD --count)
git_hash=$(git rev-parse --short HEAD)
ver_info=${last_committed_tag}+git${git_revno}.${git_hash}
echo "=======FLAMESHOT VERSION========"
echo ${last_committed_tag:1}
echo "Details: ${ver_info}"
echo "================================"
echo "VER_INFO=${ver_info}" >> $GITHUB_ENV
- name: Install Qt
run: brew install qt@5 cmake
- name: Configure
run: |
rm -rf "${DIR_BULD}"/src/flameshot.dmg "${DIR_BULD}"/src/flameshot.app/
cmake -S . -B "${DIR_BULD}" -DQt5_DIR=$(brew --prefix qt5)/lib/cmake/Qt5 -DUSE_MONOCHROME_ICON=True
- name: Compile
run: |
cmake --build "${DIR_BULD}"
- name: Create key-chain and import certificate
run: |
cd "${DIR_PKG}"
${HELPERS_SCRIPTS_PATH}/create_keychain.sh flameshot
- name: Build dmg package
run: |
cd "${DIR_PKG}"
${HELPERS_SCRIPTS_PATH}/sign_qtapp.sh flameshot
- name: Artifact Upload
uses: actions/upload-artifact@v4
with:
name: ${{ env.PRODUCT }}-${{ env.VER_INFO }}-artifact-macos-${{ matrix.dist.arch }}
path: ${{ github.workspace }}/build/src/flameshot.dmg
overwrite: true
- name: Notarization status
shell: bash
run: |
if [[ "${NOTARIZATION_CHECK}" == "true" ]]; then
echo "Notarization check succeed"
else
echo "::warning Notarization check failed"
# exit 1
fi