Build Windows binary #154
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
# This workflow will build a PyOxidizer binary for Windows when a tag is pushed | |
name: Build Windows binary | |
env: | |
PYOXIDIZER_DOWNLOAD: https://github.com/indygreg/PyOxidizer/releases/download/pyoxidizer%2F0.20.0/PyOxidizer-0.20.0-exe-x86_64-pc-windows.zip | |
on: | |
workflow_dispatch: {} | |
workflow_call: | |
push: | |
tags: | |
- '*' | |
release: | |
types: [published] | |
jobs: | |
build: | |
runs-on: windows-2019 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.9' | |
- name: Determine App Version | |
working-directory: client/ | |
run: | | |
python ..\.github\scripts\get_version.py | |
echo "${{ env.APP_VERSION }}" | |
- name: Setup PyOxidizer and build | |
env: | |
PYAPP_FULL_ISOLATION: 1 | |
PYAPP_PROJECT_NAME: gefyra | |
PYAPP_EXEC_SPEC: gefyra.cli.main:main | |
PYAPP_PIP_EXTRA_ARGS: click alive-progress tabulate cli-tracker | |
PYAPP_DISTRIBUTION_EMBED: 1 | |
working-directory: client/ | |
run: | | |
Invoke-WebRequest 'https://github.com/ofek/pyapp/releases/latest/download/source.tar.gz' -OutFile .\pyapp-source.tar.gz | |
7z x pyapp-source.tar.gz | |
7z x pyapp-source.tar | |
mv pyapp-v* pyapp-latest | |
cd pyapp-latest | |
ls | |
cargo build --release | |
mkdir ..\dist | |
xcopy .\target\release\pyapp.exe ..\dist /s /e /k /i /y | |
copy README.md ../dist/ | |
ls ../dist | |
- name: Upload Artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: gefyra-${{ env.APP_VERSION }}-windows-x86_64 | |
path: | | |
client/dist/ | |
retention-days: 5 | |
- name: Create release zip | |
working-directory: client/ | |
if: ${{ github.event.release && github.event.action == 'published' }} | |
run: 7z a -r gefyra-${{ env.APP_VERSION }}-windows-x86_64.zip "dist/" | |
- name: Attach files to release | |
uses: softprops/action-gh-release@v2 | |
if: ${{ github.event.release && github.event.action == 'published' }} | |
with: | |
files: client/gefyra-${{ env.APP_VERSION }}-windows-x86_64.zip |