deploy #1
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: deploy | |
| on: | |
| workflow_dispatch: | |
| workflow_call: | |
| concurrency: | |
| group: deploy | |
| cancel-in-progress: true | |
| defaults: | |
| run: | |
| shell: bash | |
| jobs: | |
| prepare: | |
| runs-on: ubuntu-24.04 | |
| outputs: | |
| nuitka: ${{ steps.extract.outputs.nuitka }} | |
| version: ${{ steps.extract.outputs.version }} | |
| name: ${{ steps.extract.outputs.name }} | |
| author: ${{ steps.extract.outputs.author }} | |
| signature: ${{ steps.extract.outputs.signature }} | |
| steps: | |
| - uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 # v4.2.2 | |
| - name: Extract necessary build info | |
| id: extract | |
| run: | | |
| NUITKA_VERSION=$(awk -F'nuitka==|"' '/nuitka==/ { print $3 }' pyproject.toml) | |
| echo "nuitka=$NUITKA_VERSION" >> $GITHUB_OUTPUT | |
| APP_VERSION=$(awk -F\" '/^__version__ =/ { print $2 }' src/version.py) | |
| echo "version=$APP_VERSION" >> $GITHUB_OUTPUT | |
| APP_NAME=$(awk -F'"' '/^EXECUTABLE_NAME =/ { print $2 }' src/config/metadata.py) | |
| echo "name=$APP_NAME" >> $GITHUB_OUTPUT | |
| AUTHOR_NAME=$(awk -F'"' '/^AUTHOR_NAME =/ { print $2 }' src/config/metadata.py) | |
| echo "author=$AUTHOR_NAME" >> $GITHUB_OUTPUT | |
| AUTHOR_DOMAIN=$(awk -F'"' '/^AUTHOR_DOMAIN =/ { print $2 }' src/config/metadata.py) | |
| REVERSED_DOMAIN=$(echo "${AUTHOR_DOMAIN,,}" | awk -F. '{ for (i=NF; i>0; i--) printf "%s%s", $i, (i==1 ? "" : ".") }') | |
| SIGNATURE="${REVERSED_DOMAIN}.${APP_NAME,,}" | |
| echo "signature=$SIGNATURE" >> $GITHUB_OUTPUT | |
| macos: | |
| needs: [prepare] | |
| runs-on: macos-15 | |
| steps: | |
| - uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 # v4.2.2 | |
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
| with: | |
| python-version-file: "pyproject.toml" | |
| cache: "pip" | |
| - name: Install dependencies | |
| run: pip install .[build] | |
| - name: Build artifact | |
| uses: Nuitka/Nuitka-Action@8462c393e3dfa2bea614d9f448f989c88ad9f9e4 # v1.3.0 | |
| with: | |
| nuitka-version: ${{ needs.prepare.outputs.nuitka }} | |
| script-name: src/main.py | |
| mode: app | |
| include-data-dir: src/resources=resources | |
| macos-app-icon: src/resources/icons/logo.png | |
| macos-signed-app-name: ${{ needs.prepare.outputs.signature }} | |
| macos-app-name: ${{ needs.prepare.outputs.name }} | |
| macos-app-version: ${{ needs.prepare.outputs.version }} | |
| product-version: ${{ needs.prepare.outputs.version }} | |
| file-version: ${{ needs.prepare.outputs.version }} | |
| company-name: ${{ needs.prepare.outputs.author }} | |
| product-name: ${{ needs.prepare.outputs.name }} | |
| file-description: ${{ needs.prepare.outputs.name }} app, created by ${{ needs.prepare.outputs.author }}. | |
| output-dir: build | |
| enable-plugins: pyside6 | |
| - name: Rename build | |
| working-directory: build | |
| run: mv main.app ${{ needs.prepare.outputs.name }}.app | |
| - name: Zip build | |
| working-directory: build | |
| run: zip -r MacOS.zip ${{ needs.prepare.outputs.name }}.app | |
| - name: Append build to release | |
| working-directory: build | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| GH_REPO: ${{ github.repository }} | |
| run: gh release upload --clobber v${{ needs.prepare.outputs.version }} MacOS.zip | |
| linux: | |
| needs: [prepare] | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 # v4.2.2 | |
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
| with: | |
| python-version-file: "pyproject.toml" | |
| cache: "pip" | |
| - name: Install dependencies | |
| run: pip install .[build] | |
| - name: Build artifact | |
| uses: Nuitka/Nuitka-Action@8462c393e3dfa2bea614d9f448f989c88ad9f9e4 # v1.3.0 | |
| with: | |
| nuitka-version: ${{ needs.prepare.outputs.nuitka }} | |
| script-name: src/main.py | |
| mode: app | |
| include-data-dir: src/resources=resources | |
| linux-icon: src/resources/icons/logo.png | |
| product-version: ${{ needs.prepare.outputs.version }} | |
| file-version: ${{ needs.prepare.outputs.version }} | |
| company-name: ${{ needs.prepare.outputs.author }} | |
| product-name: ${{ needs.prepare.outputs.name }} | |
| file-description: ${{ needs.prepare.outputs.name }} app, created by ${{ needs.prepare.outputs.author }}. | |
| output-dir: build | |
| enable-plugins: pyside6 | |
| clang: true | |
| static-libpython: yes | |
| - name: Rename build | |
| working-directory: build | |
| run: mv main.bin ${{ needs.prepare.outputs.name }}.bin | |
| - name: Zip build | |
| working-directory: build | |
| run: zip -r Linux.zip ${{ needs.prepare.outputs.name }}.bin | |
| - name: Append build to release | |
| working-directory: build | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| GH_REPO: ${{ github.repository }} | |
| run: gh release upload --clobber v${{ needs.prepare.outputs.version }} Linux.zip | |
| windows: | |
| needs: [prepare] | |
| runs-on: windows-2025 | |
| steps: | |
| - uses: actions/checkout@85e6279cec87321a52edac9c87bce653a07cf6c2 # v4.2.2 | |
| - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0 | |
| with: | |
| python-version-file: "pyproject.toml" | |
| cache: "pip" | |
| - name: Install dependencies | |
| run: pip install .[build] | |
| - name: Build binaries | |
| uses: Nuitka/Nuitka-Action@8462c393e3dfa2bea614d9f448f989c88ad9f9e4 # v1.3.0 | |
| with: | |
| nuitka-version: ${{ needs.prepare.outputs.nuitka }} | |
| script-name: src/main.py | |
| mode: app | |
| include-data-dir: src/resources=resources | |
| windows-icon-from-ico: src/resources/icons/logo.png | |
| windows-console-mode: disable | |
| product-version: ${{ needs.prepare.outputs.version }} | |
| file-version: ${{ needs.prepare.outputs.version }} | |
| company-name: ${{ needs.prepare.outputs.author }} | |
| product-name: ${{ needs.prepare.outputs.name }} | |
| file-description: ${{ needs.prepare.outputs.name }} app, created by ${{ needs.prepare.outputs.author }}. | |
| output-dir: build | |
| enable-plugins: pyside6 | |
| - name: Rename build | |
| working-directory: build | |
| run: mv main.exe ${{ needs.prepare.outputs.name }}.exe | |
| - name: Zip build | |
| shell: pwsh | |
| working-directory: build | |
| run: Compress-Archive -Path ${{ needs.prepare.outputs.name }}.exe -DestinationPath Windows.zip | |
| - name: Append build to release | |
| working-directory: build | |
| env: | |
| GH_TOKEN: ${{ github.token }} | |
| GH_REPO: ${{ github.repository }} | |
| run: gh release upload --clobber v${{ needs.prepare.outputs.version }} Windows.zip |