Skip to content

add min

add min #685

Workflow file for this run

name: Status
on:
push:
branches:
- development
- master
jobs:
build:
name: Compile & Generate Zip/Tar Files
runs-on: ubuntu-22.04
env:
OUTPUT_PATH: output/get5
OUTPUT_SM_PATH: output/get5/addons/sourcemod
SM_JSON_INC_PATH: get5/dependencies/sm-json/addons/sourcemod/scripting/include
STEAMWORKS_URL: https://raw.githubusercontent.com/hexa-core-eu/SteamWorks/main/Pawn/includes/SteamWorks.inc
steps:
- uses: actions/checkout@v3
with:
path: 'get5'
submodules: true
- uses: rumblefrog/setup-sp@master
with:
version: '1.11.x'
- name: Get shorthand commit.
id: vars
run: |
sha_short=$(echo ${{ github.sha }} | cut -c1-7)
get5_version=$(cat get5/scripting/get5/version.sp | grep -Eo '#define PLUGIN_VERSION "[0-9]+\.[0-9]+\.[0-9]+' | sed 's/#define PLUGIN_VERSION "//')
echo "last_nightly=$(git describe --tags $(git rev-list --tags --max-count=1))" >> $GITHUB_ENV
echo "sha_short=${sha_short}" >> $GITHUB_ENV
echo "get5_version=${get5_version}" >> $GITHUB_ENV
echo "get5_version_no_dots=${get5_version//./}" >> $GITHUB_ENV
if [ ${{ github.ref }} == 'refs/heads/master' ]
then
echo "get5_build_filename=get5-v${get5_version}" >> $GITHUB_ENV
echo "get5_version_sp_tag=${get5_version}" >> $GITHUB_ENV
else
echo "get5_build_filename=get5-v${get5_version}-${sha_short}" >> $GITHUB_ENV
echo "get5_version_sp_tag=${get5_version}-${sha_short}" >> $GITHUB_ENV
fi
- run: |
wget $STEAMWORKS_URL -P steamworks
mkdir -p $OUTPUT_SM_PATH/plugins/disabled
sed -i -r "s#\#define PLUGIN_VERSION \"[0-9]+\.[0-9]+\.[0-9]+-[a-zA-Z]+#\#define PLUGIN_VERSION \"${{ env.get5_version_sp_tag }}#g" get5/scripting/get5/version.sp
cp -R get5/cfg $OUTPUT_PATH
cp -R get5/translations $OUTPUT_SM_PATH
cp -R get5/configs $OUTPUT_SM_PATH
cp -R get5/scripting $OUTPUT_SM_PATH
cp get5/README.md $OUTPUT_PATH
cp get5/LICENSE $OUTPUT_PATH
spcomp get5/scripting/get5.sp -i steamworks -i $SM_JSON_INC_PATH -o $OUTPUT_SM_PATH/plugins/get5.smx -E
spcomp get5/scripting/get5_apistats.sp -i steamworks -i $SM_JSON_INC_PATH -o $OUTPUT_SM_PATH/plugins/disabled/get5_apistats.smx -E
spcomp get5/scripting/get5_mysqlstats.sp -i steamworks -i $SM_JSON_INC_PATH -o $OUTPUT_SM_PATH/plugins/disabled/get5_mysqlstats.smx -E
mkdir -p artifacts
cd $OUTPUT_PATH/ && tar -zcvf ../../artifacts/${{ env.get5_build_filename }}.tar.gz * && cd ../../
cd $OUTPUT_PATH/ && zip -r ../../artifacts/${{ env.get5_build_filename }}.zip . && cd ../../
- name: Store Artifacts For Tagging Release Or Nightly
uses: actions/upload-artifact@v3
with:
name: ${{ env.get5_build_filename }}
path: artifacts
outputs:
get5-version: ${{ env.get5_version }}
get5-version-no-dots: ${{ env.get5_version_no_dots }}
sha-short: ${{ env.sha_short }}
filename: ${{ env.get5_build_filename }}
deploy-nightly:
needs: [ build ]
name: Upload And Create Nightly Tag
if: github.ref == 'refs/heads/development'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: ${{ needs.build.outputs.filename }}
path: artifacts
- name: Generate changelog
id: changelog
uses: metcalfc/changelog-generator@v4.1.0
with:
myToken: ${{ secrets.GITHUB_TOKEN }}
- name: Tag And Attach Nightly Build
uses: ncipollo/release-action@v1.12.0
with:
token: "${{ secrets.GITHUB_TOKEN }}"
artifacts: "artifacts/${{ needs.build.outputs.filename }}.zip,artifacts/${{ needs.build.outputs.filename }}.tar.gz"
prerelease: true
draft: true
commit: "${{ github.sha }}"
tag: "v${{ needs.build.outputs.get5-version }}-${{ needs.build.outputs.sha-short }}"
name: "Nightly ${{ needs.build.outputs.get5-version }}-${{ needs.build.outputs.sha-short }}"
body: |
### :warning: Prereleases are not considered stable!
You should only use prerelease versions if you understand the implications or if you want to contribute to
testing and development. Prereleases are updated more frequently and only one prerelease is available for
download at any time.
Please see the [`CHANGELOG.md`](https://github.com/splewis/get5/blob/development/CHANGELOG.md#${{ needs.build.outputs.get5-version-no-dots }}) for details on changes.
Commits included in this release:
${{ steps.changelog.outputs.changelog }}
deploy-stable:
needs: [ build ]
name: Upload Artifacts and Draft Full Release.
if: github.ref == 'refs/heads/master'
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Generate changelog
id: changelog
uses: metcalfc/changelog-generator@v4.1.0
with:
myToken: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/download-artifact@v3
with:
name: ${{ needs.build.outputs.filename }}
path: artifacts
- name: Tag And Draft Release
uses: ncipollo/release-action@v1.12.0
with:
token: "${{ secrets.GITHUB_TOKEN }}"
artifacts: "artifacts/${{ needs.build.outputs.filename }}.zip,artifacts/${{ needs.build.outputs.filename }}.tar.gz"
draft: true
commit: "${{ github.sha }}"
tag: "v${{ needs.build.outputs.get5-version }}"
name: "Version ${{ needs.build.outputs.get5-version }}"
body: |
Please see the [`CHANGELOG.md`](https://github.com/splewis/get5/blob/master/CHANGELOG.md#${{ needs.build.outputs.get5-version-no-dots }}) for changes.
Commits included in this release:
${{ steps.changelog.outputs.changelog }}