1
0
Fork 0
mirror of https://github.com/borgbase/vorta synced 2024-12-22 07:43:09 +00:00

Keep version number in one place only. Clean up Makefile vars (#642)

This commit is contained in:
Manu 2020-09-10 13:26:38 +08:00 committed by GitHub
parent f6e7b54c9a
commit 2f47c388ce
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 33 additions and 45 deletions

View file

@ -1,11 +0,0 @@
[bumpversion]
current_version = 0.7.0
tag = True
[bumpversion:file:Makefile]
[bumpversion:file:setup.cfg]
[bumpversion:file:src/vorta/_version.py]
[bumpversion:file:src/vorta/assets/metadata/com.borgbase.Vorta.appdata.xml]

View file

@ -73,5 +73,5 @@ jobs:
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
# - name: Run PyLint (info only)
# run: pylint --rcfile=setup.cfg src --exit-zero

View file

@ -1,9 +1,9 @@
export VORTA_SRC := src/vorta
export CERTIFICATE_NAME := "Developer ID Application: Manuel Riel (CNMSCAXT48)"
export FLATPAK_XML := src/vorta/assets/metadata/com.borgbase.Vorta.appdata.xml
VERSION := $(shell python -c "from src.vorta._version import __version__; print(__version__)")
.PHONY : help
.DEFAULT_GOAL := help
DATE = "$(shell date +%F)"
clean:
rm -rf dist/*
@ -11,43 +11,44 @@ clean:
dist/Vorta.app: translations-to-qm clean
pyinstaller --clean --noconfirm package/vorta.spec
cp -R bin/darwin/Sparkle.framework dist/Vorta.app/Contents/Frameworks/
cp -R ../borg/dist/borg-dir dist/Vorta.app/Contents/Resources/
cp -R ${BORG_SRC}/dist/borg-dir dist/Vorta.app/Contents/Resources/
rm -rf build/vorta
rm -rf dist/vorta
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) \
borg: ## Build Borg single-dir release for bundling in macOS
rm -rf ${BORG_SRC}/dist/*
cd ${BORG_SRC} && python setup.py clean && pip install -U -e .
cd ${BORG_SRC} && pyinstaller --clean --noconfirm ../vorta/package/borg.spec .
find ${BORG_SRC}/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 {} \;
dist/Vorta.dmg: dist/Vorta.app
dist/Vorta.dmg: dist/Vorta.app ## Create notarized macOS DMG for distribution.
sh package/macos-package-app.sh
github-release: dist/Vorta.dmg
cp dist/Vorta.dmg dist/vorta-0.7.0.dmg
hub release create --attach=dist/vorta-0.7.0.dmg v0.7.0
github-release: dist/Vorta.dmg ## Add new Github release and attach macOS DMG
cp dist/Vorta.dmg dist/vorta-${VERSION}.dmg
hub release create --attach=dist/vorta-${VERSION}.dmg v${VERSION}
git checkout gh-pages
git commit -m 'rebuild pages' --allow-empty
git push upstream gh-pages
git checkout master
pypi-release: translations-to-qm
pypi-release: translations-to-qm ## Upload new release to PyPi
python setup.py sdist
twine upload dist/vorta-0.7.0.tar.gz
twine upload dist/vorta-${VERSION}.tar.gz
bump-version: ## Add new version tag and push to upstream repo.
bumpversion patch
#bumpversion minor
xmlstarlet ed -L -u 'component/releases/release/@date' -v $$(date +%F) src/vorta/assets/metadata/com.borgbase.Vorta.appdata.xml
git commit -a -m 'Bump version'
git push upstream
bump-version: ## Tag new version. First set new version number in src/vorta/_version.py
xmlstarlet ed -L -u 'component/releases/release/@date' -v $(shell date +%F) ${FLATPAK_XML}
xmlstarlet ed -L -u 'component/releases/release/@version' -v v${VERSION} ${FLATPAK_XML}
git commit -a -m "Bump version to v${VERSION}"
git tag -a v${VERSION}
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 \
$$VORTA_SRC/assets/UI/*.ui \
-ts $$VORTA_SRC/i18n/ts/vorta.en.ts
${VORTA_SRC}/*.py ${VORTA_SRC}/views/*.py ${VORTA_SRC}/borg/*.py \
${VORTA_SRC}/assets/UI/*.ui \
-ts ${VORTA_SRC}/i18n/ts/vorta.en.ts
translations-push: translations-from-source ## Upload .ts to Transifex.
tx push -s
@ -56,11 +57,11 @@ translations-pull: ## Download .ts from Transifex.
tx pull -a
translations-to-qm: ## Compile .ts text files to binary .qm files.
for f in $$(ls $$VORTA_SRC/i18n/ts/vorta.*.ts); do lrelease $$f -qm $$VORTA_SRC/i18n/qm/$$(basename $$f .ts).qm; done
for f in $$(ls ${VORTA_SRC}/i18n/ts/vorta.*.ts); do lrelease $$f -qm ${VORTA_SRC}/i18n/qm/$$(basename $$f .ts).qm; done
flatpak-install: translations-to-qm
pip3 install --prefix=/app --no-deps .
install -D src/vorta/assets/metadata/com.borgbase.Vorta.appdata.xml /app/share/metainfo/com.borgbase.Vorta.appdata.xml
install -D ${FLATPAK_XML} /app/share/metainfo/com.borgbase.Vorta.appdata.xml
install -D package/icon.svg /app/share/icons/hicolor/scalable/apps/com.borgbase.Vorta.svg
install -D package/icon-symbolic.svg /app/share/icons/hicolor/symbolic/apps/com.borgbase.Vorta-symbolic.svg
install -D src/vorta/assets/metadata/com.borgbase.Vorta.desktop /app/share/applications/com.borgbase.Vorta.desktop

View file

@ -5,6 +5,5 @@ pytest-mock
pytest-faulthandler
pyinstaller
tox
bump2version
flake8
pylint

View file

@ -1,8 +1,8 @@
[metadata]
name = vorta
author = Manuel Riel
description = A GUI for BorgBackup
version = 0.7.0
author = Manuel Riel and Vorta contributors
description = A GUI for Borg Backup
version = attr: vorta._version.__version__
url = https://github.com/borgbase/vorta
keywords =
backup
@ -17,6 +17,7 @@ classifiers =
License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Programming Language :: Python :: 3.6
Programming Language :: Python :: 3.7
Programming Language :: Python :: 3.8
Topic :: System :: Archiving :: Backup
Topic :: System :: Systems Administration
Topic :: Utilities
@ -67,8 +68,7 @@ ignore =
max-line-length = 120
exclude =
build,dist,.git,.idea,.cache,.tox,.eggs,
./src/vorta/views/dark/collection_rc.py,
./src/vorta/views/light/collection_rc.py
./src/vorta/__init__.py
[tox:tox]
envlist = py36,py37,py38,flake8
@ -93,8 +93,6 @@ max_line_length = 120
[pylint.master]
extension-pkg-whitelist=PyQt5
load-plugins=
ignore=
collection_rc.py
[pylint.messages control]
disable= W0511,C0301,R0903,R0201,W0212,C0114,C0115,C0116,C0103,E0611,E1120,C0415,R0914,R0912,R0915

View file

@ -0,0 +1 @@
from ._version import __version__