Skip to content

Commit 748ca39

Browse files
committed
feat: github ci
1 parent 8bbc3b8 commit 748ca39

File tree

3 files changed

+149
-0
lines changed

3 files changed

+149
-0
lines changed

.github/workflows/ci.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: CI
2+
3+
on: [push, pull_request, workflow_dispatch]
4+
5+
jobs:
6+
build:
7+
name: "Build"
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
os: [ubuntu-20.04]
13+
include:
14+
- os: ubuntu-20.04
15+
steps:
16+
- uses: actions/checkout@v3
17+
- name: Build sourcemod plugin
18+
uses: maxime1907/action-sourceknight@v1
19+
with:
20+
cmd: build
21+
22+
- name: Create package
23+
run: |
24+
mkdir -p /tmp/package
25+
cp -R .sourceknight/package/* /tmp/package
26+
27+
- name: Upload build archive for test runners
28+
uses: actions/upload-artifact@v3
29+
with:
30+
name: ${{ runner.os }}
31+
path: /tmp/package
32+
33+
tag:
34+
name: Tag
35+
needs: build
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v3
39+
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
40+
41+
- uses: dev-drprasad/delete-tag-and-release@v0.2.0
42+
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
43+
with:
44+
delete_release: true
45+
tag_name: latest
46+
env:
47+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48+
49+
- uses: rickstaa/action-create-tag@v1
50+
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
51+
with:
52+
tag: "latest"
53+
github_token: ${{ secrets.GITHUB_TOKEN }}
54+
55+
release:
56+
name: Release
57+
if: startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
58+
needs: [build, tag]
59+
runs-on: ubuntu-latest
60+
steps:
61+
- name: Download artifacts
62+
uses: actions/download-artifact@v3
63+
64+
- name: Versioning
65+
run: |
66+
version="latest"
67+
if [[ "${{ github.ref_type }}" == 'tag' ]]; then
68+
version=`echo $GITHUB_REF | sed "s/refs\/tags\///"`;
69+
fi
70+
echo "RELEASE_VERSION=$version" >> $GITHUB_ENV
71+
72+
- name: Package
73+
run: |
74+
ls -Rall
75+
if [ -d "./Linux/" ]; then
76+
cd ./Linux/
77+
tar -czf ../${{ github.event.repository.name }}-${{ env.RELEASE_VERSION }}.tar.gz -T <(\ls -1)
78+
cd -
79+
fi
80+
81+
- name: Release
82+
uses: svenstaro/upload-release-action@v2
83+
with:
84+
repo_token: ${{ secrets.GITHUB_TOKEN }}
85+
file: '*.tar.gz'
86+
tag: ${{ env.RELEASE_VERSION }}
87+
file_glob: true
88+
overwrite: true

.gitignore

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
build/
2+
release/
3+
4+
.DS_Store
5+
.vscode
6+
7+
*.smx
8+
plugins/
9+
.sourceknight
10+
.venv

sourceknight.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
project:
2+
sourceknight: 0.1
3+
name: VIP_SourcemodFlags
4+
dependencies:
5+
- name: sourcemod
6+
type: tar
7+
version: 1.11.0-git6917
8+
location: https://sm.alliedmods.net/smdrop/1.11/sourcemod-1.11.0-git6917-linux.tar.gz
9+
unpack:
10+
- source: /addons
11+
dest: /addons
12+
13+
- name: multicolors
14+
type: git
15+
repo: https://github.com/srcdslab/sm-plugin-MultiColors
16+
unpack:
17+
- source: /addons/sourcemod/scripting/include
18+
dest: /addons/sourcemod/scripting/include
19+
20+
- name: ccc
21+
type: git
22+
repo: https://github.com/srcdslab/sm-plugin-CustomChatColors
23+
unpack:
24+
- source: /addons/sourcemod/scripting/include
25+
dest: /addons/sourcemod/scripting/include
26+
27+
- name: vip_core
28+
type: git
29+
repo: https://github.com/srcdslab/sm-plugin-VIP-Core
30+
unpack:
31+
- source: /addons/sourcemod/scripting/include
32+
dest: /addons/sourcemod/scripting/include
33+
34+
- name: sourcebanspp
35+
type: git
36+
repo: https://github.com/srcdslab/sourcebans-pp
37+
unpack:
38+
- source: /game/addons/sourcemod/scripting/include
39+
dest: /addons/sourcemod/scripting/include
40+
41+
- name: utilshelper
42+
type: git
43+
repo: https://github.com/srcdslab/sm-plugin-UtilsHelper
44+
unpack:
45+
- source: /addons/sourcemod/scripting/include
46+
dest: /addons/sourcemod/scripting/include
47+
48+
root: /
49+
output: /addons/sourcemod/plugins
50+
targets:
51+
- VIP_SourcemodFlags

0 commit comments

Comments
 (0)