Release v1.1.6 #31
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 ${{ matrix.os }}_${{ github.ref_name }}_cmd-release | |
- name: List dist directory # debug | |
run: ls -R dist | |
- name: PyInstaller (CLI) # debug | |
run: pyinstaller --onefile --icon=images/icon.ico versions/cli_args.py --name ${{ matrix.os }}_${{ github.ref_name }}_cli-release | |
- name: List dist directory | |
run: ls -R dist | |
- name: Tar files on Linux | |
if: ${{ matrix.os == 'ubuntu-latest' }} | |
run: | | |
chmod +x dist/${{ matrix.os }}_${{ github.ref_name }}_cmd-release | |
chmod +x dist/${{ matrix.os }}_${{ github.ref_name }}_cli-release | |
tar -czvf dist/${{ matrix.os }}_${{ github.ref_name }}_cmd.tar.gz dist/${{ matrix.os }}_${{ github.ref_name }}_cmd-release | |
tar -czvf dist/${{ matrix.os }}_${{ github.ref_name }}_cli.tar.gz dist/${{ matrix.os }}_${{ github.ref_name }}_cli-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, '_') }} | |
steps: | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: release-artifacts | |
pattern: "*_dists" | |
- name: List release-artifacts directory # debug | |
run: ls -R release-artifacts | |
- name: Draft normal release | |
uses: ncipollo/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
generateReleaseNotes: true | |
tag: ${{ github.ref_name }} | |
artifacts: release-artifacts/*_${{ github.ref_name }}_* | |
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 artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: release-artifacts | |
pattern: "*_dists" | |
- name: List release-artifacts directory # debug | |
run: ls -R release-artifacts | |
- name: Draft CMDGUI release | |
uses: ncipollo/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
generateReleaseNotes: true | |
tag: ${{ github.ref_name }} | |
artifacts: release-artifacts/*_${{ github.ref_name }}_cmd* | |
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 artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: release-artifacts | |
pattern: "*_dists" | |
- name: List release-artifacts directory # debug | |
run: ls -R release-artifacts | |
- name: Draft CLI release | |
uses: ncipollo/[email protected] | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
generateReleaseNotes: true | |
tag: ${{ github.ref_name }} | |
artifacts: release-artifacts/*_${{ github.ref_name }}_cli* | |
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'." |