Skip to content

Commit

Permalink
print directories on mac test
Browse files Browse the repository at this point in the history
  • Loading branch information
rfresh2 committed Feb 14, 2024
1 parent bef0619 commit b098047
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 84 deletions.
90 changes: 6 additions & 84 deletions .github/workflows/act-build-launcher.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,8 @@ env:
python_version: '3.12'

jobs:
build-matrix:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ 'ubuntu-20.04' ]
include:
- os: 'ubuntu-20.04'
artifact-name: 'launcher-linux-amd64'
move-command: 'mv dist/__main__ dist/launch'
zip-command: 'zip -j dist/ZenithProxy-launcher-linux-amd64.zip dist/launch'
sha1-command: 'sha1sum -b dist/launch | cut -d" " -f 1'
build:
runs-on: 'macos-14'
steps:
- name: Check out repository
uses: actions/checkout@v4
Expand All @@ -34,82 +24,14 @@ jobs:
- name: Build launcher
run: |
pyinstaller --specpath ./build -p ./src/launcher --onefile --noconfirm ./src/launcher/__main__.py
- name: Rename executable
run: |
${{ matrix.move-command }}
pyinstaller --specpath ./build --onefile --noconfirm ./src/launcher/directories.py
- name: Create zip
run: |
${{ matrix.zip-command }}
zip -j dist/directories.zip dist/directories
- name: Upload Binary
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.artifact-name }}
path: dist/ZenithProxy-${{ matrix.artifact-name }}.zip

- name: Get Binary Hash
run: ${{ matrix.sha1-command }} > ZenithProxy-${{ matrix.artifact-name }}.sha1

- name: Upload Launcher Hash Version
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.artifact-name }}.sha1
path: ZenithProxy-${{ matrix.artifact-name }}.sha1

package-python:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Create Python executable zip
run: zip -j launcher-py.zip src/launcher/*.py

- name: Elevate script permissions
run: |
chmod +x src/launcher/launch.sh
- name: Create release zip
run: zip -j ZenithProxy-launcher-python.zip launcher-py.zip src/launcher/requirements.txt src/launcher/launch.sh src/launcher/launch.bat

- name: Upload Artifact
uses: actions/upload-artifact@v3
with:
name: launcher-python
path: ZenithProxy-launcher-python.zip

- name: Get Binary Hash
run: sha1sum -b launcher-py.zip | cut -d" " -f 1 > ZenithProxy-launcher-python.sha1

- name: Upload Launcher Hash Version
uses: actions/upload-artifact@v3
with:
name: launcher-python.sha1
path: ZenithProxy-launcher-python.sha1

release-artifacts:
needs:
- build-matrix
- package-python
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Download job artifacts
uses: actions/download-artifact@v3
with:
path: artifacts/

- name: Compile Hashes
run: |
cat artifacts/**/*.sha1 > hashes.txt
- name: Upload Hashes Version
uses: actions/upload-artifact@v3
with:
name: hashes.txt
path: hashes.txt
path: dist/directories.zip
20 changes: 20 additions & 0 deletions src/launcher/directories.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env python3
import os
import sys

frozen = 'not'
if getattr(sys, 'frozen', False):
# we are running in a bundle
frozen = 'ever so'
bundle_dir = sys._MEIPASS
else:
# we are running in a normal Python environment
bundle_dir = os.path.dirname(os.path.abspath(__file__))
print( 'we are',frozen,'frozen')
print( 'bundle dir is', bundle_dir )
print( 'sys.argv[0] is', sys.argv[0] )
print( 'sys.executable is', sys.executable )
print( 'os.getcwd is', os.getcwd() )

while True:
pass

0 comments on commit b098047

Please sign in to comment.