Skip to content

Commit

Permalink
feat: github ci
Browse files Browse the repository at this point in the history
  • Loading branch information
maxime1907 committed Nov 27, 2022
1 parent ced2367 commit a00a1b5
Show file tree
Hide file tree
Showing 5 changed files with 133 additions and 3 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
name: CI

on: [push, pull_request, workflow_dispatch]

jobs:
build:
name: "Build"
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
include:
- os: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Build sourcemod plugin
uses: maxime1907/action-sourceknight@v1
with:
cmd: build

- name: Create package
run: |
mkdir -p /tmp/package
cp -R .sourceknight/package/* /tmp/package
cp -R addons/sourcemod/configs /tmp/package/common/addons/sourcemod/
cp -R addons/sourcemod/translations /tmp/package/common/addons/sourcemod/
- name: Upload build archive for test runners
uses: actions/upload-artifact@v3
with:
name: ${{ runner.os }}
path: /tmp/package

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

- uses: dev-drprasad/[email protected]
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: [build, 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
if [ -d "./Linux/" ]; then
cd ./Linux/
tar -czf ../${{ github.event.repository.name }}-${{ env.RELEASE_VERSION }}.tar.gz -T <(\ls -1)
cd -
fi
- 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
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
build/
release/

.DS_Store
.vscode

*.smx
plugins/
.sourceknight
.venv
2 changes: 1 addition & 1 deletion addons/sourcemod/scripting/VIP_Tracers.sp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public Plugin:myinfo =
name = "[VIP] Tracers",
author = "R1KO & inGame & maxime1907",
description = "Display the trajectory of bullets when firing with a weapon",
version = "1.1",
version = "1.1.0",
url = ""
};

Expand Down
4 changes: 2 additions & 2 deletions addons/sourcemod/translations/vip_tracers.phrases.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
{
"no_access"
{
"en" "{blue}[VIP Tracers] {yellow}Tracers only for {orchid}VIP{yellow}. Buy on {blue}www.nide.gg"
"ru" "{blue}[VIP Tracers] {yellow}Следы от пуль только для {orchid}VIP{yellow}. Купи на {blue}www.nide.gg"
"en" "{blue}[VIP Tracers] {yellow}Tracers only for {orchid}VIP{yellow}"
"ru" "{blue}[VIP Tracers] {yellow}Следы от пуль только для {orchid}VIP{yellow}"
}
"Cookie Menu"
{
Expand Down
30 changes: 30 additions & 0 deletions sourceknight.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
project:
sourceknight: 0.1
name: VIP_Tracers
dependencies:
- name: sourcemod
type: tar
version: 1.11.0-git6917
location: https://sm.alliedmods.net/smdrop/1.11/sourcemod-1.11.0-git6917-linux.tar.gz
unpack:
- source: /addons
dest: /addons

- name: multicolors
type: git
repo: https://github.com/srcdslab/sm-plugin-MultiColors
unpack:
- source: /addons/sourcemod/scripting/include
dest: /addons/sourcemod/scripting/include

- name: vip_core
type: git
repo: https://github.com/srcdslab/sm-plugin-VIP-Core
unpack:
- source: /addons/sourcemod/scripting/include
dest: /addons/sourcemod/scripting/include

root: /
output: /addons/sourcemod/plugins
targets:
- VIP_Tracers

0 comments on commit a00a1b5

Please sign in to comment.