Skip to content

Commit

Permalink
Merge pull request #23 from PANCHO7532B/master
Browse files Browse the repository at this point in the history
Automatize builds with GitHub Actions
  • Loading branch information
LWSS authored Nov 14, 2021
2 parents 7498c88 + a370d42 commit 0d5125b
Showing 1 changed file with 64 additions and 0 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/kstrike-compile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# 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 kisak-physics and RocketUI (client) by default
name: CI-Workflow
on:
push:
branches: [master]
pull_request:
branches: [master]
workflow_dispatch:

defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- 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 libgoogle-perftools-dev libopenal-dev libcurlpp-dev libssl-dev libfontconfig1-dev libcurl4-openssl-dev net-tools wget unzip zip
- name: Building client...
run: mkdir build && cd build && cmake .. -DUSE_KISAK_PHYSICS=1 -DUSE_ROCKETUI=1 && make -j2 && cd ${{ env.GITHUB_WORKSPACE }}
- name: Preparing additional files...
run: git clone https://github.com/SwagSoftware/Kisak-Strike-Files && cp -r Kisak-Strike-Files/* ../game
- name: Compressing assets...
run: cd .. && zip -9 -r game_client-kphys.zip game && rm -rf game && cd ${{ env.GITHUB_WORKSPACE }}
- name: Building dedicated...
run: cd build && cmake .. -DUSE_KISAK_PHYSICS=1 -DDEDICATED=1 && make -j2 && cd ${{ env.GITHUB_WORKSPACE }}
- name: Compressing assets...
run: cd .. && zip -9 -r game_dedicated-kphys.zip game && rm -rf game && cd ${{ env.GITHUB_WORKSPACE }}
- name: Create release
env:
GITHUB_TOKEN: ${{ github.token }}
uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: false
release_name: Release-Linux
tag_name: ${{ github.ref }}
- name: Publish game client artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ../game_client-kphys.zip
asset_name: game_client-kphys.zip
asset_content_type: application/zip
- name: Publish game dedicated artifact
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ../game_dedicated-kphys.zip
asset_name: game_dedicated-kphys.zip
asset_content_type: application/zip

0 comments on commit 0d5125b

Please sign in to comment.