ci: some improvements (#3863) #1759
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: | |
x86_64: | |
name: macOS Sonoma 14 | |
runs-on: macos-14 | |
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 | |
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-x86_64 | |
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 |