Skip to content

Implement a more robust cleanup strategy (#11) #15

Implement a more robust cleanup strategy (#11)

Implement a more robust cleanup strategy (#11) #15

Workflow file for this run

name: Build gFwens (push to master)
on:
push:
branches: [ master ]
paths-ignore:
- "README.md"
- 'examples/**'
- ".gitignore"
- ".github/workflows/build-pr.yml"
env:
STEAMWORKS_LIB_BASEDIR: "./deps"
STEAMWORKS_SDK_URL_150: ${{ secrets.STEAMWORKS_SDK_URL_150 }}
jobs:
fetch-dependencies:
runs-on: ubuntu-latest
env:
STEAMWORKS_URL: ${{ secrets.STEAMWORKS_SDK_URL }}
steps:
- run: |
wget https://github.com/premake/premake-core/releases/download/v5.0.0-alpha15/premake-5.0.0-alpha15-windows.zip -qO- | busybox unzip -
wget $STEAMWORKS_URL -qO- | busybox unzip -
wget https://github.com/premake/premake-core/releases/download/v5.0.0-alpha15/premake-5.0.0-alpha15-linux.tar.gz -qO- | tar zxf -
- uses: actions/upload-artifact@v4
with:
name: premake-persistence
path: ./premake*
- uses: actions/upload-artifact@v4
with:
name: sdk-persistence-32
path: ./sdk*
# Dealing with the difference in the x64 steamworks requirements
- run: |
rm -R ./sdk
wget $STEAMWORKS_SDK_URL_150 -qO- | busybox unzip -
- uses: actions/upload-artifact@v4
with:
name: sdk-persistence-64
path: ./sdk*
###
build-win:
runs-on: windows-2019
needs: fetch-dependencies
strategy:
matrix:
arch: [32, 64]
steps:
- uses: actions/checkout@v4
with:
repository: facepunch/gmod-module-base
ref: refs/heads/development
path: gmodheaders
- uses: actions/checkout@v4
with:
path: gfwens
- uses: actions/download-artifact@v4
with:
name: premake-persistence
path: gfwens
- uses: actions/download-artifact@v4
with:
name: sdk-persistence-64
path: gfwens/deps
- uses: microsoft/setup-msbuild@v2
# Dumb way of doing this but oh well. Saves fight premake on this.
- name: "Compile Binary"
if: ${{ matrix.arch == 64 }}
run: |
cd gfwens
./premake5.exe vs2019
MSBuild.exe /p:Configuration=Release /property:Platform=x${{matrix.arch}}
- name: "Compile Binary"
if: ${{ matrix.arch != 64 }}
run: |
cd gfwens
./premake5.exe vs2019
MSBuild.exe /p:Configuration=Release
- uses: actions/upload-artifact@v4
with:
name: gmsv_fwens_win${{matrix.arch}}.dll
path: gfwens\bin\release\gmsv_fwens_win${{matrix.arch}}.dll
###
build-linux:
runs-on: ubuntu-latest
needs: fetch-dependencies
strategy:
matrix:
arch: [32, 64]
steps:
- uses: actions/checkout@v4
with:
repository: facepunch/gmod-module-base
ref: refs/heads/development
path: gmodheaders
- uses: actions/checkout@v4
with:
path: gfwens
- uses: actions/download-artifact@v4
with:
name: premake-persistence
path: gfwens
- uses: actions/download-artifact@v4
with:
name: sdk-persistence-64
path: gfwens/deps
- name: "Compile Binary"
run: |
sudo apt update && sudo apt install gcc-multilib g++-multilib -y
cd gfwens
chmod +x ./premake5
./premake5 gmake2
make config=release_x${{matrix.arch}}
- uses: actions/upload-artifact@v4
if: ${{ matrix.arch != 64 }}
with:
name: gmsv_fwens_linux.dll
path: gfwens/bin/release/gmsv_fwens_linux.dll
- uses: actions/upload-artifact@v4
if: ${{ matrix.arch == 64 }}
with:
name: gmsv_fwens_linux${{matrix.arch}}.dll
path: gfwens/bin/release/gmsv_fwens_linux${{matrix.arch}}.dll
release:
runs-on: ubuntu-latest
needs: [build-win, build-linux]
steps:
- name: Get short hash
id: gensha
run: echo "::set-output name=sha8::$(echo ${GITHUB_SHA} | cut -c1-8)"
- uses: actions/download-artifact@v4
with:
name: gmsv_fwens_linux.dll
- uses: actions/download-artifact@v4
with:
name: gmsv_fwens_linux64.dll
- uses: actions/download-artifact@v4
with:
name: gmsv_fwens_win32.dll
- uses: actions/download-artifact@v4
with:
name: gmsv_fwens_win64.dll
- uses: ncipollo/release-action@v1
with:
artifacts: "*.dll"
token: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ steps.gensha.outputs.sha8 }}
omitBody: true
- uses: geekyeggo/delete-artifact@v5
with:
name: |
gmsv_fwens_win32.dll
gmsv_fwens_win64.dll
gmsv_fwens_linux.dll
gmsv_fwens_linux64.dll
premake-persistence
sdk-persistence-32
sdk-persistence-64