mirror of https://github.com/borgbase/vorta
81 lines
2.8 KiB
YAML
81 lines
2.8 KiB
YAML
name: Build macOS release
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
branch:
|
|
description: 'Branch to use for building macOS release'
|
|
required: true
|
|
default: 'master'
|
|
borg_version:
|
|
description: 'Borg version to package'
|
|
required: true
|
|
default: '1.1.16'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: macos-10.15
|
|
|
|
steps:
|
|
- name: Check out selected branch
|
|
uses: actions/checkout@v2
|
|
with:
|
|
ref: ${{ github.event.inputs.branch }}
|
|
- name: Set up Python
|
|
uses: actions/setup-python@v1
|
|
with:
|
|
python-version: 3.9
|
|
- name: Install system dependencies
|
|
run: |
|
|
brew upgrade openssl readline xz
|
|
- name: Install build dependencies
|
|
run: |
|
|
brew install --cask sparkle
|
|
brew install create-dmg
|
|
pip3 install --upgrade pip
|
|
pip3 install -r dev.txt
|
|
working-directory: requirements.d
|
|
- name: Install Vorta
|
|
run: |
|
|
# Use PyQt5 version supported by PyInstaller.
|
|
# See https://github.com/pyinstaller/pyinstaller/issues/5701
|
|
pip3 install 'pyqt5<=5.15.3'
|
|
pip3 install .
|
|
- name: Package with PyInstaller
|
|
run: |
|
|
pyinstaller --clean --noconfirm package/vorta.spec
|
|
cp -R /usr/local/Caskroom/sparkle/*/Sparkle.framework dist/Vorta.app/Contents/Frameworks/
|
|
curl -LJO https://github.com/borgbackup/borg/releases/download/${{ github.event.inputs.borg_version }}/borg-macosx64.tgz
|
|
tar xvf borg-macosx64.tgz -C dist/Vorta.app/Contents/Resources/
|
|
cd dist && zip -rq --symlinks Vorta.zip Vorta.app
|
|
|
|
- name: Codesign executable
|
|
continue-on-error: false
|
|
working-directory: dist
|
|
env:
|
|
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
|
|
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
|
|
CERTIFICATE_NAME: ${{ secrets.MACOS_CERTIFICATE_NAME }}
|
|
APPLE_ID_USER: ${{ secrets.APPLE_ID_USER }}
|
|
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
|
|
run: |
|
|
echo $MACOS_CERTIFICATE | base64 --decode > certificate.p12
|
|
security create-keychain -p 123 build.keychain
|
|
security default-keychain -s build.keychain
|
|
security unlock-keychain -p 123 build.keychain
|
|
security import certificate.p12 -k build.keychain -A -P $MACOS_CERTIFICATE_PWD -T /usr/bin/codesign
|
|
security set-key-partition-list -S apple-tool:,apple:,codesign: -s -k 123 build.keychain
|
|
python3 ../package/fix_app_qt_folder_names_for_codesign.py Vorta.app
|
|
sh ../package/macos-package-app.sh
|
|
|
|
# - name: Setup tmate session
|
|
# uses: mxschmitt/action-tmate@v3
|
|
# if: ${{ failure() }}
|
|
# timeout-minutes: 15
|
|
|
|
- name: Upload build
|
|
uses: actions/upload-artifact@v2
|
|
with:
|
|
name: Vorta.dmg
|
|
path: dist/Vorta.dmg
|
|
retention-days: 10
|