-
Notifications
You must be signed in to change notification settings - Fork 16
59 lines (58 loc) · 2.56 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
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 ${{ github.workspace }}/misc/hl1.cfg ${{ github.workspace }}/misc/hl2.cfg ${{ github.workspace }}/misc/hl2eps.cfg ${{ github.workspace }}/misc/hl1.bat ${{ github.workspace }}/misc/hl2.bat ${{ github.workspace }}/misc/hl2eps.bat ${{ runner.workspace }}/build/Release/OpenSource.exe ${{ github.workspace }}/README.md ${{ 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: Windows amd64
path: ${{ runner.workspace }}/OpenSource-win64.zip
- 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