Skip to content

Commit

Permalink
Modified CI pyinstaller run to work from source, not sdist.
Browse files Browse the repository at this point in the history
  • Loading branch information
mliberty1 committed Jun 8, 2023
1 parent dff4fe0 commit a1fc321
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 36 deletions.
36 changes: 11 additions & 25 deletions .github/workflows/packaging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ jobs:
python -m pip install --upgrade pip
python -m pip install build wheel pytest
- name: Build sdist
run: python -m build --sdist
- name: Build package
run: python -m build --no-isolation

- name: Install the wheel
- name: Install package
run: python -m pip install -f dist joulescope_ui

- name: Run python unit tests
Expand All @@ -78,26 +78,16 @@ jobs:

build_installers:
name: Build on ${{ matrix.os }}
if: github.event_name == 'push' # self-hosted windows installer, security concern
needs:
- build_sdist
if: github.event_name == 'push'
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu-latest", "windows-latest", "macos-latest"]

steps:
- name: Download sdist
uses: actions/download-artifact@v3
with:
name: sdist
path: dist/

- name: Find sdist filename
shell: bash
id: find_sdist_filename
run: echo "filename=$(ls dist/*.tar.gz)" >> $GITHUB_OUTPUT
- name: Checkout repo
uses: actions/checkout@v3

- name: Set up Python
uses: actions/setup-python@v4
Expand All @@ -108,22 +98,17 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: sudo apt install -y libudev-dev libusb-1.0-0-dev qt6-base-dev qt6-3d-dev

- name: Install the Joulescope UI package
run: python -m pip install -f dist joulescope_ui
- name: Build package
run: python -m build --no-isolation

- name: Find python path
shell: bash
id: find_python
run: |
UI_PATH=$(python -c "import joulescope_ui, os; print(os.path.dirname(joulescope_ui.__file__))")
echo "filename=$UI_PATH" >> $GITHUB_OUTPUT
- name: Install package
run: python -m pip install -f dist joulescope_ui

- name: Install pyinstaller
run: python -m pip install pyinstaller

- name: Build installer
run: pyinstaller joulescope.spec
working-directory: ${{steps.find_python.outputs.filename}}

- name: Upload installer
uses: actions/upload-artifact@v3
Expand All @@ -136,6 +121,7 @@ jobs:
name: Publish installers
if: github.event_name == 'push' && startswith(github.ref, 'refs/tags/v')
needs:
- build_sdist
- build_installers
runs-on: ubuntu-latest
permissions:
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,5 @@ include CHANGELOG.md
include CREDITS.html
include LICENSE.txt
include README.md
include joulescope.iss
include joulescope.spec
recursive-include joulescope_ui *.svg *.json *.qss *.rcc *.html *.md *.txt *.py
include joulescope_ui/test/*.jls
8 changes: 0 additions & 8 deletions joulescope.spec
Original file line number Diff line number Diff line change
Expand Up @@ -199,18 +199,10 @@ if sys.platform.startswith('darwin'):
'--deep', './dist/joulescope.app'],
cwd=specpath)

# subprocess.run(['hdiutil', 'create', './dist/joulescope_%s.dmg' % VERSION_STR,
# '-srcfolder', './dist/joulescope.app', '-ov'],
# cwd=specpath)
print('create dmg')
dmg_file = 'install/joulescope_%s.dmg' % VERSION_STR
subprocess.run(['./node_modules/appdmg/bin/appdmg.js', 'appdmg.json', dmg_file])

# xcrun altool --notarize-app --primary-bundle-id "com.jetperch.joulescope" --username "matt.liberty@jetperch.com" --password "@keychain:Developer-altool" --file "dist/joulescope_0_9_11.dmg"
# xcrun altool --notarization-info "7c927036-3c17-4f03-ba24-d49420b1e81d" --username "matt.liberty@jetperch.com" --password "@keychain:Developer-altool"
# spctl -a -t open --context context:primary-signature dmg_file
# xcrun stapler staple dist/joulescope_0_9_11.dmg

elif sys.platform == 'win32':
if is_ci:
shutil.make_archive(f'install/joulescope_{VERSION_STR}.zip', 'zip', 'dist/joulescope')
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
# Always prefer setuptools over distutils
import setuptools
from setuptools.command.sdist import sdist
from setuptools.command.install import install
from setuptools.command.develop import develop
import os
import platform
Expand Down

0 comments on commit a1fc321

Please sign in to comment.