Skip to content

Commit 0c4bd4a

Browse files
authored
Add CI (Mistrick#15)
* Add CI * Move all files to cstrike/ * Add readme * Update README.md * Update CI * lil fix for SHA
1 parent aa0ce7a commit 0c4bd4a

31 files changed

+245
-11
lines changed

.github/README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
<h1 align="center">
2+
<a href="https://github.com/Mistrick/MapManagerModular"><img src="https://user-images.githubusercontent.com/18553678/128012021-a57c9845-d029-419e-9006-fa43ffff188a.png" width="500px" alt="Map Manager Modular"></a>
3+
</h1>
4+
5+
<p align="center">Modular map management system with rich features.</p>
6+
7+
<p align="center">
8+
<a href="https://github.com/Mistrick/MapManagerModular/releases/latest">
9+
<img src="https://img.shields.io/github/downloads/Mistrick/MapManagerModular/total?label=Download%40latest&style=flat-square&logo=github&logoColor=white"
10+
alt="Build status">
11+
<a href="https://github.com/Mistrick/MapManagerModular/actions">
12+
<img src="https://img.shields.io/github/workflow/status/Mistrick/MapManagerModular/CI/master?style=flat-square&logo=github&logoColor=white"
13+
alt="Build status">
14+
<a href="https://github.com/Mistrick/MapManagerModular/releases">
15+
<img src="https://img.shields.io/github/v/release/Mistrick/MapManagerModular?include_prereleases&style=flat-square&logo=github&logoColor=white"
16+
alt="Release">
17+
<a href="https://www.amxmodx.org/downloads-new.php">
18+
<img src="https://img.shields.io/badge/AMXModX-%3E%3D1.8.2-blue?style=flat-square"
19+
alt="AMXModX dependency">
20+
</p>
21+
22+
<p align="center">
23+
<a href="#about">About</a> •
24+
<a href="#requirements">Requirements</a> •
25+
<a href="#installation">Installation</a> •
26+
<a href="#updating">Updating</a> •
27+
<a href="#downloads">Downloads</a> •
28+
<a href="#features">Features</a> •
29+
<a href="#wiki">Wiki</a>
30+
</p>
31+
32+
---
33+
34+
## About
35+
- TODO
36+
37+
## Requirements
38+
- HLDS installed;
39+
- Installed AMXModX ([`v1.9`](https://www.amxmodx.org/downloads-new.php) or [`v1.10`](https://www.amxmodx.org/downloads-new.php?branch=master));
40+
41+
## Installation
42+
- [Download the latest](https://github.com/Mistrick/MapManagerModular/releases/latest) stable version from the release section.
43+
- Extract the `cstrike` folder to the root folder of the HLDS server;
44+
- Make sure that all plugins are running and in the correct order, using the `amxx list` command.
45+
46+
## Updating
47+
- Put new plugins and lang-files (`plugins/*.amxx` & `data/lang/*.txt`) into `amxmodx/` folder on the HLDS server;
48+
- Restart the server (command `restart` or change the map);
49+
- Make sure that the versions of the plugins are up to date with the command `amxx list`.
50+
51+
## Downloads
52+
- [Release builds](https://github.com/Mistrick/MapManagerModular/releases)
53+
- [Dev builds](https://github.com/Mistrick/MapManagerModular/actions/workflows/CI.yml)
54+
55+
## Features
56+
- TODO
57+
58+
## Wiki
59+
Do you **need some help**? Check the _articles_ from the [wiki](https://github.com/Mistrick/MapManagerModular/wiki).

.github/release-drafter.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name-template: "Release v$RESOLVED_VERSION"
2+
tag-template: "v$RESOLVED_VERSION"
3+
categories:
4+
- title: "🚀 Features"
5+
labels:
6+
- "feature"
7+
- "enhancement"
8+
- title: "🐛 Bug Fixes"
9+
labels:
10+
- "fix"
11+
- "bugfix"
12+
- "bug"
13+
- title: "🧰 Maintenance"
14+
labels:
15+
- "maintenance"
16+
change-template: "- $TITLE @$AUTHOR (#$NUMBER)"
17+
change-title-escapes: '\<*_&' # You can add # and @ to disable mentions, and add ` to disable code blocks.
18+
version-resolver:
19+
major:
20+
labels:
21+
- "major"
22+
- "breaking"
23+
minor:
24+
labels:
25+
- "minor"
26+
- "feature"
27+
patch:
28+
labels:
29+
- "patch"
30+
- "bug"
31+
- "maintenance"
32+
- "docs"
33+
- "dependencies"
34+
- "security"
35+
default: patch
36+
prerelease: true
37+
template: |
38+
## What's Changed
39+
40+
$CHANGES
41+
42+
### Contributors
43+
44+
$CONTRIBUTORS

.github/workflows/CI.yml

Lines changed: 112 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,112 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [master]
6+
paths-ignore:
7+
- "**.md"
8+
9+
pull_request:
10+
types: [opened, reopened, synchronize]
11+
release:
12+
types: [published]
13+
14+
jobs:
15+
build:
16+
name: "Build"
17+
runs-on: ubuntu-latest
18+
outputs:
19+
sha: ${{ steps.declare_sha.outputs.sha }}
20+
semver: ${{ steps.declare_sha.outputs.semver }}
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v2
24+
with:
25+
fetch-depth: 0
26+
27+
- name: Parse SemVer string (release)
28+
id: semver_parser
29+
if: |
30+
github.event_name == 'release' &&
31+
github.event.action == 'published' &&
32+
startsWith(github.ref, 'refs/tags/')
33+
uses: booxmedialtd/ws-action-parse-semver@v1
34+
with:
35+
input_string: ${{ github.ref }}
36+
version_extractor_regex: '\/v(.*)$'
37+
38+
- name: Declare SHA & package name
39+
id: declare_sha
40+
shell: bash
41+
run: |
42+
SHA=$(git rev-parse --short HEAD)
43+
echo "SHA_SHORT=${SHA}" >> $GITHUB_ENV
44+
echo "::set-output name=sha::$SHA"
45+
echo "::set-output name=semver::${{ steps.semver_parser.outputs.fullversion }}"
46+
47+
- name: Update versions for plugins
48+
working-directory: cstrike/addons/amxmodx/scripting/include/
49+
env:
50+
SHA_SHORT: "${{ env.SHA_SHORT }}"
51+
FILE: map_manager_consts.inc
52+
run: sed -i "s|VERSION_HASH \"\"|VERSION_HASH \"-$SHA_SHORT\"|g" $FILE
53+
54+
- name: Setup AMXXPawn Compiler
55+
uses: wopox1337/setup-amxxpawn@v1
56+
with:
57+
version: "1.10.5428"
58+
59+
- name: Compile plugins
60+
working-directory: cstrike/addons/amxmodx/scripting/
61+
run: |
62+
for sourcefile in *.sma;
63+
do
64+
amxxfile="`echo $sourcefile | sed -e 's/\.sma$/.amxx/'`"
65+
output_path="../plugins/$amxxfile"
66+
67+
mkdir -p $(dirname $output_path)
68+
69+
echo -n "Compiling $sourcefile ... "
70+
amxxpc $sourcefile -i"include" -o"$output_path"
71+
done
72+
73+
- name: Move files
74+
run: |
75+
mkdir publish
76+
mv cstrike/ publish/
77+
78+
- name: Upload artifact
79+
uses: actions/upload-artifact@v2
80+
with:
81+
name: MapManager-${{ env.SHA_SHORT }}-dev
82+
path: publish/*
83+
84+
publish:
85+
name: "Publish"
86+
runs-on: ubuntu-latest
87+
needs: [build]
88+
if: |
89+
github.event_name == 'release' &&
90+
github.event.action == 'published' &&
91+
startsWith(github.ref, 'refs/tags/')
92+
steps:
93+
- name: Download artifacts
94+
uses: actions/download-artifact@v2
95+
with:
96+
name: MapManager-${{needs.build.outputs.sha}}-dev
97+
98+
- name: Packaging binaries
99+
id: packaging
100+
run: 7z a -mm=Deflate -mfb=258 -mpass=15 -r MapManager-v${{needs.build.outputs.semver}}.zip cstrike/
101+
102+
- name: Publish artifacts
103+
uses: softprops/action-gh-release@v1
104+
id: publish-job
105+
if: |
106+
startsWith(github.ref, 'refs/tags/') &&
107+
steps.packaging.outcome == 'success'
108+
env:
109+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
110+
with:
111+
files: |
112+
*.zip
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Release Drafter
2+
3+
on:
4+
pull_request:
5+
types: [closed]
6+
7+
jobs:
8+
update_release_draft:
9+
runs-on: ubuntu-latest
10+
if: github.event.pull_request.merged == true
11+
steps:
12+
- uses: release-drafter/release-drafter@v5
13+
with:
14+
config-name: release-drafter.yml
15+
env:
16+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
File renamed without changes.
File renamed without changes.
File renamed without changes.

addons/amxmodx/configs/plugins-map_manager.ini renamed to cstrike/addons/amxmodx/configs/plugins-map_manager.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
; Main plugins
22
map_manager_core.amxx
33
map_manager_scheduler.amxx
4+
45
; Addons
56
map_manager_rtv.amxx
67
map_manager_nomination.amxx
File renamed without changes.

0 commit comments

Comments
 (0)