Update Collection.py #4
This file contains hidden or 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: "Test build" | |
| on: | |
| push: | |
| branches-ignore: | |
| - master | |
| paths-ignore: | |
| - 'OpenNumismat/resources/i18n/*' | |
| - 'icons/*' | |
| - 'OpenNumismat/resources/resources.qrc' | |
| concurrency: | |
| group: ${{ github.workflow }} | |
| cancel-in-progress: true | |
| jobs: | |
| title: | |
| name: Title | |
| runs-on: ubuntu-latest | |
| outputs: | |
| APPNAME: OpenNumismat | |
| VERSION: ${{ steps.bump.outputs.current-version }}.${{ steps.bump.outputs.current-release }} | |
| PACKAGENAME: OpenNumismat-${{ steps.bump.outputs.current-version }}.${{ steps.bump.outputs.current-release }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.12' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install click==8.2 bump-my-version==0.32.1 | |
| - name: Get current version | |
| id: bump | |
| shell: bash | |
| run: | | |
| echo "current-version=$(bump-my-version show current_version)" >> $GITHUB_OUTPUT | |
| echo "current-release=$(bump-my-version show scm_info.distance_to_latest_tag)" >> $GITHUB_OUTPUT | |
| windows: | |
| needs: [title] | |
| name: Windows | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| submodules: 'recursive' | |
| fetch-depth: 0 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: '3.14' | |
| - name: install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| python -m pip install -r requirements.txt | |
| python -m pip install click==8.2 bump-my-version==0.32.1 pyinstaller | |
| - name: Bump pre-release version | |
| run: | | |
| bump-my-version bump pre --no-commit --allow-dirty --verbose --serialize "{major}.{minor}.{patch}.{distance_to_latest_tag}" | |
| - name: Create private keys | |
| run: | | |
| touch OpenNumismat/private_keys.py | |
| echo "FINANCE_PROXY = '${{ secrets.FINANCE_PROXY }}'" >> 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 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: Upload | |
| id: upload-portable | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{ needs.title.outputs.APPNAME }}-portable | |
| path: dist/${{ needs.title.outputs.APPNAME }}/${{ needs.title.outputs.APPNAME }}.exe | |
| if-no-files-found: error | |
| - name: Signing | |
| uses: signpath/github-action-submit-signing-request@v2 | |
| with: | |
| api-token: '${{ secrets.SIGNPATH_API_TOKEN }}' | |
| organization-id: '3b087850-3844-4d25-8407-cf81e731f8d1' | |
| project-slug: 'open-numismat' | |
| signing-policy-slug: 'test-signing' | |
| artifact-configuration-slug: 'test-zip' | |
| github-artifact-id: '${{steps.upload-portable.outputs.artifact-id}}' | |
| output-artifact-directory: dist/${{ needs.title.outputs.APPNAME }} | |
| wait-for-completion: true | |
| - name: package | |
| run: | | |
| cd dist | |
| 7z a -r ../${{ needs.title.outputs.PACKAGENAME }}.zip ${{ needs.title.outputs.APPNAME }} | |
| - name: Upload zip | |
| uses: actions/upload-artifact@v7 | |
| with: | |
| name: ${{ needs.title.outputs.PACKAGENAME }}-portable-signed | |
| path: ${{ needs.title.outputs.PACKAGENAME }}.zip | |
| if-no-files-found: error | |
| testrelease: | |
| name: Create test release | |
| needs: [title, windows] | |
| runs-on: ubuntu-latest | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| steps: | |
| - uses: actions/checkout@v7 | |
| with: | |
| fetch-depth: 0 | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v8 | |
| with: | |
| path: artifacts | |
| - name: Delete old release | |
| run: gh release delete test_build --yes --cleanup-tag || echo "Not found" | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| - name: release | |
| id: release | |
| uses: softprops/action-gh-release@v3 | |
| with: | |
| token: "${{ secrets.PAT }}" | |
| tag_name: "test_build" | |
| prerelease: true | |
| name: "Test Build" | |
| body: "For testing purposes only. Functionality, compatibility, and data integrity are not guaranteed." | |
| files: | | |
| artifacts/${{ needs.title.outputs.PACKAGENAME }}-portable-signed/${{ needs.title.outputs.PACKAGENAME }}.zip |