Skip to content

Commit f49e3b3

Browse files
chore: github ci
1 parent 9502f2b commit f49e3b3

5 files changed

Lines changed: 126 additions & 0 deletions

File tree

.github/workflows/ci.yml

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

plugins/DynamicChannels.smx

-7.18 KB
Binary file not shown.

plugins/ExamplePlugin.smx

-3.21 KB
Binary file not shown.

sourceknight.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
project:
2+
sourceknight: 0.2
3+
name: DynamicChannels
4+
dependencies:
5+
- name: sourcemod
6+
type: tar
7+
version: 1.11.0-git6966
8+
location: https://sm.alliedmods.net/smdrop/1.11/sourcemod-1.11.0-git6966-linux.tar.gz
9+
unpack:
10+
- source: /addons
11+
dest: /addons
12+
13+
root: /
14+
workdir: /scripting
15+
output: /plugins
16+
targets:
17+
- DynamicChannels

0 commit comments

Comments
 (0)