-
Notifications
You must be signed in to change notification settings - Fork 2
101 lines (84 loc) · 4.27 KB
/
installer.yml
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
name: Build Installer
on:
push:
branches:
- "**"
pull_request:
branches:
- "**"
jobs:
build-installer:
timeout-minutes: 80
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [macos-14] # [ubuntu-22.04, windows-2022, macos-13, macos-14]
steps:
- name: Check-out repository
uses: actions/checkout@v4
- name: Set up Python environment
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Upgrade package installer for Python
run: python -m pip install --upgrade pip
- name: Install Python dependences
run: |
python -m pip install flit
flit install --only-deps # Install the dependencies, but not the EasyDiffractionApp package itself
- name: Add extra info to pyproject.toml
run: python utils.py --update
- name: Declare env variables on push only
if: github.event_name == 'push'
shell: bash
run: echo "BRANCH_NAME=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
- name: Declare env variables on pull_request only
if: github.event_name == 'pull_request'
shell: bash
run: echo "BRANCH_NAME=$GITHUB_HEAD_REF" >> $GITHUB_ENV
- name: Declare env variables on push and pull_request
shell: bash
run: |
echo "MATRIX_OS=${{ matrix.os }}" >> $GITHUB_ENV
echo "RUNNER_OS=${{ runner.os }}" >> $GITHUB_ENV
echo "RUNNER_ARCH=${{ runner.arch }}" >> $GITHUB_ENV
echo "TEMP_ARTIFACT_SUFFIX=$(python utils.py --get release.app_name)" >> $GITHUB_ENV
echo "APP_NAME=$(python utils.py --get release.app_name)" >> $GITHUB_ENV
echo "PACKAGE_NAME=$(python utils.py --get project.name)" >> $GITHUB_ENV
echo "PACKAGE_PATH=$GITHUB_WORKSPACE/$(python utils.py --get project.name)" >> $GITHUB_ENV
echo "RELEASE_TAG=$(python utils.py --get ci.app.info.release_tag)" >> $GITHUB_ENV
echo "RELEASE_TITLE=$(python utils.py --get ci.app.info.release_title)" >> $GITHUB_ENV
echo "SCRIPTS_PATH=$(python utils.py --get ci.project.subdirs.scripts)" >> $GITHUB_ENV
echo "DISTRIBUTION_PATH=$(python utils.py --get ci.project.subdirs.distribution)" >> $GITHUB_ENV
echo "DOWNLOAD_PATH=$(python utils.py --get ci.project.subdirs.download)" >> $GITHUB_ENV
echo "QTIFW_PATH=$(python utils.py --get ci.qtifw.setup.installation_path.${{ runner.os }})" >> $GITHUB_ENV
echo "PYTHON_PACKAGES_PATH=$(python utils.py --get ci.cache.python_packages_path)" >> $GITHUB_ENV
echo "GIT_INSTALL_URL=git+$GITHUB_SERVER_URL/$GITHUB_REPOSITORY@${{ env.BRANCH_NAME }}" >> $GITHUB_ENV
- name: Create python resources file
run: pyside6-rcc ${{ env.PACKAGE_PATH }}/resources.qrc -o ${{ env.PACKAGE_PATH }}/resources.py
- name: Create freezed python app bundle with PyInstaller
run: python ${{ env.SCRIPTS_PATH }}/FreezeApp.py
- name: Create offline app installer from freezed app bundle with QtIFW
run: >
python ${{ env.SCRIPTS_PATH }}/MakeInstaller.py
${{ env.BRANCH_NAME }} ${{ matrix.os }}
- name: Sign offline app installer (version 1)
if: github.event_name == 'push'
run: >
python ${{ env.SCRIPTS_PATH }}/SignAppInstaller.py
${{ env.BRANCH_NAME }} ${{ matrix.os }}
${{ secrets.MACOS_CERTIFICATE_ENCODED }} ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
${{ secrets.APPSTORE_NOTARIZATION_USERNAME }} ${{ secrets.APPSTORE_NOTARIZATION_PASSWORD }}
- name: Sign offline app installer (version 2)
if: github.event_name == 'push'
uses: lando/code-sign-action@v2
with:
file: 'ci/distribution/EasyDiffraction_v0.9.1a0_macos-14-AppleSilicon.app/Contents/MacOS/EasyDiffraction_v0.9.1a0_macos-14-AppleSilicon'
certificate-data: ${{ secrets.MACOS_CERTIFICATE_ENCODED }}
certificate-password: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }}
apple-notary-user: ${{ secrets.APPSTORE_NOTARIZATION_USERNAME }}
apple-notary-password: ${{ secrets.APPSTORE_NOTARIZATION_PASSWORD }}
apple-notary-tool: notarytool
apple-team-id: 'W2AG9MPZ43'
options: --options runtime --entitlements entitlements.xml