forked from twhl-community/halflife-unified-sdk
-
-
Notifications
You must be signed in to change notification settings - Fork 0
146 lines (121 loc) · 4.2 KB
/
ci-cd.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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: CI/CD
on:
push:
branches:
- main
paths:
# Only on when updating RELEASE_VERSION
- '.github/workflows/ci-cd.yml'
permissions:
contents: write
packages: write
pull-requests: write
env:
BUILD_TYPE: Release
GAME_NAME: Half-Life
MOD_NAME: hlu
RELEASE_VERSION: 0.0
VCPKG_ROOT: ${{github.workspace}}/vcpkg
jobs:
python:
name: Package Game Assets
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Installing Python
run: |
pip install --upgrade pip
pip install -r requirements.txt
- name: Release
env:
TOKEN: ${{ secrets.TOKEN }}
run: python3 scripts/install_game_assets.py ${{ env.RELEASE_VERSION }}
linux:
name: Linux-x86
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- name: Install G++ Multilib & 32 bit OpenGL library
run: |
sudo dpkg --add-architecture i386
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install -y g++-11-multilib libgcc-s1:i386 libstdc++6:i386 libatomic1:i386 libgl1-mesa-dev:i386
- uses: lukka/get-cmake@latest
- name: Restore artifacts, setup vcpkg
uses: lukka/run-vcpkg@v10
with:
vcpkgDirectory: '${{env.VCPKG_ROOT}}'
runVcpkgInstall: false
vcpkgJsonIgnores: "['**/vcpkg/**', '**/vcpkg_config/**', '**/utils/**']"
- name: Configure
run: >
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{env.GAME_NAME}}/${{env.MOD_NAME}}
-DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/cmake/LinuxToolchain.cmake
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j3
- name: Install
run: cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Create Release
uses: xresloader/upload-to-github-release@v1.5.0
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
file: ${{env.GAME_NAME}}
overwrite: true
tags: true
draft: false
prerelease: false
tag_name: ${{ env.RELEASE_VERSION }}
branches: main
default_release_name: ${{ env.MOD_NAME }} ${{ env.RELEASE_VERSION }}
token: ${{ secrets.TOKEN }}
default_release_body_path: changelog.md
update_release_body_path: changelog.md
target_owner: Mikk155
target_repo: halflife-unified-sdk
win32:
name: Win32
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
- uses: lukka/get-cmake@latest
- name: Restore artifacts, setup vcpkg
uses: lukka/run-vcpkg@v10
with:
vcpkgDirectory: '${{env.VCPKG_ROOT}}'
runVcpkgInstall: false
vcpkgJsonIgnores: "['**/vcpkg/**', '**/vcpkg_config/**', '**/utils/**']"
- name: Configure
run: >
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=${{env.GAME_NAME}}/${{env.MOD_NAME}}
-DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/cmake/WindowsToolchain.cmake -A Win32
- name: Build
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -j3
- name: Install
run: cmake --install ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
- name: Create Release
uses: xresloader/upload-to-github-release@v1.5.0
env:
GITHUB_TOKEN: ${{ secrets.TOKEN }}
with:
file: ${{env.GAME_NAME}}
overwrite: true
tags: true
draft: false
prerelease: false
tag_name: ${{ env.RELEASE_VERSION }}
branches: main
default_release_name: ${{ env.MOD_NAME }} ${{ env.RELEASE_VERSION }}
token: ${{ secrets.TOKEN }}
default_release_body_path: changelog.md
update_release_body_path: changelog.md
target_owner: Mikk155
target_repo: halflife-unified-sdk