2021-01-19 07:17:10 +00:00
|
|
|
name: Build macOS release
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
|
|
|
branch:
|
2024-04-08 15:24:31 +00:00
|
|
|
description: 'Branch to use for building release'
|
2021-01-19 07:17:10 +00:00
|
|
|
required: true
|
|
|
|
default: 'master'
|
|
|
|
borg_version:
|
|
|
|
description: 'Borg version to package'
|
|
|
|
required: true
|
2024-09-14 16:46:43 +00:00
|
|
|
default: '1.4.0'
|
2024-04-08 15:24:31 +00:00
|
|
|
macos_version:
|
|
|
|
description: 'macOS version for building'
|
|
|
|
required: true
|
2024-10-18 14:54:41 +00:00
|
|
|
default: 'macos-14'
|
2024-11-10 11:04:35 +00:00
|
|
|
python_version:
|
|
|
|
description: 'Python version for building'
|
|
|
|
required: true
|
|
|
|
default: '3.12'
|
2021-01-19 07:17:10 +00:00
|
|
|
|
|
|
|
jobs:
|
|
|
|
build:
|
2024-04-08 15:24:31 +00:00
|
|
|
runs-on: ${{ github.event.inputs.macos_version }}
|
2021-01-19 07:17:10 +00:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Check out selected branch
|
2022-10-15 11:53:29 +00:00
|
|
|
uses: actions/checkout@v3
|
2021-01-19 07:17:10 +00:00
|
|
|
with:
|
|
|
|
ref: ${{ github.event.inputs.branch }}
|
2024-11-10 11:04:35 +00:00
|
|
|
- name: Set up Python ${{ inputs.python_version }}
|
|
|
|
uses: actions/setup-python@v4
|
|
|
|
with:
|
|
|
|
python-version: ${{ inputs.python_version }}
|
2021-01-19 07:17:10 +00:00
|
|
|
- name: Install system dependencies
|
|
|
|
run: |
|
2021-11-27 16:37:18 +00:00
|
|
|
brew install openssl readline xz
|
2021-01-19 07:17:10 +00:00
|
|
|
- name: Install build dependencies
|
|
|
|
run: |
|
|
|
|
brew install --cask sparkle
|
2021-03-03 12:59:10 +00:00
|
|
|
brew install create-dmg
|
2024-11-10 11:04:35 +00:00
|
|
|
pip3 install --break-system-packages --upgrade pip setuptools wheel
|
2024-10-18 14:17:34 +00:00
|
|
|
pip3 install --break-system-packages -r dev.txt
|
2021-01-19 07:17:10 +00:00
|
|
|
working-directory: requirements.d
|
|
|
|
- name: Install Vorta
|
|
|
|
run: |
|
2024-10-18 14:17:34 +00:00
|
|
|
pip3 install --break-system-packages .
|
2021-01-19 07:17:10 +00:00
|
|
|
- name: Package with PyInstaller
|
|
|
|
run: |
|
|
|
|
pyinstaller --clean --noconfirm package/vorta.spec
|
2024-11-10 17:44:19 +00:00
|
|
|
cp -R $(brew --prefix)/Caskroom/sparkle/*/Sparkle.framework dist/Vorta.app/Contents/Frameworks/
|
2024-09-26 10:25:22 +00:00
|
|
|
curl -LJO https://github.com/borgbackup/borg/releases/download/${{ github.event.inputs.borg_version }}/borg-macos1012.tgz
|
|
|
|
tar xvf borg-macos1012.tgz -C dist/Vorta.app/Contents/Resources/
|
2021-01-19 07:17:10 +00:00
|
|
|
cd dist && zip -rq --symlinks Vorta.zip Vorta.app
|
2021-03-03 12:59:10 +00:00
|
|
|
|
|
|
|
- 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 }}
|
2023-10-27 11:07:59 +00:00
|
|
|
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
|
2021-03-03 12:59:10 +00:00
|
|
|
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
|
|
|
|
|
2021-01-19 07:17:10 +00:00
|
|
|
- name: Upload build
|
2024-09-14 16:46:43 +00:00
|
|
|
uses: actions/upload-artifact@v4
|
2021-01-19 07:17:10 +00:00
|
|
|
with:
|
2021-03-03 12:59:10 +00:00
|
|
|
name: Vorta.dmg
|
|
|
|
path: dist/Vorta.dmg
|
2024-09-14 16:46:43 +00:00
|
|
|
retention-days: 60
|