Skip to content

Commit

Permalink
Add macOS notarization, use Github Workflows for testing (#407)
Browse files Browse the repository at this point in the history
* Improve macOS packaging, add notarization.
* Properly use QApplication while testing, remove workarounds.
* Use Github Workflows instead of Travis.
* Remove outdated test workaround.
  • Loading branch information
m3nu authored Mar 3, 2020
1 parent f902f20 commit 82844a1
Show file tree
Hide file tree
Showing 26 changed files with 415 additions and 458 deletions.
69 changes: 69 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Test

on: [push, pull_request]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false

matrix:
python-version: [3.6, 3.7, 3.8]
os: [ubuntu-latest, macos-latest]

steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt install -y \
xvfb herbstluftwm libssl-dev openssl libacl1-dev libacl1 build-essential \
libxkbcommon-x11-0 dbus-x11
- name: Install system dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew upgrade openssl readline xz # pyenv pyenv-virtualenv
- name: Install Vorta
run: |
pip install .
pip install borgbackup
pip install -r requirements.d/dev.txt
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v1
- name: Test with pytest (Linux)
if: runner.os == 'Linux'
run: |
export DISPLAY=:99.0
/sbin/start-stop-daemon --start --quiet --pidfile /tmp/custom_xvfb_99.pid --make-pidfile \
--background --exec /usr/bin/Xvfb -- :99 -screen 0 1920x1200x24 -ac +extension GLX +render -noreset
sleep 3
export $(dbus-launch)
(herbstluftwm) &
sleep 3
pytest
- name: Test with pytest (macOS)
if: runner.os == 'macOS'
run: |
pytest
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v1
with:
python-version: 3.8
- name: Install Vorta
run: |
pip install .
pip install -r requirements.d/dev.txt
- name: Run Flake8
run: flake8
- name: Run PyLint (info only)
run: pylint --rcfile=setup.cfg src --exit-zero
82 changes: 0 additions & 82 deletions .travis.yml

This file was deleted.

43 changes: 18 additions & 25 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
export VORTA_SRC := src/vorta
export QT_SELECT=5
export CERTIFICATE_NAME := "Developer ID Application: Manuel Riel (CNMSCAXT48)"

.PHONY : help
.DEFAULT_GOAL := help
DATE = "$(shell date +%F)"

clean:
rm -rf dist/*

icon-resources: ## Compile SVG icons to importable resource files.
pyrcc5 -o src/vorta/views/dark/collection_rc.py src/vorta/assets/icons/dark/collection.qrc
pyrcc5 -o src/vorta/views/light/collection_rc.py src/vorta/assets/icons/light/collection.qrc

Vorta.app: translations-to-qm
pyinstaller --clean --noconfirm vorta.spec
dist/Vorta.app: translations-to-qm clean
pyinstaller --clean --noconfirm package/vorta.spec
cp -R bin/darwin/Sparkle.framework dist/Vorta.app/Contents/Frameworks/
cd dist; codesign --deep --sign 'Developer ID Application: Manuel Riel (CNMSCAXT48)' Vorta.app
cp -R ../borg/dist/borg-dir dist/Vorta.app/Contents/Resources/
rm -rf build
rm -rf dist/vorta

Vorta.dmg-Vagrant:
vagrant up darwin64
rm -rf dist/*
vagrant scp darwin64:/vagrant/dist/Vorta.app dist/
vagrant halt darwin64
cp -R bin/darwin/Sparkle.framework dist/Vorta.app/Contents/Frameworks/
cd dist; codesign --deep --sign 'Developer ID Application: Manuel Riel (CNMSCAXT48)' Vorta.app
sleep 2; appdmg appdmg.json dist/vorta-0.6.23.dmg
borg:
cd ../borg && pyinstaller --clean --noconfirm ../vorta/package/borg.spec .
find ../borg/dist/borg-dir -type f \( -name \*.so -or -name \*.dylib -or -name borg.exe \) \
-exec codesign --verbose --force --sign $(CERTIFICATE_NAME) \
--entitlements package/entitlements.plist --timestamp --deep --options runtime {} \;

Vorta.dmg: Vorta.app
rm -rf dist/vorta-0.6.23.dmg
sleep 2; appdmg appdmg.json dist/vorta-0.6.23.dmg
dist/Vorta.dmg: dist/Vorta.app
sh package/macos-package-app.sh

github-release: Vorta.dmg
github-release: dist/Vorta.dmg
cp dist/Vorta.dmg dist/dist/vorta-0.6.23.dmg
hub release create --attach=dist/vorta-0.6.23.dmg v0.6.23
git checkout gh-pages
git commit -m 'rebuild pages' --allow-empty
Expand All @@ -45,15 +47,6 @@ bump-version: ## Add new version tag and push to upstream repo.
git commit -a -m 'Bump version'
git push upstream

travis-debug: ## Prepare connecting to Travis instance via SSH.
curl -s -X POST \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Travis-API-Version: 3" \
-H "Authorization: token ${TRAVIS_TOKEN}" \
-d '{ "quiet": true }' \
https://api.travis-ci.org/job/${TRAVIS_JOB_ID}/debug

translations-from-source: ## Extract strings from source code / UI files, merge into .ts.
pylupdate5 -verbose -translate-function trans_late \
$$VORTA_SRC/*.py $$VORTA_SRC/views/*.py $$VORTA_SRC/borg/*.py \
Expand Down
Loading

0 comments on commit 82844a1

Please sign in to comment.