-
Notifications
You must be signed in to change notification settings - Fork 98
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #23 from PANCHO7532B/master
Automatize builds with GitHub Actions
- Loading branch information
Showing
1 changed file
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |