mirror of
https://github.com/rehlds/reapi.git
synced 2025-04-23 23:03:30 +03:00
Update workflows/build.yml
This commit is contained in:
parent
eab165880e
commit
da81fe511d
61
.github/workflows/build.yml
vendored
61
.github/workflows/build.yml
vendored
@ -23,12 +23,14 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Setup MSBuild
|
- name: Setup MSBuild
|
||||||
uses: microsoft/setup-msbuild@v1.0.2
|
uses: microsoft/setup-msbuild@v1.1.3
|
||||||
|
with:
|
||||||
|
vs-version: '16.8'
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
@ -43,7 +45,7 @@ jobs:
|
|||||||
move msvc\${{ env.buildRelease }}\reapi_amxx.pdb publish\debug\reapi_amxx.pdb
|
move msvc\${{ env.buildRelease }}\reapi_amxx.pdb publish\debug\reapi_amxx.pdb
|
||||||
|
|
||||||
- name: Deploy artifacts
|
- name: Deploy artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3.1.1
|
||||||
with:
|
with:
|
||||||
name: win32
|
name: win32
|
||||||
path: publish/*
|
path: publish/*
|
||||||
@ -52,10 +54,12 @@ jobs:
|
|||||||
name: 'Linux'
|
name: 'Linux'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
container: s1lentq/linux86buildtools:latest
|
container: s1lentq/linux86buildtools:latest
|
||||||
|
outputs:
|
||||||
|
app-version: ${{ steps.app-version.outputs.version }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
@ -63,6 +67,21 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
rm -rf build && CC=icc CXX=icpc cmake -B build && cmake --build build -j8
|
rm -rf build && CC=icc CXX=icpc cmake -B build && cmake --build build -j8
|
||||||
|
|
||||||
|
- name: Reading appversion.h
|
||||||
|
id: app-version
|
||||||
|
run: |
|
||||||
|
if [ -e "reapi/version/appversion.h" ]; then
|
||||||
|
APP_VERSION=$(cat "reapi/version/appversion.h" | grep -wi '#define APP_VERSION_STRD' | sed -e 's/#define APP_VERSION_STRD[ \t\r\n\v\f]\+\(.*\)/\1/i' -e 's/\r//g')
|
||||||
|
if [ $? -ne 0 ]; then
|
||||||
|
APP_VERSION=""
|
||||||
|
else
|
||||||
|
# Remove quotes
|
||||||
|
APP_VERSION=$(echo $APP_VERSION | xargs)
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
echo "version=${APP_VERSION}" >> "$GITHUB_OUTPUT"
|
||||||
|
shell: bash
|
||||||
|
|
||||||
- name: Prepare AMXX
|
- name: Prepare AMXX
|
||||||
run: |
|
run: |
|
||||||
mkdir -p publish/addons/amxmodx/modules
|
mkdir -p publish/addons/amxmodx/modules
|
||||||
@ -72,7 +91,6 @@ jobs:
|
|||||||
- name: Move files
|
- name: Move files
|
||||||
run: |
|
run: |
|
||||||
mv build/reapi/reapi_amxx_i386.so publish/addons/amxmodx/modules/reapi_amxx_i386.so
|
mv build/reapi/reapi_amxx_i386.so publish/addons/amxmodx/modules/reapi_amxx_i386.so
|
||||||
mv reapi/version/appversion.h publish/appversion.h
|
|
||||||
|
|
||||||
- name: Run GLIBC/ABI version compat test
|
- name: Run GLIBC/ABI version compat test
|
||||||
run: |
|
run: |
|
||||||
@ -86,17 +104,12 @@ jobs:
|
|||||||
shell: bash
|
shell: bash
|
||||||
|
|
||||||
- name: Deploy artifacts
|
- name: Deploy artifacts
|
||||||
uses: actions/upload-artifact@v2
|
uses: actions/upload-artifact@v3.1.1
|
||||||
id: upload-job
|
id: upload-job
|
||||||
with:
|
with:
|
||||||
name: linux32
|
name: linux32
|
||||||
path: publish/*
|
path: publish/*
|
||||||
|
|
||||||
- name: Cleanup temporary artifacts
|
|
||||||
if: success() && steps.upload-job.outcome == 'success'
|
|
||||||
run: |
|
|
||||||
rm -f appversion.h
|
|
||||||
|
|
||||||
publish:
|
publish:
|
||||||
name: 'Publish'
|
name: 'Publish'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
@ -104,29 +117,15 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Deploying linux artifacts
|
- name: Deploying linux artifacts
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: linux32
|
name: linux32
|
||||||
|
|
||||||
- name: Deploying windows artifacts
|
- name: Deploying windows artifacts
|
||||||
uses: actions/download-artifact@v2
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: win32
|
name: win32
|
||||||
|
|
||||||
- name: Reading appversion.h
|
|
||||||
run: |
|
|
||||||
if [ -e appversion.h ]; then
|
|
||||||
APP_VERSION=$(cat appversion.h | grep -wi '#define APP_VERSION_STRD' | sed -e 's/#define APP_VERSION_STRD[ \t\r\n\v\f]\+\(.*\)/\1/i' -e 's/\r//g')
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
APP_VERSION=""
|
|
||||||
else
|
|
||||||
# Remove quotes
|
|
||||||
APP_VERSION=$(echo $APP_VERSION | xargs)
|
|
||||||
echo "APP_VERSION=${APP_VERSION}" >> $GITHUB_ENV
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
rm -f appversion.h
|
|
||||||
|
|
||||||
- name: Packaging binaries
|
- name: Packaging binaries
|
||||||
id: packaging-job
|
id: packaging-job
|
||||||
if: |
|
if: |
|
||||||
@ -134,7 +133,7 @@ jobs:
|
|||||||
github.event.action == 'published' &&
|
github.event.action == 'published' &&
|
||||||
startsWith(github.ref, 'refs/tags/')
|
startsWith(github.ref, 'refs/tags/')
|
||||||
run: |
|
run: |
|
||||||
7z a -tzip reapi-bin-${{ env.APP_VERSION }}.zip addons/
|
7z a -tzip reapi-bin-${{ needs.linux.outputs.app-version }}.zip addons/
|
||||||
|
|
||||||
- name: Publish artifacts
|
- name: Publish artifacts
|
||||||
uses: softprops/action-gh-release@v1
|
uses: softprops/action-gh-release@v1
|
||||||
@ -147,9 +146,3 @@ jobs:
|
|||||||
*.zip
|
*.zip
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.API_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.API_TOKEN }}
|
||||||
|
|
||||||
- name: Cleanup temporary artifacts
|
|
||||||
if: success() && steps.publish-job.outcome == 'success'
|
|
||||||
run: |
|
|
||||||
rm -rf addons debug
|
|
||||||
rm -f *.zip appversion.h
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user