From 9a7e55b3e07bd1e980768836277db64d5201ed22 Mon Sep 17 00:00:00 2001 From: Syuugo Date: Sun, 16 Jun 2024 00:31:25 +0900 Subject: [PATCH 1/3] Update workflows --- .github/workflows/build_source_release.yml | 19 ++++++------- .github/workflows/coverity.yml | 13 +++++++-- .github/workflows/fedora-rawhide.yml | 11 +++++--- .github/workflows/linux.yml | 5 +++- .github/workflows/macos.yml | 8 ++++-- .github/workflows/musl.yml | 25 +++++++++------- .github/workflows/stb_check.yml | 9 ++++-- .github/workflows/windows.yml | 19 ++++++++++--- .github/workflows/windows_release.yml | 33 +++++++++++----------- 9 files changed, 88 insertions(+), 54 deletions(-) diff --git a/.github/workflows/build_source_release.yml b/.github/workflows/build_source_release.yml index f2567459..b6f404d4 100644 --- a/.github/workflows/build_source_release.yml +++ b/.github/workflows/build_source_release.yml @@ -8,15 +8,16 @@ on: jobs: build: - name: build + name: Build runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + - name: Checkout + uses: actions/checkout@v4 with: submodules: true - - name: archive + - name: Archive id: archive run: | VERSION=${{ github.event.release.tag_name }} @@ -28,12 +29,8 @@ jobs: tar cJf $TARBALL $PKGNAME echo "tarball=$TARBALL" >> $GITHUB_OUTPUT - - name: upload tarball - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Upload tarball + uses: softprops/action-gh-release@v2 with: - upload_url: ${{ github.event.release.upload_url }} - asset_path: ./${{ steps.archive.outputs.tarball }} - asset_name: ${{ steps.archive.outputs.tarball }} - asset_content_type: application/gzip + files: ./${{ steps.archive.outputs.tarball }} + name: ${{ steps.archive.outputs.tarball }} diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index 513f3df5..319e9205 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -1,4 +1,3 @@ - name: Coverity on: @@ -10,28 +9,36 @@ permissions: jobs: scan: + name: Scan runs-on: ubuntu-latest - if: ${{ github.repository_owner == 'SoftEtherVPN' }} + if: github.repository_owner == 'SoftEtherVPN' steps: - - uses: actions/checkout@v2 + + - name: Checkout + uses: actions/checkout@v4 with: submodules: true + - name: Install apt dependencies run: | sudo apt-get update sudo apt-get install -y cmake gcc g++ libncurses5-dev libreadline-dev libssl-dev make zlib1g-dev libsodium-dev + - name: Download Coverity build tool run: | wget -c -N https://scan.coverity.com/download/linux64 --post-data "token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=SoftEtherVPN%2FSoftEtherVPN" -O coverity_tool.tar.gz mkdir coverity_tool tar xzf coverity_tool.tar.gz --strip 1 -C coverity_tool + - name: Configure run: | ./configure + - name: Build with Coverity build tool run: | export PATH=`pwd`/coverity_tool/bin:$PATH cov-build --dir cov-int make -C build + - name: Submit build result to Coverity Scan run: | tar czvf cov.tar.gz cov-int diff --git a/.github/workflows/fedora-rawhide.yml b/.github/workflows/fedora-rawhide.yml index bafcd2f7..b7a74767 100644 --- a/.github/workflows/fedora-rawhide.yml +++ b/.github/workflows/fedora-rawhide.yml @@ -19,15 +19,18 @@ jobs: container: image: fedora:rawhide steps: - - uses: actions/checkout@v1 - with: - submodules: true + - name: Install dependencies run: | dnf -y install git cmake ncurses-devel openssl-devel libsodium-devel readline-devel zlib-devel gcc-c++ clang + + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + - name: Compile with ${{ matrix.cc }} run: | export CC=${{ matrix.cc }} ./configure make -C build - diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 799f4b8f..a7d847f5 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -1,3 +1,4 @@ +name: Linux on: [push, pull_request] permissions: @@ -5,14 +6,16 @@ permissions: jobs: build_and_test: + name: Build runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 with: submodules: true - name: Install dependencies - run: sudo apt update && sudo apt-get -y install cmake gcc g++ ninja-build libncurses5-dev libreadline-dev libsodium-dev libssl-dev make zlib1g-dev liblz4-dev libnl-genl-3-dev + run: sudo apt-get update && sudo apt-get -y install cmake gcc g++ ninja-build libncurses5-dev libreadline-dev libsodium-dev libssl-dev make zlib1g-dev liblz4-dev libnl-genl-3-dev - name: Build run: | diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index f6821b9b..ad4f9953 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,3 +1,4 @@ +name: macOS on: [push, pull_request, workflow_dispatch] permissions: @@ -11,18 +12,21 @@ jobs: name: ${{ matrix.os }} runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v1 + + - uses: actions/checkout@v4 with: submodules: true + - name: Install dependencies run: | brew install libsodium + - name: Compile run: | ./configure make -C build + - name: Test run: | otool -L build/vpnserver .ci/memory-leak-test.sh - diff --git a/.github/workflows/musl.yml b/.github/workflows/musl.yml index 240b6a25..73917802 100644 --- a/.github/workflows/musl.yml +++ b/.github/workflows/musl.yml @@ -1,4 +1,4 @@ -name: alpine/musl +name: Alpine/musl on: [push, pull_request] @@ -7,17 +7,22 @@ permissions: jobs: musl: - name: gcc - runs-on: ubuntu-latest - container: - image: alpine:latest - steps: - - uses: actions/checkout@v1 - with: - submodules: true + name: gcc + runs-on: ubuntu-latest + container: + image: alpine:latest + steps: + - name: Install dependencies run: apk add binutils --no-cache build-base readline-dev openssl-dev ncurses-dev git cmake zlib-dev libsodium-dev gnu-libiconv + + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true + - name: Configure run: ./configure + - name: make - run: make -C build \ No newline at end of file + run: make -C build diff --git a/.github/workflows/stb_check.yml b/.github/workflows/stb_check.yml index 5353250e..e917378c 100644 --- a/.github/workflows/stb_check.yml +++ b/.github/workflows/stb_check.yml @@ -1,3 +1,4 @@ +name: STB Check on: [push, pull_request] permissions: @@ -5,12 +6,16 @@ permissions: jobs: check: + name: Check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v1 + + - name: Checkout + uses: actions/checkout@v4 with: submodules: true + - name: Check run: | cd developer_tools/stbchecker - dotnet run ../../src/bin/hamcore \ No newline at end of file + dotnet run ../../src/bin/hamcore diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index d5cccba3..3bed9f7f 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,3 +1,4 @@ +name: Windows on: [push, pull_request] permissions: @@ -14,19 +15,24 @@ jobs: runs-on: windows-latest name: ${{ matrix.platform.ARCHITECTURE }} steps: - - uses: actions/checkout@v4 + + - name: Checkout + uses: actions/checkout@v4 with: submodules: true + - name: Cache vcpkg uses: actions/cache@v4 with: path: 'build/vcpkg_installed/' key: vcpkg-${{ matrix.platform.VCPKG_TRIPLET }} + - name: Set version variables run: | $v = python version.py echo "VERSION=$v" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append shell: pwsh + - name: Build env: ARCHITECTURE: ${{ matrix.platform.ARCHITECTURE }} @@ -44,11 +50,14 @@ jobs: vpnsetup /SFXMODE:vpnclient /SFXOUT:"installers\softether-vpnclient-%VERSION%.%BUILD_NUMBER%.%ARCHITECTURE%.exe" vpnsetup /SFXMODE:vpnserver_vpnbridge /SFXOUT:"installers\softether-vpnserver_vpnbridge-%VERSION%.%BUILD_NUMBER%.%ARCHITECTURE%.exe" shell: cmd + - name: Test shell: powershell run: | . .ci/appveyor-vpntest.ps1 - - uses: actions/upload-artifact@v4 + + - name: Upload built binaries + uses: actions/upload-artifact@v4 with: if-no-files-found: error name: Binaries-${{ matrix.platform.ARCHITECTURE }} @@ -56,8 +65,10 @@ jobs: build/*.exe build/*.pdb build/*.se2 - - uses: actions/upload-artifact@v4 + + - name: Upload installers + uses: actions/upload-artifact@v4 with: if-no-files-found: error name: Installers-${{ matrix.platform.ARCHITECTURE }} - path: build/installers \ No newline at end of file + path: build/installers diff --git a/.github/workflows/windows_release.yml b/.github/workflows/windows_release.yml index d9198934..ef088c43 100644 --- a/.github/workflows/windows_release.yml +++ b/.github/workflows/windows_release.yml @@ -14,16 +14,19 @@ permissions: jobs: release: + name: Release runs-on: windows-latest outputs: upload_url: "${{ steps.create_release.outputs.upload_url }}" steps: + - name: "Checkout repository" uses: actions/checkout@v4 - name: "Create GitHub release" id: create_release - uses: softprops/action-gh-release@v1 + uses: softprops/action-gh-release@v2 + build-windows: name: ${{ matrix.platform.ARCHITECTURE }} runs-on: windows-latest @@ -35,15 +38,18 @@ jobs: { ARCHITECTURE: x64, COMPILER_PATH: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/Llvm/x64/bin/clang-cl.exe", VCPKG_TRIPLET: "x64-windows-static", VCVARS_PATH: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"} ] steps: + - name: "Checkout repository" uses: actions/checkout@v4 with: submodules: true + - name: Cache vcpkg uses: actions/cache@v4 with: path: 'build/vcpkg_installed/' key: vcpkg-release-${{ matrix.platform.VCPKG_TRIPLET }} + - name: Set version variables run: | $b=(Get-Content CMakeSettings.json | Out-String | ConvertFrom-Json).environments.BuildNumber @@ -51,6 +57,7 @@ jobs: $v = python version.py echo "VERSION=$v" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append shell: pwsh + - name: Build env: ARCHITECTURE: ${{ matrix.platform.ARCHITECTURE }} @@ -68,27 +75,19 @@ jobs: vpnsetup /SFXMODE:vpnserver_vpnbridge /SFXOUT:"installers\softether-vpnserver_vpnbridge-%VERSION%.%BUILD_NUMBER%.%ARCHITECTURE%.exe" shell: cmd - - name: dir + - name: Show directory items run: | Get-ChildItem -Recurse build/installers shell: pwsh - name: "Upload softether-vpnclient" - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: "${{ github.token }}" + uses: softprops/action-gh-release@v2 with: - upload_url: "${{ needs.release.outputs.upload_url }}" - asset_path: "build/installers/softether-vpnclient-${{ env.VERSION }}.${{ env.BUILD_NUMBER }}.${{ matrix.platform.ARCHITECTURE }}.exe" - asset_name: "softether-vpnclient-${{ env.VERSION }}.${{ env.BUILD_NUMBER }}.${{ matrix.platform.ARCHITECTURE }}.exe" - asset_content_type: "application/octet-stream" + files: "build/installers/softether-vpnclient-${{ env.VERSION }}.${{ env.BUILD_NUMBER }}.${{ matrix.platform.ARCHITECTURE }}.exe" + name: "softether-vpnclient-${{ env.VERSION }}.${{ env.BUILD_NUMBER }}.${{ matrix.platform.ARCHITECTURE }}.exe" + - name: "Upload softether-vpnserver_vpnbridge" - uses: actions/upload-release-asset@v1 - env: - GITHUB_TOKEN: "${{ github.token }}" + uses: softprops/action-gh-release@v2 with: - upload_url: "${{ needs.release.outputs.upload_url }}" - asset_path: "build/installers/softether-vpnserver_vpnbridge-${{ env.VERSION }}.${{ env.BUILD_NUMBER }}.${{ matrix.platform.ARCHITECTURE }}.exe" - asset_name: "softether-vpnserver_vpnbridge-${{ env.VERSION }}.${{ env.BUILD_NUMBER }}.${{ matrix.platform.ARCHITECTURE }}.exe" - asset_content_type: "application/octet-stream" - + files: "build/installers/softether-vpnserver_vpnbridge-${{ env.VERSION }}.${{ env.BUILD_NUMBER }}.${{ matrix.platform.ARCHITECTURE }}.exe" + name: "softether-vpnserver_vpnbridge-${{ env.VERSION }}.${{ env.BUILD_NUMBER }}.${{ matrix.platform.ARCHITECTURE }}.exe" From db61205eae73ad09903ea7f9790d8245f6b11949 Mon Sep 17 00:00:00 2001 From: Syuugo Date: Wed, 26 Jun 2024 15:54:56 +0900 Subject: [PATCH 2/3] Fix missing name --- .github/workflows/macos.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index ad4f9953..70ce9b78 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -13,7 +13,8 @@ jobs: runs-on: ${{ matrix.os }} steps: - - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 with: submodules: true From 56c146e6c011f1f3734fe97cc085ae7cf20361fb Mon Sep 17 00:00:00 2001 From: Syuugo Date: Sat, 31 Aug 2024 14:58:49 +0900 Subject: [PATCH 3/3] Striving for consistency Standardized writing style --- .github/workflows/build_source_release.yml | 40 +++---- .github/workflows/coverity.yml | 60 +++++------ .github/workflows/fedora-rawhide.yml | 31 +++--- .github/workflows/linux.yml | 51 ++++----- .github/workflows/macos.yml | 42 ++++---- .github/workflows/musl.yml | 16 +-- .github/workflows/stb_check.yml | 22 ++-- .github/workflows/windows.yml | 119 +++++++++++---------- .github/workflows/windows_release.yml | 38 ++++--- 9 files changed, 223 insertions(+), 196 deletions(-) diff --git a/.github/workflows/build_source_release.yml b/.github/workflows/build_source_release.yml index b6f404d4..90a2dd9a 100644 --- a/.github/workflows/build_source_release.yml +++ b/.github/workflows/build_source_release.yml @@ -12,25 +12,25 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: true + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true - - name: Archive - id: archive - run: | - VERSION=${{ github.event.release.tag_name }} - PKGNAME="SoftEtherVPN-$VERSION" - mkdir -p /tmp/$PKGNAME - mv * /tmp/$PKGNAME - mv /tmp/$PKGNAME . - TARBALL=$PKGNAME.tar.xz - tar cJf $TARBALL $PKGNAME - echo "tarball=$TARBALL" >> $GITHUB_OUTPUT + - name: Archive + id: archive + run: | + VERSION=${{ github.event.release.tag_name }} + PKGNAME="SoftEtherVPN-$VERSION" + mkdir -p /tmp/$PKGNAME + mv * /tmp/$PKGNAME + mv /tmp/$PKGNAME . + TARBALL=$PKGNAME.tar.xz + tar cJf $TARBALL $PKGNAME + echo "tarball=$TARBALL" >> $GITHUB_OUTPUT - - name: Upload tarball - uses: softprops/action-gh-release@v2 - with: - files: ./${{ steps.archive.outputs.tarball }} - name: ${{ steps.archive.outputs.tarball }} + - name: Upload tarball + uses: softprops/action-gh-release@v2 + with: + files: ./${{ steps.archive.outputs.tarball }} + name: ${{ steps.archive.outputs.tarball }} \ No newline at end of file diff --git a/.github/workflows/coverity.yml b/.github/workflows/coverity.yml index 319e9205..f71ae760 100644 --- a/.github/workflows/coverity.yml +++ b/.github/workflows/coverity.yml @@ -2,7 +2,7 @@ name: Coverity on: schedule: - - cron: "0 0 * * *" + - cron: "0 0 * * *" permissions: contents: read @@ -14,37 +14,37 @@ jobs: if: github.repository_owner == 'SoftEtherVPN' steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: true + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true - - name: Install apt dependencies - run: | - sudo apt-get update - sudo apt-get install -y cmake gcc g++ libncurses5-dev libreadline-dev libssl-dev make zlib1g-dev libsodium-dev + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get install -y cmake gcc g++ libncurses5-dev libreadline-dev libssl-dev make zlib1g-dev libsodium-dev - - name: Download Coverity build tool - run: | - wget -c -N https://scan.coverity.com/download/linux64 --post-data "token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=SoftEtherVPN%2FSoftEtherVPN" -O coverity_tool.tar.gz - mkdir coverity_tool - tar xzf coverity_tool.tar.gz --strip 1 -C coverity_tool + - name: Download Coverity build tool + run: | + wget -c -N https://scan.coverity.com/download/linux64 --post-data "token=${{ secrets.COVERITY_SCAN_TOKEN }}&project=SoftEtherVPN%2FSoftEtherVPN" -O coverity_tool.tar.gz + mkdir coverity_tool + tar xzf coverity_tool.tar.gz --strip 1 -C coverity_tool - - name: Configure - run: | - ./configure + - name: Configure + run: | + ./configure - - name: Build with Coverity build tool - run: | - export PATH=`pwd`/coverity_tool/bin:$PATH - cov-build --dir cov-int make -C build + - name: Build with Coverity build tool + run: | + export PATH=`pwd`/coverity_tool/bin:$PATH + cov-build --dir cov-int make -C build - - name: Submit build result to Coverity Scan - run: | - tar czvf cov.tar.gz cov-int - curl --form token=${{ secrets.COVERITY_SCAN_TOKEN }} \ - --form email=chipitsine@gmail.com \ - --form file=@cov.tar.gz \ - --form version="Commit $GITHUB_SHA" \ - --form description="Build submitted via CI" \ - https://scan.coverity.com/builds?project=SoftEtherVPN%2FSoftEtherVPN + - name: Submit build result to Coverity Scan + run: | + tar czvf cov.tar.gz cov-int + curl --form token=${{ secrets.COVERITY_SCAN_TOKEN }} \ + --form email=chipitsine@gmail.com \ + --form file=@cov.tar.gz \ + --form version="Commit $GITHUB_SHA" \ + --form description="Build submitted via CI" \ + https://scan.coverity.com/builds?project=SoftEtherVPN%2FSoftEtherVPN \ No newline at end of file diff --git a/.github/workflows/fedora-rawhide.yml b/.github/workflows/fedora-rawhide.yml index deeb9c20..c22dd33b 100644 --- a/.github/workflows/fedora-rawhide.yml +++ b/.github/workflows/fedora-rawhide.yml @@ -7,31 +7,30 @@ on: pull_request: workflow_dispatch: -permissions: - contents: read - jobs: build_and_test: strategy: matrix: - cc: [ gcc, clang ] + cc: + - gcc + - clang name: ${{ matrix.cc }} runs-on: ubuntu-latest container: image: fedora:rawhide steps: - - name: Install dependencies - run: | - dnf -y install git cmake ncurses-devel openssl-devel-engine libsodium-devel readline-devel zlib-devel gcc-c++ clang + - name: Install dependencies + run: | + dnf -y install git cmake ncurses-devel openssl-devel-engine libsodium-devel readline-devel zlib-devel gcc-c++ clang - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: true + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true - - name: Compile with ${{ matrix.cc }} - run: | - export CC=${{ matrix.cc }} - ./configure - make -C build + - name: Compile with ${{ matrix.cc }} + run: | + export CC=${{ matrix.cc }} + ./configure + make -C build \ No newline at end of file diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index a7d847f5..7fa27a75 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -1,8 +1,8 @@ name: Linux -on: [push, pull_request] -permissions: - contents: read +on: + push: + pull_request: jobs: build_and_test: @@ -10,28 +10,31 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - with: - submodules: true + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true - - name: Install dependencies - run: sudo apt-get update && sudo apt-get -y install cmake gcc g++ ninja-build libncurses5-dev libreadline-dev libsodium-dev libssl-dev make zlib1g-dev liblz4-dev libnl-genl-3-dev + - name: Install dependencies + run: | + sudo apt-get update + sudo apt-get -y install cmake gcc g++ ninja-build libncurses5-dev libreadline-dev libsodium-dev libssl-dev make zlib1g-dev liblz4-dev libnl-genl-3-dev - - name: Build - run: | - mkdir build - cd build - cmake -G "Ninja" -DCMAKE_BUILD_TYPE=RelWithDebInfo .. - cmake --build . + - name: Build + run: | + mkdir build + cd build + cmake -G "Ninja" -DCMAKE_BUILD_TYPE=RelWithDebInfo .. + cmake --build . - - name: Build deb packages - run: | - cd build - cpack -C Release -G DEB + - name: Build deb packages + run: | + cd build + cpack -C Release -G DEB - - name: Test - run: | - .ci/appveyor-deb-install-test.sh - sudo apt-get -y install autoconf libtool liblzo2-dev libpam-dev fping unzip libcap-ng-dev # To build OpenVPN - sudo .ci/start-se-openvpn.sh - sudo .ci/run-openvpn-tests.sh + - name: Test + run: | + .ci/appveyor-deb-install-test.sh + sudo apt-get -y install autoconf libtool liblzo2-dev libpam-dev fping unzip libcap-ng-dev # To build OpenVPN + sudo .ci/start-se-openvpn.sh + sudo .ci/run-openvpn-tests.sh \ No newline at end of file diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 70ce9b78..03442b7e 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -1,33 +1,37 @@ name: macOS -on: [push, pull_request, workflow_dispatch] -permissions: - contents: read +on: + push: + pull_request: + workflow_dispatch: jobs: build_and_test: strategy: matrix: - os: [macos-14, macos-13, macos-12] + os: + - macos-14 + - macos-13 + - macos-12 name: ${{ matrix.os }} runs-on: ${{ matrix.os }} steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: true + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true - - name: Install dependencies - run: | - brew install libsodium + - name: Install dependencies + run: | + brew install libsodium - - name: Compile - run: | - ./configure - make -C build + - name: Compile + run: | + ./configure + make -C build - - name: Test - run: | - otool -L build/vpnserver - .ci/memory-leak-test.sh + - name: Test + run: | + otool -L build/vpnserver + .ci/memory-leak-test.sh \ No newline at end of file diff --git a/.github/workflows/musl.yml b/.github/workflows/musl.yml index 73917802..9bb7389b 100644 --- a/.github/workflows/musl.yml +++ b/.github/workflows/musl.yml @@ -1,9 +1,8 @@ name: Alpine/musl -on: [push, pull_request] - -permissions: - contents: read +on: + push: + pull_request: jobs: musl: @@ -14,7 +13,8 @@ jobs: steps: - name: Install dependencies - run: apk add binutils --no-cache build-base readline-dev openssl-dev ncurses-dev git cmake zlib-dev libsodium-dev gnu-libiconv + run: | + apk add binutils --no-cache build-base readline-dev openssl-dev ncurses-dev git cmake zlib-dev libsodium-dev gnu-libiconv - name: Checkout uses: actions/checkout@v4 @@ -22,7 +22,9 @@ jobs: submodules: true - name: Configure - run: ./configure + run: | + ./configure - name: make - run: make -C build + run: | + make -C build \ No newline at end of file diff --git a/.github/workflows/stb_check.yml b/.github/workflows/stb_check.yml index e917378c..877a5d47 100644 --- a/.github/workflows/stb_check.yml +++ b/.github/workflows/stb_check.yml @@ -1,8 +1,8 @@ name: STB Check -on: [push, pull_request] -permissions: - contents: read +on: + push: + pull_request: jobs: check: @@ -10,12 +10,12 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: true + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true - - name: Check - run: | - cd developer_tools/stbchecker - dotnet run ../../src/bin/hamcore + - name: Check + run: | + cd developer_tools/stbchecker + dotnet run ../../src/bin/hamcore \ No newline at end of file diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 3bed9f7f..a97e5208 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -1,74 +1,83 @@ name: Windows -on: [push, pull_request] -permissions: - contents: read +on: + push: + pull_request: jobs: build_and_test: strategy: matrix: platform: [ - { ARCHITECTURE: x86, COMPILER_PATH: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/Llvm/bin/clang-cl.exe", VCPKG_TRIPLET: "x86-windows-static", VCVARS_PATH: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars32.bat"}, - { ARCHITECTURE: x64, COMPILER_PATH: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/Llvm/x64/bin/clang-cl.exe", VCPKG_TRIPLET: "x64-windows-static", VCVARS_PATH: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"} + { + ARCHITECTURE: x86, + COMPILER_PATH: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/Llvm/bin/clang-cl.exe", + VCPKG_TRIPLET: "x86-windows-static", + VCVARS_PATH: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars32.bat" + }, + { + ARCHITECTURE: x64, + COMPILER_PATH: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/Llvm/x64/bin/clang-cl.exe", + VCPKG_TRIPLET: "x64-windows-static", + VCVARS_PATH: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat" + } ] runs-on: windows-latest name: ${{ matrix.platform.ARCHITECTURE }} steps: - - name: Checkout - uses: actions/checkout@v4 - with: - submodules: true + - name: Checkout + uses: actions/checkout@v4 + with: + submodules: true - - name: Cache vcpkg - uses: actions/cache@v4 - with: - path: 'build/vcpkg_installed/' - key: vcpkg-${{ matrix.platform.VCPKG_TRIPLET }} + - name: Cache vcpkg + uses: actions/cache@v4 + with: + path: 'build/vcpkg_installed/' + key: vcpkg-${{ matrix.platform.VCPKG_TRIPLET }} - - name: Set version variables - run: | - $v = python version.py - echo "VERSION=$v" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append - shell: pwsh + - name: Set version variables + run: | + Write-Output "VERSION=$(python version.py)" | Out-File -FilePath $Env:GITHUB_ENV -Encoding UTF8 -Append + shell: pwsh - - name: Build - env: - ARCHITECTURE: ${{ matrix.platform.ARCHITECTURE }} - COMPILER_PATH: ${{ matrix.platform.COMPILER_PATH }} - VCPKG_TRIPLET: ${{ matrix.platform.VCPKG_TRIPLET }} - VCVARS_PATH: ${{ matrix.platform.VCVARS_PATH }} - run: | - set BUILD_NUMBER=0 - mkdir build - cd build - call "%VCVARS_PATH%" - cmake -G "Ninja" -DCMAKE_TOOLCHAIN_FILE="C:\vcpkg\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=%VCPKG_TRIPLET% -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_COMPILER="%COMPILER_PATH%" -DCMAKE_CXX_COMPILER="%COMPILER_PATH%" -DBUILD_NUMBER=%BUILD_NUMBER% .. - cmake --build . - mkdir installers - vpnsetup /SFXMODE:vpnclient /SFXOUT:"installers\softether-vpnclient-%VERSION%.%BUILD_NUMBER%.%ARCHITECTURE%.exe" - vpnsetup /SFXMODE:vpnserver_vpnbridge /SFXOUT:"installers\softether-vpnserver_vpnbridge-%VERSION%.%BUILD_NUMBER%.%ARCHITECTURE%.exe" - shell: cmd + - name: Build + env: + ARCHITECTURE: ${{ matrix.platform.ARCHITECTURE }} + COMPILER_PATH: ${{ matrix.platform.COMPILER_PATH }} + VCPKG_TRIPLET: ${{ matrix.platform.VCPKG_TRIPLET }} + VCVARS_PATH: ${{ matrix.platform.VCVARS_PATH }} + run: | + set BUILD_NUMBER=0 + mkdir build + cd build + call "%VCVARS_PATH%" + cmake -G "Ninja" -DCMAKE_TOOLCHAIN_FILE="C:\vcpkg\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=%VCPKG_TRIPLET% -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_C_COMPILER="%COMPILER_PATH%" -DCMAKE_CXX_COMPILER="%COMPILER_PATH%" -DBUILD_NUMBER=%BUILD_NUMBER% .. + cmake --build . + mkdir installers + vpnsetup /SFXMODE:vpnclient /SFXOUT:"installers\softether-vpnclient-%VERSION%.%BUILD_NUMBER%.%ARCHITECTURE%.exe" + vpnsetup /SFXMODE:vpnserver_vpnbridge /SFXOUT:"installers\softether-vpnserver_vpnbridge-%VERSION%.%BUILD_NUMBER%.%ARCHITECTURE%.exe" + shell: cmd - - name: Test - shell: powershell - run: | - . .ci/appveyor-vpntest.ps1 + - name: Test + shell: powershell + run: | + . .ci/appveyor-vpntest.ps1 - - name: Upload built binaries - uses: actions/upload-artifact@v4 - with: - if-no-files-found: error - name: Binaries-${{ matrix.platform.ARCHITECTURE }} - path: | - build/*.exe - build/*.pdb - build/*.se2 + - name: Upload built binaries + uses: actions/upload-artifact@v4 + with: + if-no-files-found: error + name: Binaries-${{ matrix.platform.ARCHITECTURE }} + path: | + build/*.exe + build/*.pdb + build/*.se2 - - name: Upload installers - uses: actions/upload-artifact@v4 - with: - if-no-files-found: error - name: Installers-${{ matrix.platform.ARCHITECTURE }} - path: build/installers + - name: Upload installers + uses: actions/upload-artifact@v4 + with: + if-no-files-found: error + name: Installers-${{ matrix.platform.ARCHITECTURE }} + path: build/installers \ No newline at end of file diff --git a/.github/workflows/windows_release.yml b/.github/workflows/windows_release.yml index ef088c43..0d2c912b 100644 --- a/.github/workflows/windows_release.yml +++ b/.github/workflows/windows_release.yml @@ -1,4 +1,4 @@ -name: "Release" +name: Release on: push: @@ -20,26 +20,36 @@ jobs: upload_url: "${{ steps.create_release.outputs.upload_url }}" steps: - - name: "Checkout repository" + - name: Checkout uses: actions/checkout@v4 - - name: "Create GitHub release" + - name: Create GitHub release id: create_release uses: softprops/action-gh-release@v2 build-windows: name: ${{ matrix.platform.ARCHITECTURE }} runs-on: windows-latest - needs: ["release"] + needs: release strategy: matrix: platform: [ - { ARCHITECTURE: x86, COMPILER_PATH: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/Llvm/bin/clang-cl.exe", VCPKG_TRIPLET: "x86-windows-static", VCVARS_PATH: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars32.bat"}, - { ARCHITECTURE: x64, COMPILER_PATH: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/Llvm/x64/bin/clang-cl.exe", VCPKG_TRIPLET: "x64-windows-static", VCVARS_PATH: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat"} + { + ARCHITECTURE: x86, + COMPILER_PATH: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/Llvm/bin/clang-cl.exe", + VCPKG_TRIPLET: "x86-windows-static", + VCVARS_PATH: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars32.bat" + }, + { + ARCHITECTURE: x64, + COMPILER_PATH: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/Llvm/x64/bin/clang-cl.exe", + VCPKG_TRIPLET: "x64-windows-static", + VCVARS_PATH: "C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Auxiliary/Build/vcvars64.bat" + } ] steps: - - name: "Checkout repository" + - name: Checkout uses: actions/checkout@v4 with: submodules: true @@ -52,10 +62,10 @@ jobs: - name: Set version variables run: | - $b=(Get-Content CMakeSettings.json | Out-String | ConvertFrom-Json).environments.BuildNumber - echo "BUILD_NUMBER=$b" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append - $v = python version.py - echo "VERSION=$v" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append + @( + "BUILD_NUMBER=$((Get-Content CMakeSettings.json | Out-String | ConvertFrom-Json).environments.BuildNumber)" + "VERSION=$(python version.py)" + ) | Out-File -FilePath $Env:GITHUB_ENV -Encoding UTF8 -Append shell: pwsh - name: Build @@ -80,14 +90,14 @@ jobs: Get-ChildItem -Recurse build/installers shell: pwsh - - name: "Upload softether-vpnclient" + - name: Upload softether-vpnclient uses: softprops/action-gh-release@v2 with: files: "build/installers/softether-vpnclient-${{ env.VERSION }}.${{ env.BUILD_NUMBER }}.${{ matrix.platform.ARCHITECTURE }}.exe" name: "softether-vpnclient-${{ env.VERSION }}.${{ env.BUILD_NUMBER }}.${{ matrix.platform.ARCHITECTURE }}.exe" - - name: "Upload softether-vpnserver_vpnbridge" + - name: Upload softether-vpnserver_vpnbridge uses: softprops/action-gh-release@v2 with: files: "build/installers/softether-vpnserver_vpnbridge-${{ env.VERSION }}.${{ env.BUILD_NUMBER }}.${{ matrix.platform.ARCHITECTURE }}.exe" - name: "softether-vpnserver_vpnbridge-${{ env.VERSION }}.${{ env.BUILD_NUMBER }}.${{ matrix.platform.ARCHITECTURE }}.exe" + name: "softether-vpnserver_vpnbridge-${{ env.VERSION }}.${{ env.BUILD_NUMBER }}.${{ matrix.platform.ARCHITECTURE }}.exe" \ No newline at end of file