Skip to content

Commit

Permalink
Merge pull request #737 from shauneccles/fix/debug_ci_builds
Browse files Browse the repository at this point in the history
feat: Enable console for non-prod CI builds
  • Loading branch information
shauneccles committed Feb 12, 2024
2 parents 42ae655 + 37fa578 commit 34351d4
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 15 deletions.
15 changes: 12 additions & 3 deletions .github/workflows/test-build-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -537,13 +537,22 @@ jobs:
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Download LedFx Version
uses: actions/download-artifact@v4
with:
name: ledfx_version.txt
path: dist/
- name: Get LedFx Version
id: ledfx-version
run: |
echo ledfx-version=$(cat dist/ledfx_version.txt) >> $GITHUB_OUTPUT
rm -rf dist/ledfx_version.txt
- name: Create Sentry release
uses: getsentry/action-release@v1
env:
SENTRY_AUTH_TOKEN: ${{ secrets.SENTRY_AUTH_TOKEN_V2 }}
SENTRY_ORG: ledfx
SENTRY_ORG: ledfx-org
SENTRY_PROJECT: ledfx-v2-rel
with:
environment: production
version: ${{ github.ref }}
version: ${{ steps.ledfx-version.outputs.ledfx-version }}
14 changes: 8 additions & 6 deletions hiddenimports.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
hiddenimports = [
"sacn",
"mido",
"mido.frozen",
"rtmidi.midiutil",
"mido.backends.rtmidi",
"paho",
"paho.mqtt",
"paho.mqtt.client",
"pystray._win32",
"python-rtmidi",
"rtmidi",
"samplerate",
"samplerate._src",
"samplerate._samplerate_data",
"sounddevice",
"_sounddevice_data",
"serial",
Expand All @@ -35,4 +29,12 @@
"PIL.Image",
"PIL.ImageDraw",
"PIL.ImageEnhance",
"sentry_sdk.integrations.stdlib",
"sentry_sdk.integrations.excepthook",
"sentry_sdk.integrations.dedupe",
"sentry_sdk.integrations.atexit",
"sentry_sdk.integrations.modules",
"sentry_sdk.integrations.argv",
"sentry_sdk.integrations.logging",
"sentry_sdk.integrations.threading",
]
6 changes: 4 additions & 2 deletions osx-binary.spec
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,16 @@ venv_root = os.path.abspath(os.path.join(SPECPATH, '..'))
block_cipher = None


# if this is a release, create prod.env for the packaged binaries to read from
# if this is a release, create prod.env for the packaged binaries to read from and hide the console
github_ref = os.getenv('GITHUB_REF')
if github_ref and 'refs/tags/' in github_ref:
with open('prod.env', 'w') as file:
file.write('IS_RELEASE = true')
SHOW_CONSOLE = False
else:
with open('prod.env', 'w') as file:
file.write('IS_RELEASE = false')
SHOW_CONSOLE = True


a = Analysis([f'{spec_root}/ledfx/__main__.py'],
Expand All @@ -41,7 +43,7 @@ exe = EXE(pyz,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False,
console=SHOW_CONSOLE,
icon=f'{spec_root}/ledfx_assets/discord.ico')

app = BUNDLE(exe,
Expand Down
9 changes: 5 additions & 4 deletions windows-binary.spec
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,18 @@ spec_root = os.path.abspath(SPECPATH)

venv_root = os.path.abspath(os.path.join(SPECPATH, '..'))
block_cipher = None
print(venv_root)

# if this is a release, create prod.env for the packaged binaries to read from

# if this is a release, create prod.env for the packaged binaries to read from and hide the console
github_ref = os.getenv('GITHUB_REF')
if github_ref and 'refs/tags/' in github_ref:
with open('prod.env', 'w') as file:
file.write('IS_RELEASE = true')
SHOW_CONSOLE = False
else:
with open('prod.env', 'w') as file:
file.write('IS_RELEASE = false')

SHOW_CONSOLE = True
a = Analysis([f'{spec_root}\\ledfx\\__main__.py'],
pathex=[f'{spec_root}', f'{spec_root}\\ledfx'],
binaries=[],
Expand All @@ -39,7 +40,7 @@ exe = EXE(pyz,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=False,
console=SHOW_CONSOLE,
icon=f'{spec_root}\\ledfx_assets\\discord.ico')
coll = COLLECT(exe,
a.binaries,
Expand Down

0 comments on commit 34351d4

Please sign in to comment.