Skip to content

Commit

Permalink
Update build spec and script
Browse files Browse the repository at this point in the history
  • Loading branch information
JWCook committed Dec 6, 2023
1 parent b1876c9 commit be2b31f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
18 changes: 13 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'

Expand Down Expand Up @@ -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 .
Expand All @@ -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 .
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packaging/naturtag.spec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit be2b31f

Please sign in to comment.