Update build.yml #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build Bundle | |
on: | |
push: | |
branches: | |
- main | |
release: | |
types: | |
- published | |
jobs: | |
build: | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: bash | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
- name: Install Poetry | |
uses: snok/install-poetry@v1 | |
with: | |
virtualenvs-create: true | |
virtualenvs-in-project: true | |
- name: Install dependencies | |
run: poetry install --no-interaction | |
- name: Show version | |
id: show-version | |
run: echo version=$(poetry version --short) >> "$GITHUB_OUTPUT" | |
- name: Build bundle | |
run: poetry run pyinstaller main.spec | |
- name: Upload bundle to artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: google-cloud-gui_${{ steps.show-version.outputs.version }} | |
path: dist/google-cloud-gui | |
- name: Create release bundle | |
if: ${{ github.event_name == 'release' }} | |
uses: TheDoctor0/[email protected] | |
with: | |
filename: google-cloud-gui_${{ steps.show-version.outputs.version }}.zip | |
path: dist/google-cloud-gui | |
- name: Upload bundle to release | |
if: ${{ github.event_name == 'release' }} | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
file: google-cloud-gui_${{ steps.show-version.outputs.version }}.zip |