diff --git a/.github/workflows/bundle.yml b/.github/workflows/bundle.yml index af6d49b8..152517d4 100644 --- a/.github/workflows/bundle.yml +++ b/.github/workflows/bundle.yml @@ -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 @@ -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" diff --git a/scripts/bundle.ps1 b/scripts/bundle.ps1 index 26eb6f12..db4eda9b 100644 --- a/scripts/bundle.ps1 +++ b/scripts/bundle.ps1 @@ -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" diff --git a/scripts/bundle.sh b/scripts/bundle.sh index 93cd6bda..0f7d84da 100644 --- a/scripts/bundle.sh +++ b/scripts/bundle.sh @@ -44,3 +44,6 @@ build/.venv/bin/pyinstaller \ chmod +x dist/whombat + +# Zip the executable file +zip -r dist/whombat.zip dist/whombat