Skip to content

Commit

Permalink
compile 1.10 + 1.11
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphonie committed Aug 16, 2022
1 parent 9ad17fe commit c994df1
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 33 deletions.
41 changes: 41 additions & 0 deletions .github/nv_compile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/bash


versvers=$(spcomp64 -v | grep "Compiler" --color=never | cut -d " " -f 3)


nv_plugs=("nativevotes")
nv_plugs+=("nativevotes.sp")
nv_plugs+=("nativevotes-basecommands.sp")
nv_plugs+=("nativevotes_mapchooser.sp")
nv_plugs+=("nativevotes_nominations.sp")
nv_plugs+=("nativevotes_rockthevote.sp")

nv_plugins_disabled=("nativevotes_votetest.sp")
nv_plugins_disabled+=("nativevotes_votemanager_test.sp")
nv_plugins_disabled+=("csgo_votestart_test.sp")
nv_plugins_disabled+=("votedelay_changelevel.sp")
nv_plugins_disabled+=("votediagnostics.sp")
nv_plugins_disabled+=("votefailed.sp")

# we start in git root
pushd ./addons/sourcemod/scripting

mkdir ../plugins/disabled -p || true


for target in "${nv_plugs[@]}"; do
spcomp64 -i"./include/" "${target}" -o ../plugins/"${target}".smx
done

for target in "${nv_plugins_disabled[@]}"; do
spcomp64 -i"./include/" "${target}" -o ../plugins/disabled/"${target}".smx
done

popd

mkdir build || true
7za a -r build/nativevotes_sm_"${versvers}".zip scripting/ translations/ plugins/
rm plugins/ -rfv
ls -la

51 changes: 18 additions & 33 deletions .github/workflows/nativevotes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
jobs:
run:
name: Run action
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04

# skip build on '[ci skip]'
if: "!contains(github.event.head_commit.message, '[ci skip]')"
Expand All @@ -18,35 +18,26 @@ jobs:
with:
submodules: true

- name: Setup SourcePawn Compiler
- name: Setup SourcePawn 1.10 Compiler
uses: rumblefrog/setup-sp@master
with:
version: "1.10.x"

- name: Compile plugins
- name: Compile plugins 1.10
shell: bash
run: |
cd ./addons/sourcemod/scripting
pwd
mkdir ../plugins/disabled -p
spcomp -i"./include/" nativevotes.sp -o ../plugins/nativevotes.smx
spcomp -i"./include/" nativevotes-basecommands.sp -o ../plugins/nativevotes-basecommands.smx
spcomp -i"./include/" nativevotes_mapchooser.sp -o ../plugins/nativevotes_mapchooser.smx
spcomp -i"./include/" nativevotes_nominations.sp -o ../plugins/nativevotes_nominations.smx
spcomp -i"./include/" nativevotes_rockthevote.sp -o ../plugins/nativevotes_rockthevote.smx
spcomp -i"./include/" nativevotes_votetest.sp -o ../plugins/disabled/nativevotes_votetest.smx
spcomp -i"./include/" nativevotes_votemanager_test.sp -o ../plugins/disabled/nativevotes_votemanager_test.smx
spcomp -i"./include/" csgo_votestart_test.sp -o ../plugins/disabled/csgo_votestart_test.smx
spcomp -i"./include/" votedelay_changelevel.sp -o ../plugins/disabled/votedelay_changelevel.smx
spcomp -i"./include/" votediagnostics.sp -o ../plugins/disabled/votediagnostics.smx
spcomp -i"./include/" votefailed.sp -o ../plugins/disabled/votefailed.smx
ls -la
bash .github/nv_compile.sh
- name: Zip package
- name: Setup SourcePawn 1.11 Compiler
uses: rumblefrog/setup-sp@master
with:
version: "1.11.x"

- name: Compile plugins 1.11
shell: bash
run: |
mkdir build
7za a -r build/nativevotes.zip scripting/ plugins/ translations/
ls -la
pwd
bash .github/nv_compile.sh
bash
- name: Set Commit Hash
id: commit_info
Expand All @@ -63,14 +54,8 @@ jobs:
draft: false
prerelease: false

- name: Upload Release Asset
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release
uses: softprops/action-gh-release@v1
with:
# 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
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./build/nativevotes.zip
asset_name: nativevotes.zip
asset_content_type: application/zip
tag_name: workflow-build${{ github.run_number }}
files: build/nativevotes*

0 comments on commit c994df1

Please sign in to comment.