HevMisc: Set NOFILE soft limit to hard limit before applying requeste… #125
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: | |
| push: | |
| branches: | |
| - main | |
| pull_request: | |
| release: | |
| types: | |
| - published | |
| workflow_dispatch: | |
| jobs: | |
| source: | |
| name: Source | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| submodules: true | |
| - name: Gen Source | |
| run: | | |
| REV_ID=$(git rev-parse --short HEAD) | |
| mkdir -p hev-socks5-server-${{ github.ref_name }} | |
| git ls-files --recurse-submodules | tar c -O -T- | tar x -C hev-socks5-server-${{ github.ref_name }} | |
| echo ${REV_ID} > hev-socks5-server-${{ github.ref_name }}/.rev-id | |
| tar cJf hev-socks5-server-${{ github.ref_name }}.tar.xz hev-socks5-server-${{ github.ref_name }} | |
| - name: Upload source | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: hev-socks5-server-${{ github.ref_name }}.tar.xz | |
| path: hev-socks5-server-${{ github.ref_name }}.tar.xz | |
| if-no-files-found: error | |
| retention-days: 1 | |
| linux: | |
| name: Linux | |
| runs-on: ubuntu-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - name: arm64 | |
| tool: aarch64-unknown-linux-musl | |
| - name: arm32 | |
| tool: arm-unknown-linux-musleabi | |
| - name: arm32hf | |
| tool: arm-unknown-linux-musleabihf | |
| - name: arm32v7 | |
| tool: armv7-unknown-linux-musleabi | |
| - name: arm32v7hf | |
| tool: armv7-unknown-linux-musleabihf | |
| - name: i586 | |
| tool: i586-unknown-linux-musl | |
| - name: i686 | |
| tool: i686-unknown-linux-musl | |
| - name: loong64 | |
| tool: loongarch64-unknown-linux-musl | |
| - name: m68k | |
| tool: m68k-unknown-linux-musl | |
| - name: microblazeel | |
| tool: microblazeel-xilinx-linux-musl | |
| - name: microblaze | |
| tool: microblaze-xilinx-linux-musl | |
| - name: mips64el | |
| tool: mips64el-unknown-linux-musl | |
| - name: mips64 | |
| tool: mips64-unknown-linux-musl | |
| - name: mips32el | |
| tool: mipsel-unknown-linux-musl | |
| - name: mips32elsf | |
| tool: mipsel-unknown-linux-muslsf | |
| - name: mips32 | |
| tool: mips-unknown-linux-musl | |
| - name: mips32sf | |
| tool: mips-unknown-linux-muslsf | |
| - name: or1k | |
| tool: or1k-unknown-linux-musl | |
| - name: powerpc64le | |
| tool: powerpc64le-unknown-linux-musl | |
| - name: powerpc64 | |
| tool: powerpc64-unknown-linux-musl | |
| - name: powerpcle | |
| tool: powerpcle-unknown-linux-musl | |
| - name: powerpc | |
| tool: powerpc-unknown-linux-musl | |
| - name: riscv32 | |
| tool: riscv32-unknown-linux-musl | |
| - name: riscv64 | |
| tool: riscv64-unknown-linux-musl | |
| - name: s390x | |
| tool: s390x-ibm-linux-musl | |
| - name: sh4 | |
| tool: sh4-multilib-linux-musl | |
| - name: x86_64 | |
| tool: x86_64-unknown-linux-musl | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| submodules: true | |
| - name: Build ${{ matrix.name }} | |
| run: | | |
| sudo mkdir -p /opt/x-tools | |
| wget https://github.com/cross-tools/musl-cross/releases/download/20250929/${{ matrix.tool }}.tar.xz | |
| sudo tar xf ${{ matrix.tool }}.tar.xz -C /opt/x-tools | |
| make CROSS_PREFIX=/opt/x-tools/${{ matrix.tool }}/bin/${{ matrix.tool }}- CFLAGS=${{ matrix.env.CFLAGS }} ENABLE_STATIC=1 -j`nproc` | |
| cp bin/hev-socks5-server hev-socks5-server-linux-${{ matrix.name }} | |
| - name: Upload ${{ matrix.name }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: hev-socks5-server-linux-${{ matrix.name }} | |
| path: hev-socks5-server-linux-${{ matrix.name }} | |
| if-no-files-found: error | |
| retention-days: 1 | |
| windows: | |
| name: Windows | |
| runs-on: windows-latest | |
| defaults: | |
| run: | |
| shell: cmd | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| submodules: true | |
| - name: Setup MSYS2 | |
| uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: MSYS | |
| location: D:\msys2 | |
| update: true | |
| install: >- | |
| gcc | |
| git | |
| make | |
| wget | |
| zip | |
| openssl-devel | |
| - name: Build | |
| shell: msys2 {0} | |
| run: | | |
| export MSYS=winsymlinks:native | |
| git clone --depth=1 --recursive file://`pwd` work; cd work | |
| make -j`nproc` | |
| mkdir hev-socks5-server | |
| cp bin/hev-socks5-server* hev-socks5-server | |
| wget -P hev-socks5-server https://github.com/heiher/msys2/releases/latest/download/msys-2.0.dll | |
| zip -r ../hev-socks5-server-win64.zip hev-socks5-server | |
| - name: Upload ${{ matrix.name }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: hev-socks5-server-win64.zip | |
| path: hev-socks5-server-win64.zip | |
| if-no-files-found: error | |
| retention-days: 1 | |
| macos: | |
| name: macOS | |
| runs-on: macos-latest | |
| strategy: | |
| matrix: | |
| include: | |
| - name: arm64 | |
| flags: -arch arm64 -mmacosx-version-min=11.0 | |
| - name: x86_64 | |
| flags: -arch x86_64 -mmacosx-version-min=10.6 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| submodules: true | |
| - name: Build ${{ matrix.name }} | |
| run: | | |
| make CC=clang CFLAGS="${{ matrix.flags }}" LFLAGS="${{ matrix.flags }}" -j $(sysctl -n hw.logicalcpu) | |
| cp bin/hev-socks5-server hev-socks5-server-darwin-${{ matrix.name }} | |
| - name: Upload ${{ matrix.name }} | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: hev-socks5-server-darwin-${{ matrix.name }} | |
| path: hev-socks5-server-darwin-${{ matrix.name }} | |
| if-no-files-found: error | |
| retention-days: 1 | |
| freebsd: | |
| name: FreeBSD | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| submodules: true | |
| - name: Build | |
| uses: vmactions/freebsd-vm@v1 | |
| with: | |
| usesh: true | |
| prepare: | | |
| pkg install -y gmake gcc | |
| run: | | |
| gmake | |
| cp bin/hev-socks5-server hev-socks5-server-freebsd-x86_64 | |
| - name: Upload | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: hev-socks5-server-freebsd-x86_64 | |
| path: hev-socks5-server-freebsd-x86_64 | |
| if-no-files-found: error | |
| retention-days: 1 | |
| release: | |
| name: Release | |
| runs-on: ubuntu-latest | |
| needs: | |
| - source | |
| - linux | |
| - macos | |
| - freebsd | |
| - windows | |
| if: github.event_name == 'release' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: release | |
| pattern: "hev-*" | |
| merge-multiple: true | |
| - name: Upload artifacts | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| for i in release/hev-*; do | |
| gh release upload ${{ github.event.release.tag_name }} $i | |
| done | |
| apple: | |
| name: Apple | |
| runs-on: macos-latest | |
| if: github.event_name != 'release' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| submodules: true | |
| - name: Build | |
| run: | | |
| ./build-apple.sh | |
| android: | |
| name: Android | |
| runs-on: ubuntu-latest | |
| if: github.event_name != 'release' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| submodules: true | |
| - name: Prepare | |
| run: | | |
| wget https://dl.google.com/android/repository/android-ndk-r27d-linux.zip | |
| unzip android-ndk-r27d-linux.zip | |
| ln -sf . jni | |
| - name: Build | |
| run: | | |
| ./android-ndk-r27d/ndk-build | |
| llvm: | |
| name: LLVM | |
| runs-on: ubuntu-latest | |
| if: github.event_name != 'release' | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 1 | |
| submodules: true | |
| - name: Prepare | |
| run: | | |
| sudo apt install -y clang | |
| - name: Build | |
| run: | | |
| make CC=clang ENABLE_STATIC=1 -j`nproc` |