Update gearboy.yml #366
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: Gearboy CI | |
on: | |
workflow_dispatch: | |
push: | |
paths-ignore: | |
- '**.md' | |
pull_request: | |
schedule: | |
- cron: '0 0 * * 0' | |
jobs: | |
linux: | |
name: Linux | |
strategy: | |
matrix: | |
os: [ubuntu-22.04, ubuntu-20.04] | |
runs-on: ${{ matrix.os }} | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Update OS | |
run: sudo apt-get update -qq | |
- name: Install dependencies | |
run: sudo apt-get install -y libsdl2-dev libglew-dev libgtk-3-dev | |
- name: make | |
run: make | |
working-directory: platforms/linux | |
- name: Archive binary | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Linux (${{ matrix.os }}) binary | |
path: platforms/linux/gearboy | |
libretro: | |
name: Libretro (Ubuntu) | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: make | |
run: make | |
working-directory: platforms/libretro | |
- name: Archive binary | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Libretro (Linux) core | |
path: platforms/libretro/gearboy_libretro.so | |
macos: | |
name: macOS | |
strategy: | |
matrix: | |
os: [macos-13, macos-14] | |
runs-on: ${{ matrix.os }} | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Install dependencies | |
run: brew install sdl2 | |
- name: make | |
run: make dist | |
working-directory: platforms/macos | |
- name: Archive binary | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.os }} App bundle | |
path: platforms/macos/Gearboy.app | |
windows: | |
name: Windows | |
runs-on: windows-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Add msbuild to PATH | |
uses: microsoft/setup-msbuild@v2 | |
- name: Get git version | |
id: gitversion | |
shell: bash | |
run: echo "gitversion=$(git describe --abbrev=7 --dirty --always --tags)" >> $GITHUB_OUTPUT | |
- name: msbuild | |
run: msbuild Gearboy.sln /t:Clean,Build /p:EmulatorBuild="${{ steps.gitversion.outputs.gitversion }}" /p:Configuration=Release | |
working-directory: platforms/windows | |
- name: Archive binary | |
uses: actions/upload-artifact@v4 | |
with: | |
name: Windows binary | |
path: platforms/windows/release/Gearboy.exe | |
bsd: | |
name: FreeBSD | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: make | |
id: test | |
uses: vmactions/freebsd-vm@v1 | |
with: | |
usesh: true | |
prepare: pkg install -y git gmake pkgconf SDL2 glew lang/gcc gtk3 | |
run: | | |
cd platforms/bsd | |
gmake | |
- name: Archive binary | |
uses: actions/upload-artifact@v4 | |
with: | |
name: BSD (FreeBSD) binary | |
path: platforms/bsd/gearboy | |
release: | |
name: Release | |
needs: [linux, macos, windows] | |
if: github.event_name != 'pull_request' && startswith(github.ref, 'refs/tags/') | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Prepare release directories | |
run: | | |
mkdir -p release/windows | |
mkdir -p release/macos/intel | |
mkdir -p release/macos/arm | |
mkdir -p release/linux/ubuntu-22.04 | |
mkdir -p release/linux/ubuntu-20.04 | |
cp platforms/README.txt release/windows | |
cp platforms/README.txt release/macos/intel | |
cp platforms/README.txt release/macos/arm | |
cp platforms/README.txt release/linux/ubuntu-22.04 | |
cp platforms/README.txt release/linux/ubuntu-20.04 | |
- name: Download Windows artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: Windows binary | |
path: release/windows | |
- name: Download macOS Intel artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: macos-13 App bundle | |
path: release/macos/intel | |
- name: Download macOS ARM artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: macos-14 App bundle | |
path: release/macos/arm | |
- name: Download Ubuntu 22.04 artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: Linux (ubuntu-22.04) binary | |
path: release/linux/ubuntu-22.04 | |
- name: Download Ubuntu 20.04 artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: Linux (ubuntu-20.04) binary | |
path: release/linux/ubuntu-20.04 | |
- name: Zip release directories | |
run: | | |
ls -lsR | |
cd release | |
zip ${{ github.ref_name }}-windows.zip windows | |
zip ${{ github.ref_name }}-macos-intel.zip macos/intel | |
zip ${{ github.ref_name }}-macos-arm.zip macos/arm | |
zip ${{ github.ref_name }}-ubuntu-22.04.zip linux/ubuntu-22.04 | |
zip ${{ github.ref_name }}-ubuntu-20.04.zip linux/ubuntu-20.04 | |
- name: Create release | |
run: | | |
cd release | |
gh release create ${{ github.ref }} \ | |
'${{ github.ref_name }}-windows.zip' \ | |
'${{ github.ref_name }}-macos-intel.zip' \ | |
'${{ github.ref_name }}-macos-arm.zip' \ | |
'${{ github.ref_name }}-ubuntu-22.04.zip' \ | |
'${{ github.ref_name }}-ubuntu-20.04.zip' \ | |
--generate-notes \ | |
--draft | |
env: | |
GITHUB_TOKEN: ${{ github.TOKEN }} |