forked from n64decomp/perfect_dark
-
Notifications
You must be signed in to change notification settings - Fork 76
103 lines (99 loc) · 3.23 KB
/
c-cpp.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
name: C/C++ CI
on:
push:
branches: [ "port" ]
pull_request:
branches: [ "port" ]
workflow_dispatch:
jobs:
build-i686-windows:
runs-on: windows-latest
defaults:
run:
shell: msys2 {0}
steps:
- name: Install MSYS2
uses: msys2/setup-msys2@v2
with:
msystem: MINGW32
update: true
install: >-
git
make
mingw-w64-i686-toolchain
mingw-w64-i686-SDL2
mingw-w64-i686-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 /mingw32/bin/{SDL2.dll,zlib1.dll,libgcc_s_dw2-1.dll,libwinpthread-1.dll} bin/
touch bin/data/put_your_rom_here.txt
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: pd-i686-windows
path: bin/
retention-days: 0
build-i686-linux:
runs-on: ubuntu-latest
steps:
- name: Install dependencies
run: |
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install git gcc g++ gcc-multilib g++-multilib make libsdl2-dev zlib1g-dev libsdl2-dev:i386 zlib1g-dev:i386
- name: Checkout repository
uses: actions/checkout@v4
- name: Build pd.exe
run: make -f Makefile.port TARGET_PLATFORM=i686-linux -j2
- name: Build pd.pal.exe
run: make -f Makefile.port TARGET_PLATFORM=i686-linux -j2 ROMID=pal-final
- name: Build pd.jpn.exe
run: make -f Makefile.port TARGET_PLATFORM=i686-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-i686-linux
path: bin/
retention-days: 0
publish-latest-build:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/port'
needs: [build-i686-windows, build-i686-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-i686-linux.tar.gz pd-i686-linux
zip -r ../ci-release/pd-i686-windows.zip pd-i686-windows
popd
git tag --force ci-dev-build port
git push --force origin ci-dev-build
gh release upload --clobber ci-dev-build ci-release/*