-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (76 loc) · 2.58 KB
/
build-native.yaml
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
name: Build for various platforms and upload to itch.io
on:
push:
branches: [build]
workflow_dispatch:
jobs:
build:
name: Build for ${{matrix.config.name}}
runs-on: ${{matrix.config.os}}
strategy:
fail-fast: false
matrix:
config:
- {
name: linux-gnu,
exe: CodenamePedestrian,
out: CodenamePedestrian,
os: ubuntu-latest,
cxx: g++,
cc: gcc,
}
- {
name: windows-msvc,
exe: Debug/CodenamePedestrian.exe,
out: CodenamePedestrian.exe,
os: windows-latest,
cxx: cl,
cc: cl,
}
steps:
- name: Install dependencies (Ubuntu)
if: matrix.config.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install cmake gcc g++ libxrandr-dev libxinerama-dev libxcursor-dev libxi-dev libxext-dev libgl-dev
- name: Checkout
uses: actions/checkout@v4
- name: Configure CMake with selected compiler family
run: cmake -B build -S ${{github.workspace}} -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=${{matrix.config.cc}} -DCMAKE_CXX_COMPILER=${{matrix.config.cxx}}
- name: Build with CMake
run: cmake --build build -j 4
- name: Assemble dist-files
run: |
mkdir -p dist-${{matrix.config.name}}
cp -r assets dist-${{matrix.config.name}}
cp build/${{matrix.config.exe}} dist-${{matrix.config.name}}/${{matrix.config.out}}
- name: Tar the distribution
run: tar -cvf ${{matrix.config.name}}.tar dist-${{matrix.config.name}}
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: ${{matrix.config.name}}
path: ${{matrix.config.name}}.tar
upload:
name: Upload channel ${{matrix.distribution}} to itch.io
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
distribution: [linux-gnu, windows-msvc]
steps:
- name: Download the distribution
uses: actions/download-artifact@v4
with:
name: ${{matrix.distribution}}
- name: Unpack the distribution
run: |
tar -xf ${{matrix.distribution}}.tar
- name: Upload to itch.io
uses: manleydev/butler-publish-itchio-action@master
env:
BUTLER_CREDENTIALS: ${{ secrets.BUTLER_CREDENTIALS }}
CHANNEL: ${{matrix.distribution}}
ITCH_GAME: codename-pedestrian
ITCH_USER: nonk123
PACKAGE: dist-${{matrix.distribution}}