forked from flameshot-org/flameshot
-
Notifications
You must be signed in to change notification settings - Fork 0
125 lines (109 loc) · 3.9 KB
/
MacOS-pack.yml
File metadata and controls
125 lines (109 loc) · 3.9 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
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