Skip to content

Commit

Permalink
Create build.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
rpkaul authored Aug 4, 2022
1 parent 0608719 commit 2022629
Showing 1 changed file with 100 additions and 0 deletions.
100 changes: 100 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,100 @@
# This is a basic workflow to help you get started with Actions

name: Create Release Executable

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches:
- master

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
name: Compile And Tag Pre-Release
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Get shorthand commit for release titles.
id: vars
run: echo "::set-output name=sha_short::$(echo ${{ github.sha }} | cut -c1-6)"

# Runs a set of commands using the runners shell
- name: Build Project
run: |
download_files() {
wget https://sm.alliedmods.net/smdrop/1.10/sourcemod-1.10.0-git6499-linux.tar.gz
wget https://github.com/ErikMinekus/sm-ripext/releases/download/1.3.0/sm-ripext-1.3.0-linux.zip
}
init_submodule() {
git submodule update --init
cd get5
git submodule update --init
cd ../
}
create_temp_directory() {
mkdir tmp
}
untar_files() {
mv *.tar* tmp/
mv *.zip* tmp/
cd tmp
tar -zxvf sourcemod*.tar.gz
unzip sm-rip*.zip
mkdir -p ./addons/sourcemod/scripting/get5
}
move_api_files() {
cp -r ../scripting/* ./addons/sourcemod/scripting/
cp -f ../get5/scripting/include/get5.inc ./addons/sourcemod/scripting/include/get5.inc
cp -f ../get5/scripting/include/logdebug.inc ./addons/sourcemod/scripting/include/logdebug.inc
cp -f ../get5/scripting/include/logdebug.inc ./addons/sourcemod/scripting/include/logdebug.inc
cp -f ../get5/scripting/get5/util.sp ./addons/sourcemod/scripting/get5/util.sp
cp -r ../get5/dependencies/sm-json/addons/sourcemod/scripting/include/* ./addons/sourcemod/scripting/include/
}
compile() {
cd ./addons/sourcemod/scripting
chmod +x spcomp64
./spcomp64 G5WS.sp
mv G5WS.smx ../../../../
}
remove_tmp() {
cd ../../../../
rm -rf ./tmp/
}
create_zip() {
zip G5WS G5WS.smx
rm -f G5WS.smx
}
download_files
init_submodule
create_temp_directory
untar_files
move_api_files
compile
remove_tmp
create_zip
- name: Create a Release
id: create_release
uses: ncipollo/release-action@v1.8.3
with:
token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: true
commit: "${{ github.sha }}"
tag: "Nightly-${{ steps.vars.outputs.sha_short }}"
name: "Nightly-${{ steps.vars.outputs.sha_short }}"
artifacts: "G5WS.zip"
body: |
Please note that these pre-release builds are currently bleeding edge and contain the latest features that are on the master branch.
When reporting issues, please list the nightly title for the plugin version you are using as it will help with debugging problems!

0 comments on commit 2022629

Please sign in to comment.