GitHub release workflow: try another way to install gettext #38
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: Build release | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
source-release: | |
name: Make source release | |
runs-on: ubuntu-20.04 | |
env: | |
GH_TOKEN: ${{ github.token }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.13" | |
- name: Install non-Python build dependencies | |
run: sudo apt-get -y install gettext | |
- name: Install build dependencies | |
run: pip install tox build pygame importlib-resources typing-extensions platformdirs pyscroll pytmx | |
- name: Build | |
run: make dist | |
- name: Make the release | |
run: gh release create ${{ github.ref_name }} --title "Release ${{ github.ref_name}}" dist/* | |
binary-release: | |
name: Make binary release | |
needs: source-release | |
strategy: | |
matrix: | |
# Use oldest available macOS for greatest compatibility of resulting binary. | |
os: [ubuntu-20.04, macos-13, windows-latest] | |
runs-on: ${{ matrix.os }} | |
env: | |
GH_TOKEN: ${{ github.token }} | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.13" | |
- name: Install non-Python build dependencies (Ubuntu) | |
if: ${{ matrix.os == 'ubuntu-20.04' }} | |
run: sudo apt-get -y install gettext | |
- name: Install non-Python build dependencies (macOS) | |
if: ${{ matrix.os == 'macos-latest' }} | |
run: brew install gettext | |
- name: Install non-Python build dependencies (Windows) | |
if: ${{ matrix.os == 'windows-latest' }} | |
run: | | |
nuget install Gettext.Tools -Version 0.22.4 -OutputDirectory c:\nuget; | |
Add-Content $env:GITHUB_PATH "C:\nuget\Gettext.Tools.0.22.4\tools\bin" | |
- name: Install build dependencies | |
run: pip install tox build setuptools pygame importlib-resources typing-extensions platformdirs pyscroll pytmx | |
- name: Install additional dependencies for binary builds | |
run: pip install pyinstaller | |
- name: Build | |
run: make dist | |
- name: Build the executable (except macOS) | |
if: ${{ matrix.os != 'macos-13' }} | |
run: | | |
pyinstaller --noconfirm --onefile --windowed --name wincoll-${{ runner.os }}-${{ runner.arch }} --add-data "wincoll/*.wav:wincoll/" --add-data "wincoll/*.png:wincoll/" --add-data "wincoll/*.ttf:wincoll/" --add-data "wincoll/levels/*:wincoll/levels/" wincoll/__main__.py | |
./dist/wincoll-${{ runner.os }}-${{ runner.arch }} --help | |
- name: Build the executable (macOS) | |
if: ${{ matrix.os == 'macos-13' }} | |
run: | | |
./make-macos-icns ./wincoll/levels/87.png wincoll.iconset | |
pyinstaller --noconfirm --windowed --name wincoll --icon wincoll.icns --add-data "wincoll/*.wav:wincoll/" --add-data "wincoll/*.png:wincoll/" --add-data "wincoll/*.ttf:wincoll/" --add-data "wincoll/levels/*:wincoll/levels/" wincoll/__main__.py | |
brew install create-dmg | |
mkdir dmg-folder | |
mv dist/wincoll.app dmg-folder/ | |
create-dmg --volname "WinColl ${{ github.ref_name }}" ./dist/wincoll-${{ runner.os }}-${{ runner.arch }}.dmg dmg-folder/ | |
- name: Upload the binaries | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ github.token }} | |
tag: ${{ github.ref }} | |
file: ./dist/wincoll-${{ runner.os }}-${{ runner.arch }}* | |
file_glob: true | |
- name: Build the RISC OS distribution | |
if: ${{ matrix.os == 'ubuntu-20.04' }} | |
run: ./dist-riscos | |
- name: Upload the RISC OS distribution | |
if: ${{ matrix.os == 'ubuntu-20.04' }} | |
uses: svenstaro/upload-release-action@v2 | |
with: | |
repo_token: ${{ github.token }} | |
tag: ${{ github.ref }} | |
file: ./dist/wincoll-riscos.zip | |
file_glob: true |