forked from SwagSoftware/Kisak-Strike
-
Notifications
You must be signed in to change notification settings - Fork 1
77 lines (76 loc) · 3.09 KB
/
kstrike-compile.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
# This workflow does the following:
# 1) Compile everything (client and dedicated server)
# 2) Compress the binaries (because compression is cool)
# 3) Upload everything in a new release
#
# By default the binaries generated by this workflow are compiled using iphys and RocketUI (client) by default
# 02/2022 update: Now it should bump tag version so GitHub doesn't panic about it on every push
name: CI-Workflow
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
build:
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- name: Preparing environment...
env:
DEBIAN_FRONTEND: "noninteractive"
run: sudo apt update && sudo apt upgrade -y && sudo apt install -y git build-essential cmake libsdl2-mixer-dev libsdl2-dev libopenal-dev libcurlpp-dev libssl-dev libfontconfig1-dev libcurl4-openssl-dev net-tools wget unzip zip
- name: Building client...
run: cd cmake-build && cmake .. -DUSE_ROCKETUI=1 -DUSE_IPHYS_PHYSICS=1 && make -j$(nproc --all) && cd ${{ env.GITHUB_WORKSPACE }}
- name: Preparing additional files...
run: git clone https://github.com/P0L3NARUBA/Linux-Strike-Files && cp -r Linux-Strike-Files/* ../game
- name: Compressing assets...
run: cd .. && zip -9 -r game_client-x64-rocketui.zip game && rm -rf game && cd ${{ env.GITHUB_WORKSPACE }}
- name: Building dedicated...
run: cd cmake-build && cmake .. -DDEDICATED=1 && make -j$(nproc --all) && cd ${{ env.GITHUB_WORKSPACE }}
- name: Compressing assets...
run: cd .. && zip -9 -r game_dedicated-x64.zip game && rm -rf game && cd ${{ env.GITHUB_WORKSPACE }}
- name: Create tag version
if: github.event_name != 'pull_request'
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create release
if: github.event_name != 'pull_request'
env:
GITHUB_TOKEN: ${{ github.token }}
uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: true
release_name: AutoRelease ${{ steps.tag_version.outputs.new_tag }}
tag_name: ${{ steps.tag_version.outputs.new_tag }}
- name: Publish game client artifact
if: github.event_name != 'pull_request'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ../game_client-x64-rocketui.zip
asset_name: game_client-x64-rocketui.zip
asset_content_type: application/zip
- name: Publish game dedicated artifact
if: github.event_name != 'pull_request'
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ../game_dedicated-x64.zip
asset_name: game_dedicated-x64.zip
asset_content_type: application/zip