Build Executable #13
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 Executable | |
on: | |
workflow_dispatch: | |
jobs: | |
build_UI: | |
runs-on: windows-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install -r requirements-local.txt --target . | |
pip install cx_Freeze | |
- name: Build the executable with setupUI.py | |
run: | | |
python setupUI.py build | |
- name: Zip the GUI executable | |
run: | | |
powershell Compress-Archive -Path build\exe.win-amd64-3.12\* -DestinationPath AstroDwarfScheduler-GUI.zip | |
- name: Upload zipped GUI executable | |
uses: actions/upload-artifact@v4 | |
with: | |
name: AstroDwarfScheduler-GUI | |
path: AstroDwarfScheduler-GUI.zip | |
build_console: | |
runs-on: windows-latest | |
needs: build_UI | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
pip install -r requirements-local.txt --target . | |
pip install cx_Freeze | |
- name: Build the executable with setupCMD.py | |
run: | | |
python setupCMD.py build | |
- name: Zip the Console executable | |
run: | | |
powershell Compress-Archive -Path build\exe.win-amd64-3.12\* -DestinationPath AstroDwarfScheduler-Console.zip | |
- name: Upload zipped Console executable | |
uses: actions/upload-artifact@v4 | |
with: | |
name: AstroDwarfScheduler-Console | |
path: AstroDwarfScheduler-Console.zip | |
release: | |
runs-on: ubuntu-latest | |
needs: [build_UI, build_console] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Download UI executable artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: AstroDwarfScheduler-GUI | |
- name: Download Console executable artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: AstroDwarfScheduler-Console | |
- name: Get version from CHANGELOG.md | |
id: get_version | |
run: echo "RVERSION=$(grep -oP '(?<=## \[)[^]]*' CHANGELOG.md | head -n 1)" >> $GITHUB_ENV | |
- name: Check for files | |
id: checkfiles | |
run: ls /home/runner/work/astro_dwarf_session/astro_dwarf_session/ | |
- name: Release with ncipollo/release-action | |
id: release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: AstroDwarfScheduler* | |
token: ${{ secrets.GITHUB_TOKEN }} | |
generateReleaseNotes: true | |
skipIfReleaseExists: true | |
tag: v${{ env.RVERSION }} |