Skip to content

Commit

Permalink
Merge pull request #464 from loathingKernel/develop
Browse files Browse the repository at this point in the history
Rare: enforce utf-8 encoding in some places, should fix subtle issues on Windows
  • Loading branch information
loathingKernel authored Oct 10, 2024
2 parents 4081b36 + 829632f commit 71e2bcd
Show file tree
Hide file tree
Showing 19 changed files with 266 additions and 60 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/job_cx-freeze-zip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ jobs:
run: cxfreeze -c rare/main.py --target-dir dist --target-name rare --icon rare/resources/images/Rare.ico -OO --base-name Win32GUI
- name: Compress
run: |
python -c "import shutil; shutil.make_archive('Rare-Windows', 'zip', 'dist')"
python -c "import shutil; shutil.make_archive('Rare', 'zip', 'rare.dist')"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Rare-Windows-${{ inputs.version }}.zip
path: Rare-Windows.zip
name: Rare-portable-windows-${{ inputs.version }}.zip
path: Rare.zip
70 changes: 70 additions & 0 deletions .github/workflows/job_nuitka-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: job_nuitka-linux

on:
workflow_call:
inputs:
version:
required: true
type: string

jobs:
build:
name: Build
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
cache: pip
python-version: '3.12'
check-latest: true
architecture: x64
- name: Install build dependencies
run: pip3 install nuitka ordered-set
- name: Install target dependencies
run: |
pip3 install -r requirements.txt
pip3 install -r requirements-presence.txt
- name: Build
run: >-
python -m nuitka
--assume-yes-for-downloads
--lto=no
--jobs=4
--static-libpython=no
--standalone
--enable-plugin=anti-bloat
--enable-plugin=pyside6
--show-modules
--show-anti-bloat-changes
--follow-stdlib
--follow-imports
--nofollow-import-to="*.tests"
--nofollow-import-to="*.distutils"
--nofollow-import-to="distutils"
--nofollow-import-to="unittest"
--nofollow-import-to="pydoc"
--nofollow-import-to="tkinter"
--nofollow-import-to="test"
--prefer-source-code
--include-package=pypresence
--include-package-data=qtawesome
--include-data-dir=rare/resources/images/=rare/resources/images/
--include-data-files=rare/resources/languages/rare_*.qm=rare/resources/languages/
--windows-icon-from-ico=rare/resources/images/Rare.png
--windows-company-name=RareDevs
--windows-product-name=Rare
--windows-file-description=rare.exe
--windows-file-version=${{ inputs.version }}
--windows-product-version=${{ inputs.version }}
--windows-console-mode=disable
rare
- name: Compress
run: |
python -c "import shutil; shutil.make_archive('Rare', 'zip', 'rare.dist')"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Rare-portable-linux-${{ inputs.version }}.zip
path: Rare.zip
71 changes: 71 additions & 0 deletions .github/workflows/job_nuitka-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: job_nuitka-macos

on:
workflow_call:
inputs:
version:
required: true
type: string

jobs:
build:
name: Build
runs-on: "macos-latest"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
cache: pip
python-version: '3.12'
check-latest: true
architecture: x64
- name: Install build dependencies
run: pip3 install nuitka ordered-set
- name: Install target dependencies
run: |
pip3 install -r requirements.txt
pip3 install -r requirements-presence.txt
- name: Build
run: >-
python -m nuitka
--assume-yes-for-downloads
--clang
--lto=no
--jobs=4
--static-libpython=no
--standalone
--enable-plugin=anti-bloat
--enable-plugin=pyside6
--show-modules
--show-anti-bloat-changes
--follow-stdlib
--follow-imports
--nofollow-import-to="*.tests"
--nofollow-import-to="*.distutils"
--nofollow-import-to="distutils"
--nofollow-import-to="unittest"
--nofollow-import-to="pydoc"
--nofollow-import-to="tkinter"
--nofollow-import-to="test"
--prefer-source-code
--include-package=pypresence
--include-package-data=qtawesome
--include-data-dir=rare/resources/images/=rare/resources/images/
--include-data-files=rare/resources/languages/rare_*.qm=rare/resources/languages/
--windows-icon-from-ico=rare/resources/images/Rare.icns
--windows-company-name=RareDevs
--windows-product-name=Rare
--windows-file-description=rare.exe
--windows-file-version=${{ inputs.version }}
--windows-product-version=${{ inputs.version }}
--windows-console-mode=disable
rare
- name: Compress
run: |
python -c "import shutil; shutil.make_archive('Rare', 'zip', 'rare.dist')"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Rare-portable-macos-${{ inputs.version }}.zip
path: Rare.zip
10 changes: 5 additions & 5 deletions .github/workflows/job_nuitka-win.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
python -m nuitka
--assume-yes-for-downloads
--msvc=latest
--lto=yes
--lto=no
--jobs=4
--static-libpython=no
--standalone
Expand All @@ -51,7 +51,7 @@ jobs:
--include-package=pypresence
--include-package-data=qtawesome
--include-data-dir=rare\resources\images\=rare\resources\images\
--include-data-files=rare\resources\languages\=rare\resources\languages\="rare_*.qm"
--include-data-files=rare\resources\languages\rare_*.qm=rare\resources\languages\
--windows-icon-from-ico=rare\resources\images\Rare.ico
--windows-company-name=RareDevs
--windows-product-name=Rare
Expand All @@ -62,10 +62,10 @@ jobs:
rare
- name: Compress
run: |
python -c "import shutil; shutil.make_archive('Rare-Windows', 'zip', 'rare.dist')"
python -c "import shutil; shutil.make_archive('Rare', 'zip', 'rare.dist')"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: Rare-Windows-${{ inputs.version }}.zip
path: Rare-Windows.zip
name: Rare-portable-windows-${{ inputs.version }}.zip
path: Rare.zip
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: job_release
name: job_publish

on:
workflow_call:
Expand All @@ -21,7 +21,7 @@ on:

jobs:
release:
name: Upload
name: Publish
runs-on: ubuntu-latest
strategy:
matrix:
Expand Down
59 changes: 45 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
ubuntu-release:
needs: ubuntu
name: Ubuntu
uses: ./.github/workflows/job_release.yml
uses: ./.github/workflows/job_publish.yml
with:
version: ${{ github.ref_name }}
file1: Rare.deb
Expand All @@ -49,28 +49,58 @@ jobs:
appimage-release:
needs: appimage
name: AppImage
uses: ./.github/workflows/job_release.yml
uses: ./.github/workflows/job_publish.yml
with:
version: ${{ github.ref_name }}
file1: Rare.AppImage
name1: Rare-${{ github.ref_name }}.AppImage
file2: Rare.AppImage.zsync
name2: Rare-${{ github.ref_name }}.AppImage.zsync

nuitka-win:
if: ${{ false }}
nuitka-windows:
if: ${{ true }}
name: Nuitka Windows
uses: ./.github/workflows/job_nuitka-win.yml
with:
version: ${{ github.ref_name }}
nuitka-win-release:
needs: nuitka-win
nuitka-windows-release:
needs: nuitka-windows
name: Nuitka Windows
uses: ./.github/workflows/job_release.yml
uses: ./.github/workflows/job_publish.yml
with:
version: ${{ github.ref_name }}
file1: Rare.zip
name1: Rare-portable-windows-${{ github.ref_name }}.zip

nuitka-linux:
if: ${{ true }}
name: Nuitka Linux
uses: ./.github/workflows/job_nuitka-linux.yml
with:
version: ${{ github.ref_name }}
nuitka-linux-release:
needs: nuitka-linux
name: Nuitka Linux
uses: ./.github/workflows/job_publish.yml
with:
version: ${{ github.ref_name }}
file1: Rare-Windows.zip
name1: Rare-Windows-${{ github.ref_name }}.zip
file1: Rare.zip
name1: Rare-portable-linux-${{ github.ref_name }}.zip

nuitka-macos:
if: ${{ true }}
name: Nuitka MacOS
uses: ./.github/workflows/job_nuitka-macos.yml
with:
version: ${{ github.ref_name }}
nuitka-macos-release:
needs: nuitka-macos
name: Nuitka MacOS
uses: ./.github/workflows/job_publish.yml
with:
version: ${{ github.ref_name }}
file1: Rare.zip
name1: Rare-portable-macos-${{ github.ref_name }}.zip

cx-freeze-msi:
name: cx-Freeze msi
Expand All @@ -80,25 +110,26 @@ jobs:
cx-freeze-msi-release:
needs: cx-freeze-msi
name: cx-Freeze msi
uses: ./.github/workflows/job_release.yml
uses: ./.github/workflows/job_publish.yml
with:
version: ${{ github.ref_name }}
file1: Rare.msi
name1: Rare-${{ github.ref_name }}.msi

cx-freeze-zip:
if: ${{ false }}
name: cx-Freeze zip
uses: ./.github/workflows/job_cx-freeze-zip.yml
with:
version: ${{ github.ref_name }}
cx-freeze-zip-release:
needs: cx-freeze-zip
name: cx-Freeze zip
uses: ./.github/workflows/job_release.yml
uses: ./.github/workflows/job_publish.yml
with:
version: ${{ github.ref_name }}
file1: Rare-Windows.zip
name1: Rare-Windows-${{ github.ref_name }}.zip
file1: Rare.zip
name1: Rare-portable-windows-${{ github.ref_name }}.zip

macos:
name: macOS
Expand All @@ -108,7 +139,7 @@ jobs:
macos-release:
needs: macos
name: macOS
uses: ./.github/workflows/job_release.yml
uses: ./.github/workflows/job_publish.yml
with:
version: ${{ github.ref_name }}
file1: Rare.dmg
Expand Down
Loading

0 comments on commit 71e2bcd

Please sign in to comment.