forked from sbpp/sourcebans-pp
-
Notifications
You must be signed in to change notification settings - Fork 3
115 lines (103 loc) · 3.1 KB
/
plugin.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
name: CI
on:
push:
branches:
- main
- master
- php81
tags:
- '*'
paths:
- 'game/**'
pull_request:
branches:
- main
- master
- php81
paths:
- 'game/**'
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@v4
- 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 game/addons/sourcemod/configs /tmp/package/common/addons/sourcemod/
cp -R game/addons/sourcemod/translations /tmp/package/common/addons/sourcemod/
- name: Upload build archive for test runners
uses: actions/upload-artifact@v4
with:
name: package
path: /tmp/package
tag:
name: Tag
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push' && (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/php81')
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Delete existing 'latest' tag and release (Legacy tag)
uses: dev-drprasad/[email protected]
with:
delete_release: true
tag_name: latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Delete existing 'Plugins-Latest' tag and release (Current tag)
uses: dev-drprasad/[email protected]
with:
delete_release: true
tag_name: Plugins-Latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create tag
uses: rickstaa/action-create-tag@v1
with:
tag: "Plugins-Latest"
github_token: ${{ secrets.GITHUB_TOKEN }}
release:
name: Release
if: (github.event_name == 'push' && (startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main' || github.ref == 'refs/heads/php81'))
needs: [build, tag]
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v4
- name: Versioning
run: |
version="Plugins-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 "./package/" ]; then
cd ./package/
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