-
Notifications
You must be signed in to change notification settings - Fork 16
64 lines (63 loc) · 2.95 KB
/
build.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
name: CMake release build
on: [push, pull_request]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest]
steps:
- name: Apt update
if: matrix.os == 'ubuntu-latest'
run: sudo apt update
- name: Install dependencies
if: matrix.os == 'ubuntu-latest'
run: sudo apt install libxfixes-dev mesa-common-dev libgl1-mesa-dev
- name: Checkout
uses: actions/checkout@v2
with:
submodules: true
- name: Create build dir
run: cmake -E make_directory ${{ runner.workspace }}/build
- name: Configure
working-directory: ${{ runner.workspace }}/build
run: cmake ${{ github.workspace }} -DCMAKE_BUILD_TYPE=Release
- name: Build
working-directory: ${{ runner.workspace }}/build
run: cmake --build . --config Release
- name: Prepare release archive
if: matrix.os == 'windows-latest'
run: |
cmake -E make_directory ${{ runner.workspace }}/OpenSource-win64
cmake -E copy ${{ runner.workspace }}/build/Release/OpenSource.exe ${{ runner.workspace }}/OpenSource-win64/
cmake -E copy ${{ github.workspace }}/README.md ${{ runner.workspace }}/OpenSource-win64/
cmake -E copy ${{ github.workspace }}/misc/hl1.cfg ${{ github.workspace }}/misc/hl1.bat ${{ runner.workspace }}/OpenSource-win64/
cmake -E copy ${{ github.workspace }}/misc/hl2.cfg ${{ github.workspace }}/misc/hl2.bat ${{ runner.workspace }}/OpenSource-win64/
cmake -E copy ${{ github.workspace }}/misc/hl2eps.cfg ${{ github.workspace }}/misc/hl2eps.bat ${{ runner.workspace }}/OpenSource-win64/
cmake -E copy ${{ github.workspace }}/misc/portal.cfg ${{ github.workspace }}/misc/portal.bat ${{ runner.workspace }}/OpenSource-win64/
powershell Compress-Archive ${{ runner.workspace }}/OpenSource-win64/* ${{ runner.workspace }}/OpenSource-win64.zip
- name: Upload artifacts
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v3
with:
name: OpenSource-win64
path: ${{ runner.workspace }}/OpenSource-win64
- name: Make GitHub release if tagged
if: matrix.os == 'windows-latest' && startsWith(github.ref, 'refs/tags/v')
uses: softprops/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
# Note-worthy description of changes in release
#body: # optional
# Path to load note-worthy description of changes in release from
#body_path: # optional
# Gives the release a custom name. Defaults to tag name
#name: # optional
# Creates a draft release. Defaults to false
draft: true # optional
# Identify the release as a prerelease. Defaults to false
prerelease: true # optional
# Newline-delimited list of path globs for asset files to upload
# TODO prepare proper zip with useful things
files: ${{ runner.workspace }}/OpenSource-win64.zip