Skip to content

Commit

Permalink
Zip executable before uploading
Browse files Browse the repository at this point in the history
  • Loading branch information
mbsantiago committed Jan 11, 2024
1 parent 2e3638f commit 51bab95
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 58 deletions.
110 changes: 52 additions & 58 deletions .github/workflows/bundle.yml
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
name: Bundle App
on:
workflow_dispatch:
# release:
# types: [published]
release:
types: [published]

jobs:
# build-windows:
# runs-on: windows-latest
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-python@v4
# with:
# python-version: "3.11"
# - uses: actions/setup-node@v4
# with:
# node-version: 21
# - shell: pwsh
# run: scripts/update_front.ps1
# - shell: pwsh
# run: scripts/update_guide.ps1
# - shell: pwsh
# run: scripts/bundle.ps1
# - run: |
# mkdir dist/
# mv "back/dist/whombat.exe" "dist/whombat-windows-${{ github.ref_name }}.exe"
# - uses: shogo82148/actions-upload-release-asset@v1
# with:
# upload_url: ${{ github.event.release.upload_url }}
# asset_path: "dist/whombat-windows-${{ github.ref_name }}.exe"
build-windows:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- uses: actions/setup-node@v4
with:
node-version: 21
- shell: pwsh
run: scripts/update_front.ps1
- shell: pwsh
run: scripts/update_guide.ps1
- shell: pwsh
run: scripts/bundle.ps1
- run: |
mkdir dist/
mv "back/dist/whombat.zip" "dist/whombat-windows-${{ github.ref_name }}.zip"
- uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: "dist/whombat-windows-${{ github.ref_name }}.zip"

build-ubuntu:
runs-on: ubuntu-20.04
Expand All @@ -43,36 +42,31 @@ jobs:
- run: make build-frontend
- run: make build-guide
- run: make bundle-pyinstaller
- uses: actions/upload-artifact@v4
- run: |
mkdir dist/
mv back/dist/whombat.zip "dist/whombat-ubuntu-${{ github.ref_name }}.zip"
- uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: "dist/whombat-ubuntu-${{ github.ref_name }}.zip"

build-macos:
runs-on: macos-11
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: "3.11"
- uses: actions/setup-node@v4
with:
node-version: 21
- run: make build-frontend
- run: make build-guide
- run: make bundle-pyinstaller
- run: |
mkdir dist/
mv back/dist/whombat.zip "dist/whombat-macos-${{ github.ref_name }}.zip"
- uses: shogo82148/actions-upload-release-asset@v1
with:
name: whombat-ubuntu
path: back/dist/whombat
# - run: |
# mkdir dist/
# mv back/dist/whombat "dist/whombat-ubuntu-${{ github.ref_name }}"
# - uses: shogo82148/actions-upload-release-asset@v1
# with:
# upload_url: ${{ github.event.release.upload_url }}
# asset_path: "dist/whombat-ubuntu-${{ github.ref_name }}"
#
# build-macos:
# runs-on: macos-11
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-python@v4
# with:
# python-version: "3.11"
# - uses: actions/setup-node@v4
# with:
# node-version: 21
# - run: make build-frontend
# - run: make build-guide
# - run: make bundle-pyinstaller
# - run: |
# mkdir dist/
# chmod +x "back/dist/whombat"
# mv back/dist/whombat "dist/whombat-macos-${{ github.ref_name }}"
# - uses: shogo82148/actions-upload-release-asset@v1
# with:
# upload_url: ${{ github.event.release.upload_url }}
# asset_path: "dist/whombat-macos-${{ github.ref_name }}"
upload_url: ${{ github.event.release.upload_url }}
asset_path: "dist/whombat-macos-${{ github.ref_name }}.zip"
4 changes: 4 additions & 0 deletions scripts/bundle.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,7 @@ build\.venv\Scripts\pyinstaller `
--name whombat `
--onefile `
app.py


# Zip the executable file
Compress-Archive -Path "dist\whombat.exe" -DestinationPath "dist\whombat.zip"
3 changes: 3 additions & 0 deletions scripts/bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,6 @@ build/.venv/bin/pyinstaller \


chmod +x dist/whombat

# Zip the executable file
zip -r dist/whombat.zip dist/whombat

0 comments on commit 51bab95

Please sign in to comment.