Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resolve #1467: build sswinservice for Windows by default #1468

Merged
merged 1 commit into from
Mar 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ jobs:
run: cargo build --verbose --features "local-http-rustls local-redir local-dns local-tun dns-over-tls dns-over-https stream-cipher aead-cipher-extra aead-cipher-2022 aead-cipher-2022-extra security-replay-attack-detect"
- name: Build with All Features Enabled (Windows)
if: ${{ runner.os == 'Windows' }}
run: cargo build --verbose --features "local-http-rustls local-dns dns-over-tls dns-over-https stream-cipher aead-cipher-extra aead-cipher-2022 aead-cipher-2022-extra security-replay-attack-detect"
run: cargo build --verbose --features "local-http-rustls local-dns dns-over-tls dns-over-https stream-cipher aead-cipher-extra aead-cipher-2022 aead-cipher-2022-extra security-replay-attack-detect winservice"
- name: Build with All Features Enabled - shadowsocks
run: cargo build --manifest-path ./crates/shadowsocks/Cargo.toml --verbose --features "stream-cipher aead-cipher-2022"
2 changes: 1 addition & 1 deletion .github/workflows/build-msrv.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ jobs:
run: cargo build --verbose --features "local-http-rustls local-redir local-dns local-tun dns-over-tls dns-over-https stream-cipher aead-cipher-extra aead-cipher-2022 aead-cipher-2022-extra security-replay-attack-detect"
- name: Build with All Features Enabled (Windows)
if: ${{ runner.os == 'Windows' }}
run: cargo build --verbose --features "local-http-rustls local-dns dns-over-tls dns-over-https stream-cipher aead-cipher-extra aead-cipher-2022 aead-cipher-2022-extra security-replay-attack-detect"
run: cargo build --verbose --features "local-http-rustls local-dns dns-over-tls dns-over-https stream-cipher aead-cipher-extra aead-cipher-2022 aead-cipher-2022-extra security-replay-attack-detect winservice"
2 changes: 1 addition & 1 deletion .github/workflows/build-nightly-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:

- name: Build release
run: |
pwsh ./build/build-host-release.ps1
pwsh ./build/build-host-release.ps1 winservice

- name: Upload Artifacts
uses: actions/upload-artifact@v4
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/build-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ jobs:
compile_features="-f local-redir -f local-tun"
fi

if [[ "$compile_target" == *"-windows-"* ]]; then
compile_features="-f winservice"
fi

if [[ "$compile_target" == "mips-"* || "$compile_target" == "mipsel-"* || "$compile_target" == "mips64-"* || "$compile_target" == "mips64el-"* ]]; then
sudo apt-get update -y && sudo apt-get install -y upx;
if [[ "$?" == "0" ]]; then
Expand Down Expand Up @@ -139,7 +143,7 @@ jobs:

- name: Build release
run: |
pwsh ./build/build-host-release.ps1
pwsh ./build/build-host-release.ps1 winservice

- name: Upload Github Assets
uses: softprops/action-gh-release@v1
Expand Down
4 changes: 4 additions & 0 deletions build/build-host-release
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ fi

TARGETS=("sslocal${TARGET_SUFFIX}" "ssserver${TARGET_SUFFIX}" "ssurl${TARGET_SUFFIX}" "ssmanager${TARGET_SUFFIX}" "ssservice${TARGET_SUFFIX}")

if [[ "${BUILD_FEATURES}" == *"winservice"* ]]; then
TARGETS+=("sswinservice${TARGET_SUFFIX}")
fi

RELEASE_FOLDER="${ROOT_DIR}/release"
RELEASE_PACKAGE_NAME="shadowsocks-v${VERSION}.${BUILD_TARGET}"

Expand Down
3 changes: 3 additions & 0 deletions build/build-host-release.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,9 @@ $CompressParam = @{
LiteralPath = "sslocal.exe", "ssserver.exe", "ssurl.exe", "ssmanager.exe", "ssservice.exe"
DestinationPath = "${PackagePath}"
}
if (${Features} -contains "winservice") {
$CompressParam.LiteralPath += "sswinservice.exe"
}
Compress-Archive @CompressParam

Write-Host "Created release packet ${PackagePath}"
Expand Down
Loading