-
Notifications
You must be signed in to change notification settings - Fork 13
132 lines (130 loc) · 4.5 KB
/
cd-macos-intel64.yaml
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
126
127
128
129
130
131
132
name: Continuous delivery - macOS (Intel64)
on:
release:
types: [prereleased, released]
jobs:
version-check:
name: Check versioning
runs-on: macos-13
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install required packages
run: brew install [email protected] poetry swig
- name: Create virtual environment
run: |
poetry env use python3.9
poetry install
- name: Check version tag format
run: |
VERSION_TAG="${{ github.event.release.tag_name }}"
if [[ $VERSION_TAG =~ ^v[0-9]+.[0-9]+.[0-9]+$ ]]; then exit 0; else exit 1; fi
- name: Check if version tag and package version are equal
run: |
VERSION_TAG="${{ github.event.release.tag_name }}"
PACKAGE_VERSION="v"$($(poetry env info --path)/bin/python -c "from nitrokeyapp import __version__; print(__version__)")
if [ $VERSION_TAG == $PACKAGE_VERSION ]; then exit 0; else exit 1; fi
build-onedir:
name: Build onedir
runs-on: macos-13
needs: version-check
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Install required packages
run: brew install [email protected] poetry swig
- name: Create virtual environment
run: |
poetry env use python3.9
poetry install
- name: Build onedir
run: |
source $(poetry env info --path)/bin/activate
pyinstaller ci-scripts/macOS/pyinstaller/nitrokey-app-onedir_intel64.spec
- name: Set application metadata
run: |
plutil \
-replace CFBundleShortVersionString \
-string "${GITHUB_REF_NAME:1}" \
dist/nitrokey-app2.app/Contents/Info.plist
plutil \
-replace CFBundleDisplayName \
-string "Nitrokey-App 2" \
dist/nitrokey-app2.app/Contents/Info.plist
plutil \
-replace CFBundleName \
-string "Nitrokey-App 2" \
dist/nitrokey-app2.app/Contents/Info.plist
plutil \
-insert CFBundleLocalizations \
-array \
dist/nitrokey-app2.app/Contents/Info.plist
plutil \
-insert CFBundleLocalizations \
-string "en" \
-append dist/nitrokey-app2.app/Contents/Info.plist
- name: Create application archive
run: tar -c -C dist -f nitrokey-app2-onedir-app.tar nitrokey-app2.app
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: nitrokey-app2-onedir-app-intel64
path: nitrokey-app2-onedir-app.tar
build-pkg-installer:
name: Build PKG installer
runs-on: macos-13
needs: build-onedir
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: nitrokey-app2-onedir-app-intel64
- name: Extract application archive
run: tar -x -f nitrokey-app2-onedir-app.tar
- name: Build PKG component installer
run: |
pkgbuild \
--identifier com.nitrokey.nitrokey-app2 \
--version "${GITHUB_REF_NAME:1}" \
--root nitrokey-app2.app \
--install-location /Applications/Nitrokey-App\ 2.app \
app2.pkg
- name: Create distribution file
run: |
productbuild --synthesize \
--product ci-scripts/macos/pkg/requirements_intel64.plist \
--package app2.pkg \
distribution.plist
- name: Create PKG product installer
run: |
productbuild \
--distribution distribution.plist \
--package-path app2.pkg \
nitrokey-app2.pkg
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: nitrokey-app-pkg-intel64
path: nitrokey-app2.pkg
publish-pkg-installer:
name: Publish PKG installer
runs-on: macos-13
needs: build-pkg-installer
permissions:
contents: write
steps:
- name: Download artifact
uses: actions/download-artifact@v4
with:
name: nitrokey-app-pkg-intel64
- name: Rename installer
run: |
mv \
nitrokey-app2.pkg \
nitrokey-app2-${{ github.event.release.tag_name }}-intel64.pkg
- name: Publish release
uses: softprops/action-gh-release@v2
with:
files: nitrokey-app2-${{ github.event.release.tag_name }}-intel64.pkg