Update c-cpp.yml #20
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: C/C++ CI | |
on: | |
push: | |
branches: [ "port-x64" ] | |
pull_request: | |
branches: [ "port-x64" ] | |
workflow_dispatch: | |
jobs: | |
build-x86_64-windows: | |
runs-on: windows-latest | |
defaults: | |
run: | |
shell: msys2 {0} | |
steps: | |
- name: Install MSYS2 | |
uses: msys2/setup-msys2@v2 | |
with: | |
msystem: MINGW64 | |
update: true | |
install: >- | |
git | |
make | |
mingw-w64-x86_64-toolchain | |
mingw-w64-x86_64-python | |
mingw-w64-x86_64-SDL2 | |
mingw-w64-x86_64-zlib | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Build pd.exe | |
run: make -f Makefile.port -j | |
- name: Build pd.pal.exe | |
run: make -f Makefile.port -j ROMID=pal-final | |
- name: Build pd.jpn.exe | |
run: make -f Makefile.port -j ROMID=jpn-final | |
- name: Prepare artifact for packaging | |
run: | | |
mkdir -p bin/data | |
cp build/ntsc-final-port/pd.exe bin/ | |
cp build/pal-final-port/pd.pal.exe bin/ | |
cp build/jpn-final-port/pd.jpn.exe bin/ | |
cp /mingw64/bin/{SDL2.dll,zlib1.dll,libwinpthread-1.dll} bin/ | |
touch bin/data/put_your_rom_here.txt | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pd-x86_64-windows | |
path: bin/ | |
retention-days: 0 | |
build-x86_64-linux: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Install dependencies | |
run: | | |
sudo dpkg --add-architecture amd64 | |
sudo apt-get update | |
sudo apt-get install git gcc g++ gcc-multilib g++-multilib make libsdl2-dev zlib1g-dev libsdl2-2.0-0 | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Build pd.exe | |
run: make -f Makefile.port TARGET_PLATFORM=x86_64-linux -j2 | |
- name: Build pd.pal.exe | |
run: make -f Makefile.port TARGET_PLATFORM=x86_64-linux -j2 ROMID=pal-final | |
- name: Build pd.jpn.exe | |
run: make -f Makefile.port TARGET_PLATFORM=x86_64-linux -j2 ROMID=jpn-final | |
- name: Prepare artifact for packaging | |
run: | | |
mkdir -p bin/data | |
cp build/ntsc-final-port/pd.exe bin/pd | |
cp build/pal-final-port/pd.pal.exe bin/pd.pal | |
cp build/jpn-final-port/pd.jpn.exe bin/pd.jpn | |
touch bin/data/put_your_rom_here.txt | |
- name: Upload artifact | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pd-x86_64-linux | |
path: bin/ | |
retention-days: 0 | |
publish-latest-build: | |
runs-on: ubuntu-latest | |
if: github.ref == 'refs/heads/port-x64' | |
needs: [build-x86_64-windows, build-x86_64-linux] | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
path: ci-artifacts | |
- name: Publish latest dev-build | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
mkdir ci-release | |
pushd ci-artifacts | |
tar czf ../ci-release/pd-x86_64-linux.tar.gz pd-x86_64-linux | |
zip -r ../ci-release/pd-x86_64-windows.zip pd-x86_64-windows | |
popd | |
git tag --force ci-dev-build-x64 port-x64 | |
git push --force origin ci-dev-build-x64 | |
gh release upload --clobber ci-dev-build-x64 ci-release/* |