Skip to content

Commit

Permalink
Merge pull request #3 from mbsantiago/workflows
Browse files Browse the repository at this point in the history
Workflows
  • Loading branch information
mbsantiago authored Jan 11, 2024
2 parents 97ee9dd + 51bab95 commit ac7ba89
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 10 deletions.
15 changes: 6 additions & 9 deletions .github/workflows/bundle.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
name: Bundle App
on:
workflow_dispatch:
release:
types: [published]

Expand All @@ -23,11 +22,11 @@ jobs:
run: scripts/bundle.ps1
- run: |
mkdir dist/
mv "back/dist/whombat.exe" "dist/whombat-windows-${{ github.ref_name }}.exe"
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 }}.exe"
asset_path: "dist/whombat-windows-${{ github.ref_name }}.zip"

build-ubuntu:
runs-on: ubuntu-20.04
Expand All @@ -45,12 +44,11 @@ jobs:
- run: make bundle-pyinstaller
- run: |
mkdir dist/
chmod +x "back/dist/whombat"
mv back/dist/whombat "dist/whombat-ubuntu-${{ github.ref_name }}"
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 }}"
asset_path: "dist/whombat-ubuntu-${{ github.ref_name }}.zip"

build-macos:
runs-on: macos-11
Expand All @@ -67,9 +65,8 @@ jobs:
- run: make bundle-pyinstaller
- run: |
mkdir dist/
chmod +x "back/dist/whombat"
mv back/dist/whombat "dist/whombat-macos-${{ github.ref_name }}"
mv back/dist/whombat.zip "dist/whombat-macos-${{ github.ref_name }}.zip"
- uses: shogo82148/actions-upload-release-asset@v1
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: "dist/whombat-macos-${{ github.ref_name }}"
asset_path: "dist/whombat-macos-${{ github.ref_name }}.zip"
2 changes: 1 addition & 1 deletion back/src/whombat/database/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def create_alembic_config(db_url: str | URL, is_async: bool = True) -> Config:
db_url = make_url(db_url)
db_url = validate_database_url(db_url, is_async=is_async)

cfg = Config("alembic.ini")
cfg = Config()
cfg.set_main_option("script_location", "whombat:migrations")
cfg.set_main_option("sqlalchemy.url", db_url.render_as_string())

Expand Down
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"
6 changes: 6 additions & 0 deletions scripts/bundle.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,9 @@ build/.venv/bin/pyinstaller \
--name whombat \
--onefile \
app.py


chmod +x dist/whombat

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

0 comments on commit ac7ba89

Please sign in to comment.