From 4a190b856d7a3fff2a0b08c0ba015449c5271f12 Mon Sep 17 00:00:00 2001 From: Shane <6071159+smashedr@users.noreply.github.com> Date: Tue, 23 Dec 2025 20:44:55 -0800 Subject: [PATCH 1/7] Update Build 2 --- .github/workflows/pyinstaller.yaml | 13 ++++++++----- pyproject.toml | 4 ++-- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/.github/workflows/pyinstaller.yaml b/.github/workflows/pyinstaller.yaml index f13affc..3431ae3 100644 --- a/.github/workflows/pyinstaller.yaml +++ b/.github/workflows/pyinstaller.yaml @@ -86,9 +86,10 @@ jobs: if: ${{ matrix.os == 'windows-latest' && inputs.windows-file }} shell: bash run: | - uv run pyivf-make_version --source-format yaml \ - --metadata-source "${{ inputs.windows-file }}" \ - --outfile win-version.txt --version "0.${{ inputs.version }}" + #uv run pyivf-make_version --source-format yaml \ + # --metadata-source "${{ inputs.windows-file }}" \ + # --outfile win-version.txt --version "0.${{ inputs.version }}" + uvx toml-run win-version - name: "Debug Windows Version" if: ${{ matrix.os == 'windows-latest' }} @@ -100,7 +101,8 @@ jobs: - name: "Build" shell: bash run: | - uv run pyinstaller -F -n sharex -i docs/favicon.ico ${{ matrix.extra-args }} ${{ inputs.source-file }} + #uv run pyinstaller -F -n npmstat -i docs/favicon.ico ${{ matrix.extra-args }} ${{ inputs.source-file }} + uvx toml-run pyinstaller -- ${{ matrix.extra-args }} - name: "List Artifacts" continue-on-error: true @@ -115,6 +117,7 @@ jobs: echo -e "${md}" >> "$GITHUB_STEP_SUMMARY" - name: "Archive Release" + if: ${{ github.event_name == 'release' }} uses: thedoctor0/zip-release@0.7.5 with: type: zip @@ -126,7 +129,7 @@ jobs: uses: actions/upload-artifact@v5 with: name: ${{ matrix.name }} - path: "dist" + path: dist - name: "Upload Release" if: ${{ github.event_name == 'release' }} diff --git a/pyproject.toml b/pyproject.toml index 2b7630a..c1ffdf5 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -111,8 +111,8 @@ extend-exclude = [".github"] select = ["E4", "E7", "E9", "F", "B", "Q"] [tool.scripts] -version = "pyivf-make_version --source-format yaml --metadata-source .github/files/win-version.yaml --outfile win-version.txt" -install = "pyinstaller -F -n npmstat -i docs/favicon.ico src/app.py" +win-version = "pyivf-make_version --source-format yaml --metadata-source .github/files/win-version.yaml --outfile win-version.txt" +pyinstaller = "pyinstaller -F -n npmstat -i docs/favicon.ico src/app.py" test = ["coverage run -m pytest", "coverage report -m"] build = "uv run hatch build" predocs = "rm -rf .cache site" From bd63c5340181c3113ce5f9b0d405716f7b1cf07d Mon Sep 17 00:00:00 2001 From: Shane <6071159+smashedr@users.noreply.github.com> Date: Tue, 23 Dec 2025 20:49:57 -0800 Subject: [PATCH 2/7] uv run --- pyproject.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c1ffdf5..bc4b737 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -111,8 +111,8 @@ extend-exclude = [".github"] select = ["E4", "E7", "E9", "F", "B", "Q"] [tool.scripts] -win-version = "pyivf-make_version --source-format yaml --metadata-source .github/files/win-version.yaml --outfile win-version.txt" -pyinstaller = "pyinstaller -F -n npmstat -i docs/favicon.ico src/app.py" +win-version = "uv run pyivf-make_version --source-format yaml --metadata-source .github/files/win-version.yaml --outfile win-version.txt" +pyinstaller = "uv run pyinstaller -F -n npmstat -i docs/favicon.ico src/app.py" test = ["coverage run -m pytest", "coverage report -m"] build = "uv run hatch build" predocs = "rm -rf .cache site" From af613d830ffb12a52e97f8a590215de415396646 Mon Sep 17 00:00:00 2001 From: Shane <6071159+smashedr@users.noreply.github.com> Date: Tue, 23 Dec 2025 20:57:05 -0800 Subject: [PATCH 3/7] win version --- .github/workflows/pyinstaller.yaml | 2 +- .gitignore | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/pyinstaller.yaml b/.github/workflows/pyinstaller.yaml index 3431ae3..2703d0f 100644 --- a/.github/workflows/pyinstaller.yaml +++ b/.github/workflows/pyinstaller.yaml @@ -89,7 +89,7 @@ jobs: #uv run pyivf-make_version --source-format yaml \ # --metadata-source "${{ inputs.windows-file }}" \ # --outfile win-version.txt --version "0.${{ inputs.version }}" - uvx toml-run win-version + uvx toml-run win-version -- --version "0.${{ inputs.version }}" - name: "Debug Windows Version" if: ${{ matrix.os == 'windows-latest' }} diff --git a/.gitignore b/.gitignore index fe9839d..b74a4d7 100644 --- a/.gitignore +++ b/.gitignore @@ -9,7 +9,7 @@ __pycache__/ build/ dist/ .*cache/ -/.*cache* +.*cache* *.log *.pyc .coverage @@ -17,4 +17,5 @@ coverage.xml # App /site/ /test*.* +*.spec win-version.txt From 2a0899e2a7613c706cb49da46d9ead88c9cbc864 Mon Sep 17 00:00:00 2001 From: Shane <6071159+smashedr@users.noreply.github.com> Date: Tue, 23 Dec 2025 21:05:46 -0800 Subject: [PATCH 4/7] win version clean --- .github/workflows/pyinstaller.yaml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/pyinstaller.yaml b/.github/workflows/pyinstaller.yaml index 2703d0f..f435025 100644 --- a/.github/workflows/pyinstaller.yaml +++ b/.github/workflows/pyinstaller.yaml @@ -86,10 +86,7 @@ jobs: if: ${{ matrix.os == 'windows-latest' && inputs.windows-file }} shell: bash run: | - #uv run pyivf-make_version --source-format yaml \ - # --metadata-source "${{ inputs.windows-file }}" \ - # --outfile win-version.txt --version "0.${{ inputs.version }}" - uvx toml-run win-version -- --version "0.${{ inputs.version }}" + uvx toml-run win-version -- --version "${{ inputs.version }}.0" - name: "Debug Windows Version" if: ${{ matrix.os == 'windows-latest' }} @@ -101,7 +98,6 @@ jobs: - name: "Build" shell: bash run: | - #uv run pyinstaller -F -n npmstat -i docs/favicon.ico ${{ matrix.extra-args }} ${{ inputs.source-file }} uvx toml-run pyinstaller -- ${{ matrix.extra-args }} - name: "List Artifacts" From 5102fa583e00416e7a98bea89de96a2c32cafc56 Mon Sep 17 00:00:00 2001 From: Shane <6071159+smashedr@users.noreply.github.com> Date: Tue, 23 Dec 2025 22:01:31 -0800 Subject: [PATCH 5/7] win version clean --- .github/workflows/pyinstaller.yaml | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pyinstaller.yaml b/.github/workflows/pyinstaller.yaml index f435025..9878d9f 100644 --- a/.github/workflows/pyinstaller.yaml +++ b/.github/workflows/pyinstaller.yaml @@ -82,11 +82,29 @@ jobs: run: | cat ${{ inputs.version-file }} + - name: "Version" + id: version + shell: python + run: | + import os + from packaging.version import Version + version = Version('${{ inputs.version }}') + try: + pre_number = version.pre[1] if version.pre else 0 + except Exception as e: + pre_number = 0 + print(f"{pre_number=}") + with open(os.environ["GITHUB_OUTPUT"], "a") as f: + f.write(f"pre_number={pre_number}\n") + f.write(f"base_version={version.base_version}\n") + - name: "Windows Version" if: ${{ matrix.os == 'windows-latest' && inputs.windows-file }} + env: + version: "${{ steps.version.outputs.base_version }}.${{ steps.version.outputs.pre_number || '0' }}" shell: bash run: | - uvx toml-run win-version -- --version "${{ inputs.version }}.0" + uvx toml-run win-version -- --version "${{ env.version }}" - name: "Debug Windows Version" if: ${{ matrix.os == 'windows-latest' }} From d9a7d2103c700ae81b339118e8fbd4513b081a82 Mon Sep 17 00:00:00 2001 From: Shane <6071159+smashedr@users.noreply.github.com> Date: Tue, 23 Dec 2025 22:08:51 -0800 Subject: [PATCH 6/7] win version update --- .github/workflows/pyinstaller.yaml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/pyinstaller.yaml b/.github/workflows/pyinstaller.yaml index 9878d9f..526694f 100644 --- a/.github/workflows/pyinstaller.yaml +++ b/.github/workflows/pyinstaller.yaml @@ -89,19 +89,17 @@ jobs: import os from packaging.version import Version version = Version('${{ inputs.version }}') - try: - pre_number = version.pre[1] if version.pre else 0 - except Exception as e: - pre_number = 0 + print(f"{version.base_version=}") + pre_number = version.pre[1] if version.pre else 0 print(f"{pre_number=}") with open(os.environ["GITHUB_OUTPUT"], "a") as f: - f.write(f"pre_number={pre_number}\n") f.write(f"base_version={version.base_version}\n") + f.write(f"pre_number={pre_number}\n") - name: "Windows Version" if: ${{ matrix.os == 'windows-latest' && inputs.windows-file }} env: - version: "${{ steps.version.outputs.base_version }}.${{ steps.version.outputs.pre_number || '0' }}" + version: "${{ steps.version.outputs.base_version }}.${{ steps.version.outputs.pre_number }}" shell: bash run: | uvx toml-run win-version -- --version "${{ env.version }}" From e26c91cf3917ece4c4823d150b2d480bd24a6390 Mon Sep 17 00:00:00 2001 From: Shane <6071159+smashedr@users.noreply.github.com> Date: Tue, 23 Dec 2025 22:14:00 -0800 Subject: [PATCH 7/7] cleanup --- .github/workflows/pyinstaller.yaml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/pyinstaller.yaml b/.github/workflows/pyinstaller.yaml index 526694f..b0c683c 100644 --- a/.github/workflows/pyinstaller.yaml +++ b/.github/workflows/pyinstaller.yaml @@ -76,13 +76,14 @@ jobs: initpy-files: ${{ inputs.version-file }} - name: "Debug Version" - if: ${{ matrix.os == 'windows-latest' }} continue-on-error: true shell: bash run: | cat ${{ inputs.version-file }} - name: "Version" + # Note: packaging is not available on macos-latest by default + if: ${{ matrix.os == 'windows-latest' && inputs.windows-file }} id: version shell: python run: | @@ -128,6 +129,13 @@ jobs: md="Artifacts: \`${{ matrix.os }}\`\n\`\`\`text\n${results}\n\`\`\`" echo -e "${md}" >> "$GITHUB_STEP_SUMMARY" + - name: "Upload to Actions" + if: ${{ github.event_name != 'release' }} + uses: actions/upload-artifact@v5 + with: + name: ${{ matrix.name }} + path: dist + - name: "Archive Release" if: ${{ github.event_name == 'release' }} uses: thedoctor0/zip-release@0.7.5 @@ -136,13 +144,6 @@ jobs: directory: dist filename: "${{ matrix.name }}.zip" - - name: "Upload to Actions" - if: ${{ github.event_name != 'release' }} - uses: actions/upload-artifact@v5 - with: - name: ${{ matrix.name }} - path: dist - - name: "Upload Release" if: ${{ github.event_name == 'release' }} uses: cssnr/upload-release-action@latest