-
Notifications
You must be signed in to change notification settings - Fork 1
104 lines (90 loc) · 3.08 KB
/
Copy pathci.yml
File metadata and controls
104 lines (90 loc) · 3.08 KB
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
name: CI
on: [push, pull_request, workflow_dispatch]
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Setup SourcePawn compiler
uses: rumblefrog/setup-sp@v1.3.1
with:
version: "1.11.6917"
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Install dependencies
run: |
set -euo pipefail
mkdir -p addons/sourcemod/scripting/include deps
git clone --depth=1 https://github.com/srcdslab/sm-plugin-MultiColors.git deps/multicolors
cp -R deps/multicolors/addons/sourcemod/scripting/include/* addons/sourcemod/scripting/include/
- name: Build sourcemod plugin
working-directory: addons/sourcemod/scripting
run: |
set -euo pipefail
mkdir -p ../plugins
spcomp -i include -o ../plugins/BlockerPasses.smx BlockerPasses.sp
- name: Create package
run: |
set -euo pipefail
mkdir -p /tmp/package/addons/sourcemod/plugins
cp addons/sourcemod/plugins/*.smx /tmp/package/addons/sourcemod/plugins/
cp -R addons/sourcemod/translations /tmp/package/addons/sourcemod/
- name: Upload build archive for test runners
uses: actions/upload-artifact@v7
with:
name: ${{ runner.os }}
path: /tmp/package
tag:
name: Tag
needs: build
if: github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Delete existing "latest" release and tag
run: |
set -euo pipefail
gh release delete latest --cleanup-tag --yes || true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: rickstaa/action-create-tag@v1
with:
tag: latest
github_token: ${{ secrets.GITHUB_TOKEN }}
release:
name: Release
needs: [build, tag]
if: |
always() &&
needs.build.result == 'success' &&
(needs.tag.result == 'success' || needs.tag.result == 'skipped') &&
(startsWith(github.ref, 'refs/tags/') || github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')
runs-on: ubuntu-latest
steps:
- name: Download artifacts
uses: actions/download-artifact@v8
with:
name: ${{ runner.os }}
path: artifacts
- name: Versioning
run: |
set -euo pipefail
version="latest"
if [[ "${{ github.ref_type }}" == "tag" ]]; then
version="${GITHUB_REF_NAME}"
fi
echo "RELEASE_VERSION=$version" >> "$GITHUB_ENV"
- name: Package
run: |
set -euo pipefail
cd artifacts
tar -czf "../${{ github.event.repository.name }}-${{ env.RELEASE_VERSION }}.tar.gz" .
cd ..
- 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