From be2b31f985735b52f829fc7c45e128eec620c5a5 Mon Sep 17 00:00:00 2001 From: Jordan Cook Date: Wed, 6 Dec 2023 01:07:51 -0600 Subject: [PATCH] Update build spec and script --- .github/workflows/deploy.yml | 18 +++++++++++++----- packaging/naturtag.spec | 2 +- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e40f1246..a571990d 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -13,6 +13,11 @@ on: description: 'Version number for pre-release package (defaults to build number)' required: false default: '' + publish: + description: 'Set to "false" to skip publishing to PyPI' + required: false + default: 'true' + env: LATEST_PY_VERSION: '3.11' @@ -61,7 +66,7 @@ jobs: - name: Finish pyinstaller package (Linux) if: ${{ matrix.os == 'ubuntu-latest' }} run: | - ASSETS=dist/naturtag/assets + ASSETS=dist/naturtag/assets/data tar -xvzf $ASSETS/taxonomy.tar.gz --directory $ASSETS/ rm $ASSETS/taxonomy.tar.gz tar -C dist/naturtag/ -czvf naturtag-linux.tar.gz . @@ -70,7 +75,7 @@ jobs: - name: Finish pyinstaller package (macOS) if: ${{ matrix.os == 'macos-latest' }} run: | - ASSETS=dist/naturtag.app/Contents/Resources/assets + ASSETS=dist/naturtag.app/Contents/Resources/assets/data tar -xvzf $ASSETS/taxonomy.tar.gz --directory $ASSETS/ rm $ASSETS/taxonomy.tar.gz tar -C dist/naturtag/ -czvf naturtag-macos.tar.gz . @@ -79,8 +84,9 @@ jobs: - name: Finish pyinstaller package (Windows) if: ${{ matrix.os == 'windows-latest' }} run: | - tar -xvzf dist/naturtag/assets/taxonomy.tar.gz --directory dist/naturtag/assets/ - rm dist/naturtag/assets/taxonomy.tar.gz + ASSETS=dist/naturtag/assets/data + tar -xvzf $ASSETS/taxonomy.tar.gz --directory $ASSETS/ + rm $ASSETS/taxonomy.tar.gz tar -C dist/naturtag/ -czvf naturtag-windows.tar.gz . echo "DIST_NAME=windows" >> $GITHUB_ENV @@ -144,7 +150,9 @@ jobs: # Publish python package to PyPI release-pypi-package: - if: startsWith(github.ref, 'refs/tags/v') || github.event.inputs.pre-release-suffix + if: | + github.event.inputs.publish == 'true' + && (startsWith(github.ref, 'refs/tags/v') || github.event.inputs.pre-release-suffix) runs-on: ubuntu-latest permissions: id-token: write diff --git a/packaging/naturtag.spec b/packaging/naturtag.spec index 100fef70..48ded376 100644 --- a/packaging/naturtag.spec +++ b/packaging/naturtag.spec @@ -2,7 +2,7 @@ from pathlib import Path from PyInstaller.compat import is_darwin, is_linux, is_win -BUILD_PY_VERSION = '3.10' +BUILD_PY_VERSION = '3.11' PROJECT_NAME = 'naturtag' PROJECT_DIR = Path('.').absolute() ASSETS_DIR = PROJECT_DIR / 'assets'