Skip to content

Commit

Permalink
chore(ci): Switch to release action, add linux back
Browse files Browse the repository at this point in the history
Signed-off-by: yshalsager <[email protected]>
  • Loading branch information
yshalsager committed Aug 18, 2022
1 parent 717db42 commit 53f682d
Show file tree
Hide file tree
Showing 4 changed files with 187 additions and 47 deletions.
106 changes: 60 additions & 46 deletions .github/workflows/ci.yml → .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,15 @@
name: Package Application with cx_Freeze

on:
push:
branches: [ master, dev ]
tags: [ v* ]
pull_request:
branches: [ master, dev ]
# workflow_dispatch:
# inputs:
# version-win:
# description: "Version(semver)"
# required: true
# default: "X.X"
workflow_dispatch:
inputs:
version:
description: "Version (semantic)"
required: true
default: "X.X"

jobs:
build-windows:
if: github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' && ${{ !contains(github.event.head_commit.message, '(deps') }}
runs-on: windows-latest
strategy:
matrix:
Expand All @@ -38,14 +32,14 @@ jobs:
Invoke-WebRequest https://github.com/GyanD/codexffmpeg/releases/download/5.1/ffmpeg-5.1-essentials_build.zip -O ffmpeg.zip
tar.exe -xf ffmpeg.zip
move ffmpeg-5.1-essentials_build/bin/ffmpeg.exe ffmpeg.exe
move ffmpeg-5.1-essentials_build/bin/ffprobe.exe ffprobe.exe
- run: python setup.py build -b dist
- run: tar.exe -acf dist.zip dist
- run: tar.exe -acf TranscribeArabic-${{ runner.os }}-${{ matrix.architecture }}-portable.zip dist
- uses: actions/upload-artifact@v3
with:
name: TranscribeArabic-${{ runner.os }}-${{ matrix.architecture }}-portable.zip
path: dist.zip
name: TranscribeArabic-${{ runner.os }}-${{ matrix.architecture }}-portable
path: TranscribeArabic-${{ runner.os }}-${{ matrix.architecture }}-portable.zip
build-windows-msi:
if: github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' && ${{ !contains(github.event.head_commit.message, '(deps') }}
runs-on: windows-latest
strategy:
matrix:
Expand Down Expand Up @@ -73,38 +67,14 @@ jobs:
Invoke-WebRequest https://github.com/GyanD/codexffmpeg/releases/download/5.1/ffmpeg-5.1-essentials_build.zip -O ffmpeg.zip
tar.exe -xf ffmpeg.zip
move ffmpeg-5.1-essentials_build/bin/ffmpeg.exe ffmpeg.exe
move ffmpeg-5.1-essentials_build/bin/ffprobe.exe ffprobe.exe
- run: python setup.py build bdist_msi
# - run: mv 'dist/*.msi' TranscribeArabic-${{ runner.os }}-${{ matrix.architecture }}.msi
- uses: actions/upload-artifact@v3
with:
name: TranscribeArabic-${{ runner.os }}-${{ matrix.architecture }}.msi
path: 'dist/*.msi'
# build-linux:
# if: github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' && ${{ !contains(github.event.head_commit.message, '(deps') }}
# runs-on: ubuntu-latest
# strategy:
# matrix:
# architecture: [ 'x64', 'x86' ]
# steps:
# - uses: actions/checkout@v3
# - uses: actions/setup-python@v4
# with:
# python-version: '3.10'
# architecture: 'x64'
# cache: 'pip'
# cache-dependency-path: 'poetry.lock'
# - name: Install requirements
# run: |
# python -m pip install --upgrade pip setuptools wheel
# pip install .
# pip install cx-Freeze
# - run: python setup.py build -b linux
# - run: tar -czvf TranscribeArabic.tar.gz linux
# - uses: actions/upload-artifact@v3
# with:
# name: TranscribeArabic-${{ runner.os }}-${{ matrix.architecture }}.zip
# path: TranscribeArabic.tar.gz
build-macos-dmg:
if: github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' && ${{ !contains(github.event.head_commit.message, '(deps') }}
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -121,12 +91,12 @@ jobs:
pip install cx-Freeze
- name: Run cx_Freeze
run: python setup.py bdist_dmg
- run: mv 'build/Install Transcribe Arabic.dmg' TranscribeArabic-macOS.dmg
- uses: actions/upload-artifact@v3
with:
name: TranscribeArabic-macOS.dmg
path: build/Install Transcribe Arabic.dmg
path: TranscribeArabic-macOS.dmg
build-macos-app:
if: github.actor != 'dependabot[bot]' && github.event_name != 'pull_request' && ${{ !contains(github.event.head_commit.message, '(deps') }}
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
Expand All @@ -143,7 +113,51 @@ jobs:
pip install cx-Freeze
- name: Run cx_Freeze
run: python setup.py bdist_mac
- run: mv build/TranscribeArabic.app TranscribeArabic-macOS.app
- run: zip -r9 TranscribeArabic-macOS-app.zip TranscribeArabic-macOS.app/*
- uses: actions/upload-artifact@v3
with:
name: TranscribeArabic-macOS.app
path: build/TranscribeArabic.app
name: TranscribeArabic-macOS-app.zip
path: TranscribeArabic-macOS-app.zip
build-linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Package CLI Application for Linux
uses: yshalsager/pyinstaller-action-linux@main
with:
path: .
spec: wit_transcriber.spec
requirements: requirements.txt
- uses: actions/upload-artifact@v3
with:
name: TranscribeArabic-Linux-CLI
path: dist/linux/wit_transcriber

- name: Package GUI Application for Linux
uses: yshalsager/pyinstaller-action-linux@tkinter
with:
path: .
spec: wit_transcriber_gui.spec
requirements: requirements.txt
tkinter: true
- uses: actions/upload-artifact@v3
with:
name: TranscribeArabic-Linux-GUI
path: dist/linux/wit_transcriber_gui
release:
runs-on: ubuntu-latest
needs: [build-windows, build-windows-msi, build-macos-dmg, build-macos-app, build-linux]
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
- name: Display structure of downloaded files
run: ls -R
- name: Release
uses: ncipollo/[email protected]
with:
allowUpdates: true
commit: 'master'
tag: ${{ github.event.inputs.version }}
name: ${{ github.event.inputs.version }}
artifacts: '*/*.msi, */*.zip, */wit_transcriber, */wit_transcriber_gui, */*.dmg'
110 changes: 109 additions & 1 deletion poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ isort = "^5.10.1"
mypy = "^0.971"
flake8 = "^5.0.4"
cx-Freeze = "^6.11.1"
pyinstaller = "^5.3"

[build-system]
requires = ["poetry-core>=1.0.0"]
Expand Down
17 changes: 17 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
anyio==3.6.1; python_full_version >= "3.6.2" and python_version >= "3.7"
awesometkinter==2021.11.8; python_version >= "3.6"
certifi==2022.6.15; python_version >= "3.7"
click==8.1.3; python_version >= "3.7"
colorama==0.4.5; python_version >= "3.7" and python_full_version < "3.0.0" and platform_system == "Windows" or platform_system == "Windows" and python_version >= "3.7" and python_full_version >= "3.5.0"
h11==0.12.0; python_version >= "3.7"
httpcore==0.15.0; python_version >= "3.7"
httpx==0.23.0; python_version >= "3.7"
idna==3.3; python_version >= "3.7" and python_full_version >= "3.6.2"
pillow==9.2.0; python_version >= "3.7"
pydub==0.25.1
python-bidi==0.4.2; python_version >= "3.6"
ratelimiter==1.2.0.post0
rfc3986==1.5.0; python_version >= "3.7"
six==1.16.0; python_version >= "3.6" and python_full_version < "3.0.0" or python_full_version >= "3.3.0" and python_version >= "3.6"
sniffio==1.2.0; python_full_version >= "3.6.2" and python_version >= "3.7"
toml==0.10.2; (python_version >= "2.6" and python_full_version < "3.0.0") or (python_full_version >= "3.3.0")

0 comments on commit 53f682d

Please sign in to comment.