yubioath-flutter/.github/workflows/macos.yml
2022-11-10 11:48:39 +01:00

76 lines
1.8 KiB
YAML

name: macOS
on: [push, pull_request]
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Check app versions
run: |
python set-version.py
git diff --exit-code
- name: Install dependencies
run: |
brew update
brew install swig
python -m pip install --upgrade pip
pip install poetry
- uses: subosito/flutter-action@v2
with:
channel: 'stable'
architecture: 'x64'
flutter-version: '3.3.7'
- run: flutter config --enable-macos-desktop
- run: flutter --version
- name: Run tests
run: |
flutter test
flutter analyze
- name: Build the Helper
run: ./build-helper.sh
- 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
mv build/macos/Build/Products/Release/"Yubico Authenticator.app" deploy
mv create-dmg.sh deploy
mv resources/icons/dmg-background.png deploy
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: yubioath-desktop-macos
path: deploy