Release v1.1.1 #18
Workflow file for this run
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: Release Python app | ||
run-name: Release ${{ github.ref_name }} | ||
on: | ||
push: | ||
tags: | ||
- "v*" | ||
permissions: | ||
contents: write | ||
jobs: | ||
build: | ||
name: Build app on ${{ matrix.os }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: ["windows-latest", "macos-latest", "ubuntu-latest"] | ||
steps: | ||
- name: Checkout ref | ||
uses: actions/checkout@v4 | ||
- name: Setup Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.11 | ||
- name: Install requirements | ||
run: | | ||
pip install -r requirements.txt | ||
pip install pyinstaller | ||
- name: PyInstaller (Terminal GUI) | ||
run: pyinstaller --onefile --icon=images/icon.ico versions/terminal_gui.py | ||
- name: List dist directory | ||
run: ls -R dist | ||
- name: PyInstaller (CLI) | ||
run: pyinstaller --onefile --icon=images/icon.ico versions/cli_args.py | ||
- name: List dist directory | ||
run: ls -R dist | ||
- name: Rename artifacts on Mac & Linux first | ||
if: ${{ matrix.os != 'windows-latest' }} | ||
run: | | ||
cd dist | ||
mv terminal_gui ${{ matrix.os }}_${{ github.ref_name }}_cmdgui-release | ||
mv cli_args ${{ matrix.os }}_${{ github.ref_name }}_cmdline-release | ||
- name: Upload debug builds | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.os }}_builds | ||
path: build/ | ||
- name: Upload distributable builds | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ matrix.os }}_dists | ||
path: dist/ | ||
normal_release: | ||
name: Draft normal release | ||
runs-on: ubuntu-latest | ||
needs: build | ||
if: '!contains(github.ref_name, "_")' | ||
Check failure on line 69 in .github/workflows/release.yml GitHub Actions / Release Python appInvalid workflow file
|
||
steps: | ||
- name: Download Windows artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: windows-latest_dist | ||
path: release-artifacts | ||
- name: Download MacOS artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: macos-latest_dist | ||
path: release-artifacts | ||
- name: Download Linux artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ubuntu-latest_dist | ||
path: release-artifacts | ||
- name: List release-artifacts directory # debug | ||
run: ls -R release-artifacts | ||
- name: Rename Windows artifacts | ||
run: | | ||
cd release-artifacts | ||
mv terminal_window.exe windows-latest_${{ github.ref_name }}_cmdgui-release.exe | ||
mv cli_args.exe windows-latest_${{ github.ref_name }}_cmdline-release.exe | ||
- name: Draft normal release | ||
uses: ncipollo/release-action@v1.14.0 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
generateReleaseNotes: true | ||
tag: ${{ github.ref_name }} | ||
artifacts: release-artifacts/*_${{ github.ref_name }}_*-release* | ||
draft: true | ||
name: "Release ${{ github.ref_name }}" | ||
body: "If you're using the CLI, we recommend renaming the artifact to something shorter, like 'translator-CLI'." | ||
release_cmdgui: | ||
name: Draft CMDGUI release | ||
runs-on: ubuntu-latest | ||
needs: build | ||
if: endsWith(github.ref_name, '_CMDGUI') | ||
steps: | ||
- name: Download Windows artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: windows-latest_dists | ||
path: release-artifacts | ||
- name: Download MacOS artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: macos-latest_dists | ||
path: release-artifacts | ||
- name: Download Linux artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ubuntu-latest_dists | ||
path: release-artifacts | ||
- name: List release-artifacts directory # debug | ||
run: ls -R release-artifacts | ||
- name: Rename Windows artifacts | ||
run: | | ||
cd release-artifacts | ||
mv terminal_gui.exe windows-latest_${{ github.ref_name }}_cmdgui-release.exe | ||
- name: Draft CMDGUI release | ||
uses: ncipollo/release-action@v1.14.0 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
generateReleaseNotes: true | ||
tag: ${{ github.ref_name }} | ||
artifacts: release-artifacts/*_${{ github.ref_name }}_cmdgui-release* | ||
draft: true | ||
name: "CMDGUI Release ${{ github.ref_name }}" | ||
body: "This is a CMDGUI-specific release." | ||
release_cli: | ||
name: Draft CLI release | ||
runs-on: ubuntu-latest | ||
needs: build | ||
if: endsWith(github.ref_name, '_CLI') | ||
steps: | ||
- name: Download Windows artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: windows-latest_dists | ||
path: release-artifacts | ||
- name: Download MacOS artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: macos-latest_dists | ||
path: release-artifacts | ||
- name: Download Linux artifact | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: ubuntu-latest_dists | ||
path: release-artifacts | ||
- name: List release-artifacts directory # debug | ||
run: ls -R release-artifacts | ||
- name: Rename Windows artifacts | ||
run: | | ||
cd release-artifacts | ||
mv cli_args.exe windows-latest_${{ github.ref_name }}_cmdline-release.exe | ||
- name: Draft CLI release | ||
uses: ncipollo/release-action@v1.14.0 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
generateReleaseNotes: true | ||
tag: ${{ github.ref_name }} | ||
artifacts: release-artifacts/*_${{ github.ref_name }}_cmdline-release* | ||
draft: true | ||
name: "CLI Release ${{ github.ref_name }}" | ||
body: "This is a CLI-specific release. We recommend renaming the artifact to something shorter, like 'translator-CLI'." |