Build WsaPatch.dll #1411
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
name: Build WsaPatch.dll | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ "master" ] | |
paths: | |
- .github/workflow/WSAPatch.yml | |
pull_request: | |
branches: [ "master" ] | |
paths: | |
- .github/workflow/WSAPatch.yml | |
schedule: | |
- cron: '0 0 * * *' | |
env: | |
# Path to the solution file relative to the root of the project. | |
SOLUTION_FILE_PATH: . | |
BUILD_CONFIGURATION: Release | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
outputs: | |
is_update: ${{ steps.check.outputs.is_update }} | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Clone Repository | |
run: | | |
git clone https://github.com/cinit/WSAPatch.git | |
- name: Check Update | |
id: check | |
run: | | |
export UPDATE_DATE1=$(git log -1 --date=unix --pretty=format:'%cd' DLLs/x64/WsaPatch.dll) UPDATE_DATE2=$(git log -1 --date=unix --pretty=format:'%cd' DLLs/arm64/WsaPatch.dll) | |
cd WSAPatch | |
export UPDATE_DATE3=$(git log -1 --date=unix --pretty=format:'%cd') | |
if [ $UPDATE_DATE3 -gt $UPDATE_DATE1 ];then echo "is_update=yes" >> "$GITHUB_OUTPUT";elif [ $UPDATE_DATE3 -gt $UPDATE_DATE2 ];then echo "is_update=yes" >> "$GITHUB_OUTPUT";else echo "is_update=no" >> "$GITHUB_OUTPUT";fi | |
build: | |
needs: check | |
if: needs.check.outputs.is_update == 'yes' || github.event_name == 'workflow_dispatch' | |
runs-on: windows-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Clone Repository | |
run: | | |
new-item WSAPatch -type "directory" | |
cd WSAPatch | |
git clone https://github.com/cinit/WSAPatch.git WSAPatch_x64 | |
git clone https://github.com/cinit/WSAPatch.git WSAPatch_arm64 | |
- name: Configure x64 | |
run: | | |
cd WSAPatch/WSAPatch_x64 | |
mkdir build | |
cmake -G "Visual Studio 17 2022" -A x64 -B build | |
- name: Build Release x64 | |
run: | | |
cd WSAPatch/WSAPatch_x64 | |
cmake --build build --config Release --verbose | |
copy build/Release/WsaPatch.dll ../../DLLs/x64 | |
- name: Configure arm64 | |
run: | | |
cd WSAPatch/WSAPatch_arm64 | |
mkdir build | |
cmake -G "Visual Studio 17 2022" -A arm64 -B build | |
- name: Build Release arm64 | |
run: | | |
cd WSAPatch/WSAPatch_arm64 | |
cmake --build build --config Release --verbose | |
copy build/Release/WsaPatch.dll ../../DLLs/arm64 | |
- name: Upload WsaPatch.dll | |
uses: actions/upload-artifact@v4 | |
with: | |
name: WsaPatch-build | |
path: DLLs | |
- name: commit | |
run: | | |
remove-item WSAPatch -Recurse -Force | |
git pull | |
git config --global user.email github-actions[bot]@users.noreply.github.com | |
git config --global user.name github-actions[bot] | |
git add DLLs | |
git commit -m "update WsaPatch.dll" | |
- name: Push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |