-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
27 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,12 +23,14 @@ jobs: | |
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Setup MSBuild | ||
uses: microsoft/[email protected] | ||
uses: microsoft/[email protected] | ||
with: | ||
vs-version: '16.8' | ||
|
||
- name: Build | ||
run: | | ||
|
@@ -43,7 +45,7 @@ jobs: | |
move msvc\${{ env.buildRelease }}\reapi_amxx.pdb publish\debug\reapi_amxx.pdb | ||
- name: Deploy artifacts | ||
uses: actions/upload-artifact@v2 | ||
uses: actions/upload-artifact@v3.1.1 | ||
with: | ||
name: win32 | ||
path: publish/* | ||
|
@@ -52,17 +54,34 @@ jobs: | |
name: 'Linux' | ||
runs-on: ubuntu-latest | ||
container: s1lentq/linux86buildtools:latest | ||
outputs: | ||
app-version: ${{ steps.app-version.outputs.version }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Build using Intel C++ Compiler 19.0 | ||
run: | | ||
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 | ||
run: | | ||
mkdir -p publish/addons/amxmodx/modules | ||
|
@@ -72,7 +91,6 @@ jobs: | |
- name: Move files | ||
run: | | ||
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 | ||
run: | | ||
|
@@ -86,55 +104,36 @@ jobs: | |
shell: bash | ||
|
||
- name: Deploy artifacts | ||
uses: actions/upload-artifact@v2 | ||
uses: actions/upload-artifact@v3.1.1 | ||
id: upload-job | ||
with: | ||
name: linux32 | ||
path: publish/* | ||
|
||
- name: Cleanup temporary artifacts | ||
if: success() && steps.upload-job.outcome == 'success' | ||
run: | | ||
rm -f appversion.h | ||
publish: | ||
name: 'Publish' | ||
runs-on: ubuntu-latest | ||
needs: [windows, linux] | ||
|
||
steps: | ||
- name: Deploying linux artifacts | ||
uses: actions/download-artifact@v2 | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: linux32 | ||
|
||
- name: Deploying windows artifacts | ||
uses: actions/download-artifact@v2 | ||
uses: actions/download-artifact@v3 | ||
with: | ||
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 | ||
id: packaging-job | ||
if: | | ||
github.event_name == 'release' && | ||
github.event.action == 'published' && | ||
startsWith(github.ref, 'refs/tags/') | ||
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 | ||
uses: softprops/action-gh-release@v1 | ||
|
@@ -147,9 +146,3 @@ jobs: | |
*.zip | ||
env: | ||
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 |