mirror of
https://github.com/Yubico/yubioath-flutter.git
synced 2024-11-25 23:14:18 +03:00
95 lines
2.5 KiB
YAML
95 lines
2.5 KiB
YAML
name: macOS
|
|
|
|
on: [push, pull_request]
|
|
|
|
jobs:
|
|
build:
|
|
|
|
runs-on: macos-latest
|
|
env:
|
|
PYVER: 3.11
|
|
MACOSX_DEPLOYMENT_TARGET: "10.15"
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
|
|
- name: Check app versions
|
|
run: |
|
|
python3 set-version.py
|
|
git diff --exit-code
|
|
|
|
- name: Cache helper
|
|
id: cache-helper
|
|
uses: actions/cache@v3
|
|
with:
|
|
path: |
|
|
build/macos/helper
|
|
assets/licenses/helper.json
|
|
key: ${{ runner.os }}-py${{ env.PYVER }}-${{ hashFiles('helper/**') }}
|
|
|
|
- name: Set up Python
|
|
if: steps.cache-helper.outputs.cache-hit != 'true'
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ env.PYVER }}
|
|
|
|
- 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'
|
|
architecture: 'x64'
|
|
flutter-version: '3.3.9'
|
|
- run: flutter config --enable-macos-desktop
|
|
- run: flutter --version
|
|
|
|
- name: Run tests
|
|
run: |
|
|
flutter test
|
|
flutter analyze
|
|
|
|
- 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@v3
|
|
with:
|
|
name: yubioath-desktop-macos
|
|
path: deploy
|