Fix skipping QtMultimedia module for macOS #100
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: "Snapshot" | |
on: | |
push: | |
branches: [ "master" ] | |
paths-ignore: | |
- 'OpenNumismat/resources/i18n/*' | |
- 'icons/*' | |
- 'OpenNumismat/resources/resources.qrc' | |
concurrency: | |
group: ${{ github.workflow }} | |
cancel-in-progress: true | |
jobs: | |
version: | |
name: Version | |
uses: ./.github/workflows/job_version.yml | |
title: | |
needs: version | |
name: Title | |
runs-on: ubuntu-latest | |
outputs: | |
PACKAGENAME: ${{ needs.version.outputs.APPNAME }}-${{ needs.version.outputs.VERSION }}.${{ needs.version.outputs.REVISION }} | |
APPNAME: ${{ needs.version.outputs.APPNAME }} | |
steps: | |
- run: "true" | |
windows: | |
needs: [version, title] | |
name: Windows | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: '3.12' | |
- name: install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r requirements.txt | |
python -m pip install pyinstaller pyinstaller-versionfile | |
- name: Create versionfile | |
run: | | |
touch metadata.yml | |
echo "FileDescription: ${{ needs.title.outputs.APPNAME }}" >> metadata.yml | |
echo "InternalName: ${{ needs.title.outputs.APPNAME }}" >> metadata.yml | |
create-version-file metadata.yml --outfile versionfile.txt --version ${{ needs.version.outputs.VERSION }}.${{ needs.version.outputs.REVISION }} | |
- name: Create private keys | |
run: | | |
touch OpenNumismat/private_keys.py | |
echo "COLNECT_PROXY = '${{ secrets.COLNECT_PROXY }}'" >> OpenNumismat/private_keys.py | |
echo "COLNECT_KEY = '${{ secrets.COLNECT_KEY }}'" >> OpenNumismat/private_keys.py | |
echo "NUMISTA_API_KEY = '${{ secrets.NUMISTA_API_KEY }}'" >> OpenNumismat/private_keys.py | |
echo "MAPBOX_ACCESS_TOKEN = '${{ secrets.MAPBOX_ACCESS_TOKEN }}'" >> OpenNumismat/private_keys.py | |
- name: Patch version | |
uses: ./.github/actions/replace-string-in-file | |
with: | |
file: OpenNumismat/version.py | |
old-string: "Version = .*" | |
new-string: >- | |
Version = "${{ needs.version.outputs.VERSION }}.${{ needs.version.outputs.REVISION }}" | |
- name: Patch portable | |
uses: ./.github/actions/replace-string-in-file | |
with: | |
file: OpenNumismat/version.py | |
old-string: "Portable = False" | |
new-string: "Portable = True" | |
- name: build | |
run: | | |
SET PYTHONOPTIMIZE=1 | |
pyinstaller open-numismat-portable.spec | |
- name: package | |
run: | | |
cd dist | |
7z a -r ${{ needs.title.outputs.PACKAGENAME }}.zip ${{ needs.title.outputs.APPNAME }} | |
move ${{ needs.title.outputs.PACKAGENAME }}.zip .. | |
cd .. | |
- name: upload | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ needs.title.outputs.PACKAGENAME }}-zip | |
path: ${{ needs.title.outputs.PACKAGENAME }}.zip | |
if-no-files-found: error | |
innosetup: | |
needs: [version, title] | |
name: InnoSetup | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: '3.12' | |
- name: install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r requirements.txt | |
python -m pip install pyinstaller pyinstaller-versionfile | |
- name: Create versionfile | |
run: | | |
touch metadata.yml | |
echo "FileDescription: ${{ needs.title.outputs.APPNAME }}" >> metadata.yml | |
echo "InternalName: ${{ needs.title.outputs.APPNAME }}" >> metadata.yml | |
create-version-file metadata.yml --outfile versionfile.txt --version ${{ needs.version.outputs.VERSION }}.${{ needs.version.outputs.REVISION }} | |
- name: Create private keys | |
run: | | |
touch OpenNumismat/private_keys.py | |
echo "COLNECT_PROXY = '${{ secrets.COLNECT_PROXY }}'" >> OpenNumismat/private_keys.py | |
echo "COLNECT_KEY = '${{ secrets.COLNECT_KEY }}'" >> OpenNumismat/private_keys.py | |
echo "NUMISTA_API_KEY = '${{ secrets.NUMISTA_API_KEY }}'" >> OpenNumismat/private_keys.py | |
echo "MAPBOX_ACCESS_TOKEN = '${{ secrets.MAPBOX_ACCESS_TOKEN }}'" >> OpenNumismat/private_keys.py | |
- name: Patch version | |
uses: ./.github/actions/replace-string-in-file | |
with: | |
file: OpenNumismat/version.py | |
old-string: "Version = .*" | |
new-string: >- | |
Version = "${{ needs.version.outputs.VERSION }}.${{ needs.version.outputs.REVISION }}" | |
- name: Patch build | |
uses: ./.github/actions/replace-string-in-file | |
with: | |
file: tools/setup.iss | |
old-string: "AppVersion=.*" | |
new-string: "AppVersion=${{ needs.version.outputs.VERSION }}.${{ needs.version.outputs.REVISION }}" | |
- name: build | |
run: | | |
SET PYTHONOPTIMIZE=1 | |
pyinstaller open-numismat.spec | |
- name: package | |
run: | | |
ISCC.exe tools/setup.iss | |
move tools/${{ needs.title.outputs.PACKAGENAME }}.exe . | |
- name: upload | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ needs.title.outputs.PACKAGENAME }} | |
path: ${{ needs.title.outputs.PACKAGENAME }}.exe | |
if-no-files-found: error | |
cx_freeze: | |
needs: [version, title] | |
name: cx_Freeze | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: '3.11' | |
- name: install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r requirements.txt | |
python -m pip install cx_freeze | |
- name: Create private keys | |
run: | | |
touch OpenNumismat/private_keys.py | |
echo "COLNECT_PROXY = '${{ secrets.COLNECT_PROXY }}'" >> OpenNumismat/private_keys.py | |
echo "COLNECT_KEY = '${{ secrets.COLNECT_KEY }}'" >> OpenNumismat/private_keys.py | |
echo "NUMISTA_API_KEY = '${{ secrets.NUMISTA_API_KEY }}'" >> OpenNumismat/private_keys.py | |
echo "MAPBOX_ACCESS_TOKEN = '${{ secrets.MAPBOX_ACCESS_TOKEN }}'" >> OpenNumismat/private_keys.py | |
- name: Patch version | |
uses: ./.github/actions/replace-string-in-file | |
with: | |
file: OpenNumismat/version.py | |
old-string: "Version = .*" | |
new-string: >- | |
Version = "${{ needs.version.outputs.VERSION }}.${{ needs.version.outputs.REVISION }}" | |
- name: Patch portable | |
uses: ./.github/actions/replace-string-in-file | |
with: | |
file: OpenNumismat/version.py | |
old-string: "Portable = False" | |
new-string: "Portable = True" | |
- name: build | |
run: | | |
SET PYTHONOPTIMIZE=1 | |
python setup.py build_exe | |
- name: package | |
run: | | |
cd build | |
7z a -r ${{ needs.title.outputs.PACKAGENAME }}.zip ${{ needs.title.outputs.APPNAME }} | |
move ${{ needs.title.outputs.PACKAGENAME }}.zip .. | |
cd .. | |
- name: upload | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ needs.title.outputs.PACKAGENAME }}-cx_freeze | |
path: ${{ needs.title.outputs.PACKAGENAME }}.zip | |
if-no-files-found: error | |
nuitka: | |
needs: [version, title] | |
name: Nuitka | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: '3.11' | |
- name: install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r requirements.txt | |
python -m pip install nuitka | |
- name: Create private keys | |
run: | | |
touch OpenNumismat/private_keys.py | |
echo "COLNECT_PROXY = '${{ secrets.COLNECT_PROXY }}'" >> OpenNumismat/private_keys.py | |
echo "COLNECT_KEY = '${{ secrets.COLNECT_KEY }}'" >> OpenNumismat/private_keys.py | |
echo "NUMISTA_API_KEY = '${{ secrets.NUMISTA_API_KEY }}'" >> OpenNumismat/private_keys.py | |
echo "MAPBOX_ACCESS_TOKEN = '${{ secrets.MAPBOX_ACCESS_TOKEN }}'" >> OpenNumismat/private_keys.py | |
- name: Patch version | |
uses: ./.github/actions/replace-string-in-file | |
with: | |
file: OpenNumismat/version.py | |
old-string: "Version = .*" | |
new-string: >- | |
Version = "${{ needs.version.outputs.VERSION }}.${{ needs.version.outputs.REVISION }}" | |
- name: Patch portable | |
uses: ./.github/actions/replace-string-in-file | |
with: | |
file: OpenNumismat/version.py | |
old-string: "Portable = False" | |
new-string: "Portable = True" | |
- name: build | |
run: >- | |
python -m nuitka open-numismat.py | |
--jobs=2 | |
--assume-yes-for-downloads | |
--msvc=latest | |
--lto=yes | |
--show-modules | |
--standalone | |
--enable-plugin=pyside6 | |
--include-qt-plugins=sqldrivers,multimedia | |
--disable-console | |
--include-data-dir=OpenNumismat/templates=templates | |
--include-data-dir=OpenNumismat/db=db | |
--include-data-files=COPYING=COPYING | |
--windows-icon-from-ico=icons/main.ico | |
--windows-file-version=${{ needs.version.outputs.VERSION }}.${{ needs.version.outputs.REVISION }} | |
--output-filename=${{ needs.title.outputs.APPNAME }}.exe | |
- name: package | |
run: | | |
cd open-numismat.dist | |
mkdir ${{ needs.title.outputs.APPNAME }} | |
robocopy . ${{ needs.title.outputs.APPNAME }} /move /e /xd ${{ needs.title.outputs.APPNAME }} | |
7z a -r ${{ needs.title.outputs.PACKAGENAME }}.zip ${{ needs.title.outputs.APPNAME }} | |
move ${{ needs.title.outputs.PACKAGENAME }}.zip .. | |
cd .. | |
- name: upload | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ needs.title.outputs.PACKAGENAME }}-nuitka | |
path: ${{ needs.title.outputs.PACKAGENAME }}.zip | |
if-no-files-found: error | |
nuitka_innosetup: | |
needs: [version, title] | |
name: Nuitka InnoSetup | |
runs-on: windows-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: '3.11' | |
- name: install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r requirements.txt | |
python -m pip install nuitka | |
- name: Create private keys | |
run: | | |
touch OpenNumismat/private_keys.py | |
echo "COLNECT_PROXY = '${{ secrets.COLNECT_PROXY }}'" >> OpenNumismat/private_keys.py | |
echo "COLNECT_KEY = '${{ secrets.COLNECT_KEY }}'" >> OpenNumismat/private_keys.py | |
echo "NUMISTA_API_KEY = '${{ secrets.NUMISTA_API_KEY }}'" >> OpenNumismat/private_keys.py | |
echo "MAPBOX_ACCESS_TOKEN = '${{ secrets.MAPBOX_ACCESS_TOKEN }}'" >> OpenNumismat/private_keys.py | |
- name: Patch version | |
uses: ./.github/actions/replace-string-in-file | |
with: | |
file: OpenNumismat/version.py | |
old-string: "Version = .*" | |
new-string: >- | |
Version = "${{ needs.version.outputs.VERSION }}.${{ needs.version.outputs.REVISION }}" | |
- name: Patch build | |
uses: ./.github/actions/replace-string-in-file | |
with: | |
file: tools/setup-nuitka.iss | |
old-string: "AppVersion=.*" | |
new-string: "AppVersion=${{ needs.version.outputs.VERSION }}.${{ needs.version.outputs.REVISION }}" | |
- name: build | |
run: >- | |
python -m nuitka open-numismat.py | |
--jobs=2 | |
--assume-yes-for-downloads | |
--msvc=latest | |
--lto=yes | |
--show-modules | |
--standalone | |
--enable-plugin=pyside6 | |
--include-qt-plugins=sqldrivers,multimedia | |
--disable-console | |
--include-data-dir=OpenNumismat/templates=templates | |
--include-data-dir=OpenNumismat/db=db | |
--include-data-files=COPYING=COPYING | |
--windows-icon-from-ico=icons/main.ico | |
--windows-file-version=${{ needs.version.outputs.VERSION }}.${{ needs.version.outputs.REVISION }} | |
--output-filename=${{ needs.title.outputs.APPNAME }}.exe | |
- name: package | |
run: | | |
ISCC.exe tools/setup-nuitka.iss | |
move tools/${{ needs.title.outputs.PACKAGENAME }}.exe . | |
- name: upload | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ needs.title.outputs.PACKAGENAME }}-nuitka-innosetup | |
path: ${{ needs.title.outputs.PACKAGENAME }}.exe | |
if-no-files-found: error | |
ubuntu: | |
needs: [version, title] | |
name: Ubuntu | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- name: Install dependencies | |
run: | | |
sudo apt update | |
sudo apt install dpkg devscripts debhelper dh-python dh-virtualenv python3-venv | |
- name: Create private keys | |
run: | | |
touch OpenNumismat/private_keys.py | |
echo "COLNECT_PROXY = '${{ secrets.COLNECT_PROXY }}'" >> OpenNumismat/private_keys.py | |
echo "COLNECT_KEY = '${{ secrets.COLNECT_KEY }}'" >> OpenNumismat/private_keys.py | |
echo "NUMISTA_API_KEY = '${{ secrets.NUMISTA_API_KEY }}'" >> OpenNumismat/private_keys.py | |
echo "MAPBOX_ACCESS_TOKEN = '${{ secrets.MAPBOX_ACCESS_TOKEN }}'" >> OpenNumismat/private_keys.py | |
- name: Patch version | |
uses: ./.github/actions/replace-string-in-file | |
with: | |
file: OpenNumismat/version.py | |
old-string: "Version = .*" | |
new-string: >- | |
Version = "${{ needs.version.outputs.VERSION }}.${{ needs.version.outputs.REVISION }}" | |
- name: Patch build | |
uses: ./.github/actions/replace-string-in-file | |
with: | |
file: debian/changelog | |
old-string: "open-numismat (.*) oneiric; urgency=low" | |
new-string: "open-numismat (${{ needs.version.outputs.VERSION }}.${{ needs.version.outputs.REVISION }}) unstable; urgency=low" | |
- name: Build | |
run: | | |
debuild -b -us -uc | |
mv ../open-numismat_${{ needs.version.outputs.VERSION }}.${{ needs.version.outputs.REVISION }}_all.deb . | |
ls | |
- name: upload | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ needs.title.outputs.PACKAGENAME }}-deb | |
path: open-numismat_${{ needs.version.outputs.VERSION }}.${{ needs.version.outputs.REVISION }}_all.deb | |
if-no-files-found: error | |
macos: | |
needs: [version, title] | |
name: macOS | |
runs-on: macos-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: 'recursive' | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: '3.12' | |
- name: install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r requirements.txt | |
python -m pip install pyinstaller | |
- name: Create private keys | |
run: | | |
touch OpenNumismat/private_keys.py | |
echo "COLNECT_PROXY = '${{ secrets.COLNECT_PROXY }}'" >> OpenNumismat/private_keys.py | |
echo "COLNECT_KEY = '${{ secrets.COLNECT_KEY }}'" >> OpenNumismat/private_keys.py | |
echo "NUMISTA_API_KEY = '${{ secrets.NUMISTA_API_KEY }}'" >> OpenNumismat/private_keys.py | |
echo "MAPBOX_ACCESS_TOKEN = '${{ secrets.MAPBOX_ACCESS_TOKEN }}'" >> OpenNumismat/private_keys.py | |
- name: Patch version | |
uses: ./.github/actions/replace-string-in-file | |
with: | |
file: OpenNumismat/version.py | |
old-string: "Version = .*" | |
new-string: >- | |
Version = "${{ needs.version.outputs.VERSION }}.${{ needs.version.outputs.REVISION }}" | |
- name: build | |
run: | | |
PYTHONOPTIMIZE=1 | |
pyinstaller open-numismat.spec | |
- name: package | |
run: | | |
cd dist | |
mkdir vol | |
mv OpenNumismat.app vol | |
ln -s /Applications vol/Applications | |
hdiutil create ${{ needs.title.outputs.PACKAGENAME }}-macos11.dmg -volname "${{ needs.title.outputs.PACKAGENAME }}" -srcfolder vol -fs HFSX -format UDZO -imagekey zlib-level=9 | |
cd .. | |
mv dist/${{ needs.title.outputs.PACKAGENAME }}-macos11.dmg . | |
- name: upload | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ needs.title.outputs.PACKAGENAME }}-dmg | |
path: ${{ needs.title.outputs.PACKAGENAME }}-macos11.dmg | |
if-no-files-found: error | |
prerelease: | |
name: Create pre-release | |
needs: [version, title, windows, innosetup, ubuntu, macos, cx_freeze, nuitka, nuitka_innosetup] | |
runs-on: ubuntu-latest | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v2 | |
with: | |
path: artifacts | |
- name: release | |
id: release | |
uses: marvinpinto/action-automatic-releases@latest | |
with: | |
repo_token: "${{ secrets.PAT }}" | |
automatic_release_tag: "latest" | |
prerelease: true | |
title: "Development Build" | |
- name: upload-windows | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.release.outputs.upload_url }} | |
asset_path: artifacts/${{ needs.title.outputs.PACKAGENAME }}-zip/${{ needs.title.outputs.PACKAGENAME }}.zip | |
asset_name: ${{ needs.title.outputs.PACKAGENAME }}.zip | |
asset_content_type: application/zip | |
- name: upload-innosetup | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.release.outputs.upload_url }} | |
asset_path: artifacts/${{ needs.title.outputs.PACKAGENAME }}/${{ needs.title.outputs.PACKAGENAME }}.exe | |
asset_name: ${{ needs.title.outputs.PACKAGENAME }}.exe | |
asset_content_type: application/octet-stream | |
- name: upload-cx_freeze | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.release.outputs.upload_url }} | |
asset_path: artifacts/${{ needs.title.outputs.PACKAGENAME }}-cx_freeze/${{ needs.title.outputs.PACKAGENAME }}.zip | |
asset_name: ${{ needs.title.outputs.PACKAGENAME }}-cx_freeze.zip | |
asset_content_type: application/octet-stream | |
- name: upload-nuitka | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.release.outputs.upload_url }} | |
asset_path: artifacts/${{ needs.title.outputs.PACKAGENAME }}-nuitka/${{ needs.title.outputs.PACKAGENAME }}.zip | |
asset_name: ${{ needs.title.outputs.PACKAGENAME }}-nuitka.zip | |
asset_content_type: application/octet-stream | |
- name: upload-nuitka-innosetup | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.release.outputs.upload_url }} | |
asset_path: artifacts/${{ needs.title.outputs.PACKAGENAME }}-nuitka-innosetup/${{ needs.title.outputs.PACKAGENAME }}.exe | |
asset_name: ${{ needs.title.outputs.PACKAGENAME }}-nuitka.exe | |
asset_content_type: application/octet-stream | |
- name: upload-ubuntu | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.release.outputs.upload_url }} | |
asset_path: artifacts/${{ needs.title.outputs.PACKAGENAME }}-deb/open-numismat_${{ needs.version.outputs.VERSION }}.${{ needs.version.outputs.REVISION }}_all.deb | |
asset_name: open-numismat_${{ needs.version.outputs.VERSION }}.${{ needs.version.outputs.REVISION }}_all.deb | |
asset_content_type: application/octet-stream | |
- name: upload-macos | |
uses: actions/upload-release-asset@v1 | |
with: | |
upload_url: ${{ steps.release.outputs.upload_url }} | |
asset_path: artifacts/${{ needs.title.outputs.PACKAGENAME }}-dmg/${{ needs.title.outputs.PACKAGENAME }}-macos11.dmg | |
asset_name: ${{ needs.title.outputs.PACKAGENAME }}-macos11.dmg | |
asset_content_type: application/octet-stream |