fix(websocket): correct message length handling in WebSocket callback… #35
This file contains hidden or 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 | |
| on: | |
| workflow_dispatch: | |
| push: | |
| branches: | |
| - "main" | |
| paths: | |
| - "src/**" | |
| - "third_party/**" | |
| pull_request: | |
| paths: | |
| - "src/**" | |
| - "third_party/**" | |
| permissions: | |
| contents: write | |
| jobs: | |
| build: | |
| name: build on ${{ matrix.os_short }} | |
| runs-on: ${{ matrix.os }} | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| os: [windows-latest, ubuntu-22.04] | |
| include: | |
| - os: windows-latest | |
| os_short: win | |
| - os: ubuntu-22.04 | |
| os_short: linux | |
| steps: | |
| - name: Prepare env | |
| shell: bash | |
| run: | | |
| echo "GITHUB_SHA_SHORT=${GITHUB_SHA::7}" >> $GITHUB_ENV | |
| - name: Install (Linux) | |
| if: runner.os == 'Linux' | |
| run: | | |
| sudo dpkg --add-architecture i386 | |
| sudo apt-get update | |
| sudo apt-get install -y clang g++-multilib libssl-dev libssl-dev:i386 | |
| echo "CC=clang" >> $GITHUB_ENV | |
| echo "CXX=clang++" >> $GITHUB_ENV | |
| - name: Getting SourceMod | |
| uses: actions/checkout@v4 | |
| with: | |
| repository: alliedmodders/sourcemod | |
| ref: master | |
| path: sourcemod | |
| submodules: recursive | |
| fetch-depth: 1 | |
| - name: Setting up Python and AMBuild | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| cache: 'pip' | |
| - name: Install AMBuild | |
| run: pip install git+https://github.com/alliedmodders/ambuild | |
| - name: Getting own repository | |
| uses: actions/checkout@v4 | |
| with: | |
| path: extension | |
| - uses: microsoft/setup-msbuild@v2 | |
| if: runner.os == 'Windows' | |
| with: | |
| msbuild-architecture: x64 | |
| vs-version: '[17.0,18.0)' | |
| - name: Compiling ${{ github.event.repository.name }} files | |
| working-directory: extension | |
| run: | | |
| mkdir build | |
| cd build | |
| python ../configure.py --enable-optimize --symbol-files --sm-path="${{ github.workspace }}/sourcemod" --targets=x64,x86 | |
| ambuild | |
| - name: Uploading package | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: sm-ext-websocket-${{ matrix.os_short }}-${{ env.GITHUB_SHA_SHORT }} | |
| path: extension/build/package | |
| retention-days: 5 | |
| create-release: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'push' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| with: | |
| path: extension | |
| sparse-checkout: | | |
| src/smsdk_config.h | |
| - name: Get version from smsdk_config.h | |
| id: get_version | |
| run: | | |
| VERSION=$(grep '#define SMEXT_CONF_VERSION' extension/src/smsdk_config.h | awk -F '"' '{print $2}') | |
| if [ -z "$VERSION" ]; then | |
| echo "Error: Could not find version in smsdk_config.h" | |
| exit 1 | |
| fi | |
| echo "version=$VERSION" >> $GITHUB_OUTPUT | |
| - name: Generate Release Notes | |
| run: echo "${{ github.event.head_commit.message }}" >> release_notes.md | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: artifacts | |
| - name: Create Release Archives | |
| run: | | |
| cd artifacts | |
| for dir in sm-ext-websocket-*; do | |
| 7z a "../${dir}.zip" "./${dir}/"* | |
| done | |
| - name: Update Release | |
| uses: softprops/action-gh-release@v2 | |
| with: | |
| tag_name: ${{ steps.get_version.outputs.version }} | |
| name: Release ${{ steps.get_version.outputs.version }} | |
| draft: false | |
| prerelease: false | |
| body_path: release_notes.md | |
| files: | | |
| sm-ext-websocket-*.zip | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |