Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build and release workflows #90

Open
wants to merge 18 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 31 additions & 10 deletions .github/workflows/build-macos.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,44 @@
name: Build macOS
run-name: Build macOS
on:
push:
tags:
- "**"
# on:
# push
push:
tags:
- "**"

jobs:
Build-macOS:
runs-on: macos-latest
steps:
# Use Python 3.12.4
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.12.4"
- run: pip install -r requirements.txt && pip install pyinstaller && python3 helper_scripts/package_mac.py && mkdir src/dist/Qtcord-macOS && mv src/dist/Qtcord-macOS.app src/dist/Qtcord-macOS
- uses: actions/upload-artifact@v4

- name: Install dependencies and build
run: |
pip install -r requirements.txt
pip install pyinstaller
python3 helper_scripts/package_mac.py

- name: Prepare release artifacts
run: |
mkdir -p src/dist/Qtcord-macOS

# Create .dmg file
brew install create-dmg
create-dmg \
--volname "Qtcord" \
--window-pos 200 120 \
--window-size 800 400 \
--icon-size 100 \
--app-drop-link 600 185 \
Qtcord-${{github.ref_name}}-macOS-x86_64.dmg \
src/dist/Qtcord-macOS.app

- name: Upload Release Assets
uses: softprops/action-gh-release@v1
with:
name: "Qtcord-macOS"
path: "src/dist/Qtcord-macOS"
files: |
Qtcord-${{github.ref_name}}-macOS-x86_64.zip
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the zip file is being uploaded, where did it go?
image

Qtcord-${{github.ref_name}}-macOS-x86_64.dmg
24 changes: 18 additions & 6 deletions .github/workflows/build-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,30 @@ on:
push:
tags:
- "**"
# on: [push]

jobs:
Build-Windows:
runs-on: windows-latest
steps:
# Use Python 3.12.4
- uses: actions/checkout@v4

- uses: actions/setup-python@v5
with:
python-version: "3.12.4"
- run: pip install -r requirements.txt && pip install pyinstaller && python3 helper_scripts/package_windows.py
- uses: actions/upload-artifact@v4

- name: Install dependencies and build
run: |
pip install -r requirements.txt
pip install pyinstaller
python3 helper_scripts/package_windows.py
pyinstaller helper_scripts/win.spec
mak448a marked this conversation as resolved.
Show resolved Hide resolved

- name: Rename and Compress Executable
run: |
Move-Item -Path ".\dist\Qtcord-Windows\Qtcord.exe" -Destination ".\Qtcord-${{github.ref_name}}-Windows-x86_64.exe"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image

Copy link
Owner

@mak448a mak448a Dec 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you forget to include everything in the folder Qtcord-Windows? Dependencies are stored in there.

Compress-Archive -Path ".\Qtcord-${{github.ref_name}}-Windows-x86_64.exe" -DestinationPath ".\Qtcord-${{github.ref_name}}-Windows-x86_64.zip"

- name: Upload Release Asset
uses: softprops/action-gh-release@v1
with:
name: "Qtcord-Windows"
path: "src/dist/Qtcord-Windows"
files: "Qtcord-${{github.ref_name}}-Windows-x86_64.zip"
38 changes: 38 additions & 0 deletions main.spec
mak448a marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# -*- mode: python ; coding: utf-8 -*-


a = Analysis(
['src\\main.py'],
pathex=[],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)

exe = EXE(
pyz,
a.scripts,
a.binaries,
a.datas,
[],
name='main',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
upx_exclude=[],
runtime_tmpdir=None,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
44 changes: 44 additions & 0 deletions package_mac.spec
mak448a marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# -*- mode: python ; coding: utf-8 -*-


a = Analysis(
['helper_scripts\\package_mac.py'],
pathex=[],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)

exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='package_mac',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
coll = COLLECT(
exe,
a.binaries,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='package_mac',
)
44 changes: 44 additions & 0 deletions package_windows.spec
mak448a marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
# -*- mode: python ; coding: utf-8 -*-


a = Analysis(
['helper_scripts\\package_windows.py'],
pathex=[],
binaries=[],
datas=[],
hiddenimports=[],
hookspath=[],
hooksconfig={},
runtime_hooks=[],
excludes=[],
noarchive=False,
optimize=0,
)
pyz = PYZ(a.pure)

exe = EXE(
pyz,
a.scripts,
[],
exclude_binaries=True,
name='package_windows',
debug=False,
bootloader_ignore_signals=False,
strip=False,
upx=True,
console=True,
disable_windowed_traceback=False,
argv_emulation=False,
target_arch=None,
codesign_identity=None,
entitlements_file=None,
)
coll = COLLECT(
exe,
a.binaries,
a.datas,
strip=False,
upx=True,
upx_exclude=[],
name='package_windows',
)