Skip to content

Commit beabf62

Browse files
authored
Create release.yml (#323)
1 parent e7a4a49 commit beabf62

File tree

1 file changed

+88
-0
lines changed

1 file changed

+88
-0
lines changed

.github/workflows/release.yml

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
name: Publish Release
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
12+
steps:
13+
- uses: actions/checkout@v1
14+
15+
- name: Set environment variables
16+
run: |
17+
SOURCEMOD_PATH=$GITHUB_WORKSPACE/addons/sourcemod
18+
echo "SOURCEMOD_PATH=$SOURCEMOD_PATH" >> $GITHUB_ENV
19+
echo "SCRIPTING_PATH=$SOURCEMOD_PATH/scripting" >> $GITHUB_ENV
20+
echo "INCLUDE_PATH=$SOURCEMOD_PATH/scripting/include" >> $GITHUB_ENV
21+
22+
- name: Setup SourcePawn Compiler 1.10
23+
uses: rumblefrog/setup-sp@master
24+
with:
25+
version: "1.10"
26+
27+
- name: Create dependency directories
28+
run: mkdir $INCLUDE_PATH/smlib
29+
30+
- name: Fetch plugin dependencies
31+
run: |
32+
wget https://raw.githubusercontent.com/bcserv/smlib/transitional_syntax/scripting/include/smlib.inc -P $INCLUDE_PATH
33+
wget https://raw.githubusercontent.com/PremyslTalich/ColorVariables/master/addons/sourcemod/scripting/includes/colorvariables.inc -P $INCLUDE_PATH
34+
wget https://raw.githubusercontent.com/KyleSanderson/SteamWorks/master/Pawn/includes/SteamWorks.inc -P $INCLUDE_PATH
35+
wget https://raw.githubusercontent.com/JoinedSenses/SourceMod-IncludeLibrary/master/include/smjansson.inc -P $INCLUDE_PATH
36+
wget https://raw.githubusercontent.com/peace-maker/DHooks2/dynhooks/sourcemod_files/scripting/include/dhooks.inc -P $INCLUDE_PATH
37+
wget https://github.com/Impact123/AutoExecConfig/raw/development/autoexecconfig.inc -P $INCLUDE_PATH
38+
39+
git clone -b transitional_syntax https://github.com/bcserv/smlib.git
40+
mv smlib/scripting/include/* $INCLUDE_PATH
41+
42+
git clone https://github.com/Deathknife/sourcemod-discord.git
43+
mv sourcemod-discord/include/* $INCLUDE_PATH
44+
45+
- name: Compile surftimer.sp
46+
run: |
47+
echo -e "\nCompiling SurfTimer.sp..."
48+
spcomp -w234 -O2 -v2 -i $INCLUDE_PATH -o $GITHUB_WORKSPACE/SurfTimer.smx SurfTimer.sp
49+
working-directory: ${{ env.SCRIPTING_PATH }}/
50+
51+
- name: Compile SurfTimer-telefinder.sp
52+
run: |
53+
echo -e "\nCompiling SurfTimer-telefinder.sp..."
54+
spcomp -w234 -O2 -v2 -i $INCLUDE_PATH -o $GITHUB_WORKSPACE/SurfTimer-telefinder.smx SurfTimer-telefinder.sp
55+
working-directory: ${{ env.SCRIPTING_PATH }}/
56+
57+
- name: Create Release
58+
id: create_release
59+
uses: actions/create-release@v1
60+
env:
61+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
62+
with:
63+
tag_name: ${{ github.ref }}
64+
release_name: ${{ github.ref }}
65+
draft: false
66+
prerelease: false
67+
68+
- name: Upload SurfTimer
69+
id: upload-surftimer
70+
uses: actions/upload-release-asset@v1
71+
env:
72+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
73+
with:
74+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
75+
asset_path: ./SurfTimer.smx
76+
asset_name: SurfTimer.smx
77+
asset_content_type: application/octet-stream
78+
79+
- name: Upload SurfTimer-telefinder
80+
id: upload-surftimer-telefinder
81+
uses: actions/upload-release-asset@v1
82+
env:
83+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
84+
with:
85+
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
86+
asset_path: ./SurfTimer-telefinder.smx
87+
asset_name: SurfTimer-telefinder.smx
88+
asset_content_type: application/octet-stream

0 commit comments

Comments
 (0)