-
Notifications
You must be signed in to change notification settings - Fork 140
100 lines (82 loc) · 2.74 KB
/
macos.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
name: macOS
on: [push, pull_request]
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- name: Read variables from repo
run: cat .github/workflows/env >> $GITHUB_ENV
- name: Check app versions
run: |
python3 set-version.py
git diff --exit-code
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: ${{ env.PYVER }}
- name: Set up CocoaPods
uses: maxim-lobanov/setup-cocoapods@v1
with:
podfile-path: macos/Podfile.lock
- name: Cache helper
id: cache-helper
uses: actions/cache@v4
with:
path: |
build/macos/helper
assets/licenses/helper.json
key: ${{ runner.os }}-py${{ env.PYVER }}-${{ hashFiles('helper/**') }}
- name: Install dependencies
if: steps.cache-helper.outputs.cache-hit != 'true'
run: |
brew update
brew install swig
python -m pip install --upgrade pip
pip install poetry
- name: Build the Helper
if: steps.cache-helper.outputs.cache-hit != 'true'
run: ./build-helper.sh
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
flutter-version: ${{ env.FLUTTER }}
- run: flutter config --enable-macos-desktop
- run: flutter --version
- name: Run lints/tests
env:
SKIP: ${{ steps.cache-helper.outputs.cache-hit == 'true' && 'mypy,flake8,black,bandit' || ''}}
run: |
pip install pre-commit
pre-commit run --all-files
flutter test
- name: Build the app
run: |
export VERSION_NAME=`./set-version.py | head -n 1 | sed 's/-.*$//g'`
flutter build macos --build-name=$VERSION_NAME
- name: Check generated files
run: git diff --exit-code
- name: Create dmg
run: |
brew install create-dmg
mkdir source_folder
cp -R build/macos/Build/Products/Release/"Yubico Authenticator.app" source_folder
cp resources/icons/dmg-background.png .
sh create-dmg.sh
- name: Rename and archive app bundle
run: |
export REF=$(echo ${GITHUB_REF} | cut -d '/' -f 3)
mkdir deploy
mv yubioath-desktop.dmg deploy
tar -czf deploy/yubioath-desktop-${REF}.app.tar.gz -C build/macos/Build/Products/Release "Yubico Authenticator.app"
mv create-dmg.sh deploy
mv resources/icons/dmg-background.png deploy
mv macos/helper.entitlements deploy
mv macos/helper-sandbox.entitlements deploy
mv macos/Runner/Release.entitlements deploy
mv macos/release-macos.sh deploy
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: yubioath-desktop-macos
path: deploy