Skip to content

Commit

Permalink
Changed: Specify own steps for pyinstaller build
Browse files Browse the repository at this point in the history
The version that `JackMcKew/pyinstaller-action-windows@main` etc.
uses has a [bug](psf/requests#6331)
with its `charset_normalizer`/`chardet` hooks.
Now we specify the pyinstaller steps ourselves and use the newest
version available on Python 3.10.
  • Loading branch information
nilfoer committed Nov 6, 2023
1 parent 4b8b18a commit 0e19f2f
Showing 1 changed file with 66 additions and 30 deletions.
96 changes: 66 additions & 30 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,11 @@ on:
tags:
- 'v*'
jobs:
build:
runs-on: ubuntu-latest
build_win:
runs-on: windows-latest
steps:
- uses: actions/checkout@v4

- name: Package Source
run: |
mkdir dist/
python3 dev_tools/build_zip_dist.py . dist/GWARipper-${{github.ref_name}}.zip
- name: Get date
run: echo "date_year=$(date +'%Y')" >> "$GITHUB_ENV"

Expand All @@ -31,40 +26,81 @@ jobs:
# only download deps if we don't have a cached version
- if: ${{ steps.cache-binary-deps.outputs.cache-hit != 'true' }}
name: Download binary deps Windows
name: Download binary deps
run: |
mkdir binary_deps
wget -O ffmpeg.zip https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip
unzip ffmpeg.zip -d binary_deps/
find binary_deps/ffmpeg*-essentials_build/ -name ffmpeg.exe -exec cp {} binary_deps/ \;
rm -rf binary_deps/ffmpeg*-essentials_build/
rm ffmpeg.zip
Invoke-WebRequest https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip -OutFile ffmpeg.zip
Expand-Archive -Path ffmpeg.zip -DestinationPath .\binary_deps
Get-ChildItem -r -Filter ffmpeg.exe ./binary_deps/ | % { Copy-Item -Path $_.FullName -Destination ./binary_deps/ }
Remove-Item -Recurse -Force binary_deps/ffmpeg*-essentials_build/
Remove-Item ffmpeg.zip
- uses: actions/setup-python@v4
with:
python-version: '3.10'

# output (dir named 'gwaripper') will be in dist/windows
- name: Package Application on Windows
uses: JackMcKew/pyinstaller-action-windows@main
- name: Build PyInstaller single folder dist
run: |
python -m pip install -r requirements.txt
python -m pip install --upgrade pip pyinstaller
pyinstaller --clean -y --dist ./dist/windows/ --workpath /tmp gwaripper.spec
- name: Updload windows build
uses: actions/upload-artifact@v3
with:
path: .
spec: gwaripper.spec
name: GWARipper-${{github.ref_name}}_single-folder_win-x64
path: dist/windows/gwaripper

build_lin:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Bundle Windows
# # only download deps if we don't have a cached version
# - if: ${{ steps.cache-binary-deps.outputs.cache-hit != 'true' }}
# name: Download binary deps Windows
# run: |
# mkdir binary_deps
# wget -O ffmpeg.zip https://www.gyan.dev/ffmpeg/builds/ffmpeg-release-essentials.zip
# unzip ffmpeg.zip -d binary_deps/
# find binary_deps/ffmpeg*-essentials_build/ -name ffmpeg.exe -exec cp {} binary_deps/ \;
# rm -rf binary_deps/ffmpeg*-essentials_build/
# rm ffmpeg.zip

- uses: actions/setup-python@v4
with:
python-version: '3.10'

# output (dir named 'gwaripper') will be in dist/windows
- name: Build PyInstaller single folder dist
run: |
pushd dist/windows/gwaripper
zip -r ../../GWARipper-${{github.ref_name}}_single-folder_win-x64.zip .
popd
python -m pip install --upgrade pip pyinstaller
python -m pip install -r requirements.txt
pyinstaller --clean -y --dist ./dist/linux/ --workpath /tmp gwaripper.spec
mv ./dist/linux/gwaripper ./dist/linux/GWARipper-${{github.ref_name}}_single-folder_lin-x64
# output (dir named 'gwaripper') will be in dist/linux
- name: Package Application on Linux
uses: JackMcKew/pyinstaller-action-linux@main
- name: Updload linux build
uses: actions/upload-artifact@v3
with:
path: .
spec: gwaripper.spec
name: GWARipper-${{github.ref_name}}_single-folder_lin-x64
path: dist/linux/GWARipper-${{github.ref_name}}_single-folder_lin-x64

- name: Bundle Linux
release:
runs-on: ubuntu-latest
needs: [build_win, build_lin]
steps:
- uses: actions/checkout@v4

- name: Package Source
run: |
pushd dist/linux/gwaripper
zip -r ../../GWARipper-${{github.ref_name}}_single-folder_lin-x64.zip .
popd
mkdir dist/
python3 dev_tools/build_zip_dist.py . dist/GWARipper-${{github.ref_name}}.zip
- name: Download builds # downloads all artifacts in a workflow if name omitted
uses: actions/download-artifact@v3
with:
path: dist/

- name: Release
uses: softprops/action-gh-release@v1
Expand Down

0 comments on commit 0e19f2f

Please sign in to comment.