mirror of
https://github.com/fergalmoran/flameshot.git
synced 2026-02-08 03:23:58 +00:00
126 lines
3.9 KiB
YAML
126 lines
3.9 KiB
YAML
name: Packaging(MacOS)
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- master
|
|
- fix*
|
|
paths-ignore:
|
|
- 'README.md'
|
|
- 'LICENSE'
|
|
- 'docs/**'
|
|
|
|
pull_request:
|
|
paths-ignore:
|
|
- 'README.md'
|
|
- 'LICENSE'
|
|
- 'docs/**'
|
|
- 'data/translations/*.ts'
|
|
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
PRODUCT: flameshot
|
|
|
|
jobs:
|
|
dmg-pack:
|
|
name: Build dmg on ${{ matrix.dist.os }} ${{ matrix.dist.arch }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
dist:
|
|
- {
|
|
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: Checkout Source code
|
|
if: github.event_name == 'push'
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Checkout Source code
|
|
if: github.event_name == 'pull_request'
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.event.pull_request.head.sha }}
|
|
|
|
- name: Checkout Source code
|
|
if: github.event_name == 'workflow_dispatch'
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.sha }}
|
|
|
|
- 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@6 cmake
|
|
|
|
- name: Configure
|
|
run: |
|
|
rm -rf "${DIR_BULD}"/src/flameshot.dmg "${DIR_BULD}"/src/flameshot.app/
|
|
cmake -S . -B "${DIR_BULD}" -DQt6_DIR=$(brew --prefix qt6)/lib/cmake/Qt6 -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
|