Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
112 changes: 78 additions & 34 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Build & Deploy
on: [push]

on:
- push
- pull_request

env:
SCRVER: ${{ github.sha }}
Expand Down Expand Up @@ -96,50 +99,33 @@ jobs:

client:
name: Build Client
runs-on: ubuntu-latest
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
sm-version: ["1.10.x", "1.11.x"]
os: [ubuntu-20.04]
include:
- os: ubuntu-20.04

steps:
- name: Checkout source
uses: actions/checkout@master

- name: Set version env
run: echo ::set-env name=SCRVER::$(git describe --always --long --dirty)

- name: Setup SourcePawn Compiler ${{ matrix.sm-version }}
id: setup-sp
uses: rumblefrog/setup-sp@master
- uses: actions/checkout@v3
- name: Build sourcemod plugin
uses: maxime1907/action-sourceknight@v1
with:
version: ${{ matrix.sm-version }}
cmd: build

- name: Create external dependency directory
run: mkdir includes

- name: Update version file
working-directory: client
run: envsubst < SCR-Version.inc > SCR-Version.inc.temp && mv SCR-Version.inc.temp SCR-Version.inc

- name: Fetch plugin dependencies
- name: Create package
run: |
wget https://raw.githubusercontent.com/nefarius/sm-ext-socket/master/socket.inc -P includes
wget https://raw.githubusercontent.com/rumblefrog/SM-ByteBuffer-Inc/master/bytebuffer.inc -P includes
wget https://www.doctormckay.com/download/scripting/include/morecolors.inc -P includes

- name: Create build folder
run: mkdir build

- name: Compile client against SM ${{ steps.setup-sp.outputs.version }}
run: spcomp64 -iincludes client/Source-Chat-Relay.sp -o build/Source-Chat-Relay.smx
mkdir -p /tmp/package
cp -R .sourceknight/package/* /tmp/package

- name: Upload plugin artifact
if: matrix.sm-version == '1.10.x'
uses: actions/upload-artifact@master
- name: Upload build archive for test runners
uses: actions/upload-artifact@v3
with:
name: Plugin
path: build/
path: /tmp/package

doc:
name: Build Documentation
runs-on: ubuntu-latest
Expand All @@ -166,3 +152,61 @@ jobs:
- name: Build documentation
working-directory: docs
run: yarn gatsby build --prefix-paths

tag:
name: Tag
needs:
- client
- server
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'

- uses: dev-drprasad/delete-tag-and-release@v0.2.1
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
with:
delete_release: true
tag_name: latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- uses: rickstaa/action-create-tag@v1
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
with:
tag: "latest"
github_token: ${{ secrets.GITHUB_TOKEN }}

release:
name: Release
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
needs:
- client
- server
- tag
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v3

- name: Versioning
run: |
version="latest"
if [[ "${{ github.ref_type }}" == 'tag' ]]; then
version=`echo $GITHUB_REF | sed "s/refs\/tags\///"`;
fi
echo "RELEASE_VERSION=$version" >> $GITHUB_ENV

- name: Package
run: |
ls -Rall
tar -czf ${{ github.event.repository.name }}-${{ env.RELEASE_VERSION }}.tar.gz Plugin Server

- name: Release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: '*.tar.gz'
tag: ${{ env.RELEASE_VERSION }}
file_glob: true
overwrite: true
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,10 @@ server/ui/template/dist/*
.cache/
.docz
public

# Python
.venv

# Sourceknight
.sourceknight
*.smx
38 changes: 38 additions & 0 deletions sourceknight.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
project:
sourceknight: 0.2
name: SourceChatRelay
dependencies:
- name: sourcemod
type: tar
version: 1.11.0-git6934
location: https://sm.alliedmods.net/smdrop/1.11/sourcemod-1.11.0-git6934-linux.tar.gz
unpack:
- source: /addons
dest: /addons

- name: ext-socket
type: git
repo: https://github.com/nefarius/sm-ext-socket
unpack:
- source: /
dest: /addons/sourcemod/scripting/include

- name: multicolors
type: git
repo: https://github.com/Bara/Multi-Colors
unpack:
- source: /addons/sourcemod/scripting/include
dest: /addons/sourcemod/scripting/include

- name: bytebuffer
type: git
repo: https://github.com/rumblefrog/SM-ByteBuffer-Inc
unpack:
- source: /
dest: /addons/sourcemod/scripting/include

root: /client
workdir: /
output: /addons/sourcemod/plugins
targets:
- Source-Chat-Relay