From 8b547da6e7a9f994d1675fdbeee3316d6135b9f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20CORTIER?= Date: Wed, 1 Oct 2025 14:19:39 +0900 Subject: [PATCH 1/4] ci(release): add jetsocat ZIP files for winget distribution - Create platform-specific ZIP files (`jetsocat--.zip`) - Each ZIP contains standardized binary name (`jetsocat`/`jetsocat.exe`) - Remove original jetsocat binaries from release (ZIP files replace them) --- .github/workflows/release.yml | 58 +++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 07884e37e..552664edd 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -246,6 +246,64 @@ jobs: # For the PowerShell module, only upload the nupkg. Remove-Item -Path (Join-Path devolutions-gateway PowerShell DevolutionsGateway-ps-*.tar) -Recurse -ErrorAction Ignore + # Remove leftover tun2socks.exe files. + Get-ChildItem -Recurse -Name "tun2socks.exe" | Remove-Item -ErrorAction Ignore + + - name: Create jetsocat ZIP files for winget + shell: pwsh + run: | + Set-PSDebug -Trace 1 + + $Version = "${{ needs.preflight.outputs.version }}" + $ZipFolder = "jetsocat-zips" + New-Item -ItemType Directory -Path $ZipFolder -Force + + # Define the platforms and architectures. + $Platforms = @( + @{ OS = "windows"; Arch = "x86_64"; Extension = ".exe" }, + @{ OS = "windows"; Arch = "arm64"; Extension = ".exe" }, + @{ OS = "linux"; Arch = "x86_64"; Extension = "" }, + @{ OS = "linux"; Arch = "arm64"; Extension = "" }, + @{ OS = "macos"; Arch = "x86_64"; Extension = "" }, + @{ OS = "macos"; Arch = "arm64"; Extension = "" } + ) + + foreach ($Platform in $Platforms) { + $OS = $Platform.OS + $Arch = $Platform.Arch + $Ext = $Platform.Extension + + # Find the original binary. + $BinaryPattern = "jetsocat_*_${Version}_${Arch}${Ext}" + $OriginalBinary = Get-ChildItem -Recurse -Filter $BinaryPattern -File | Select-Object -First 1 + + if ($OriginalBinary) { + # Create temporary folder for this zip. + $TempFolder = Join-Path $ZipFolder "temp-$OS-$Arch" + New-Item -ItemType Directory -Path $TempFolder -Force + + # Copy binary with standard name. + $TargetName = "jetsocat${Ext}" + $TargetPath = Join-Path $TempFolder $TargetName + Copy-Item -Path $OriginalBinary.FullName -Destination $TargetPath + + # Create ZIP file. + $ZipName = "jetsocat-$OS-$Arch.zip" + $ZipPath = Join-Path $ZipFolder $ZipName + Compress-Archive -Path $TargetPath -DestinationPath $ZipPath -Force + + Write-Host "Created $ZipName" + + # Clean up temp folder. + Remove-Item -Path $TempFolder -Recurse -Force + + # Remove the original binary to avoid uploading it. + Remove-Item -Path $OriginalBinary.FullName + } else { + Write-Warning "Could not find binary for $OS $Arch" + } + } + - name: Create GitHub release shell: pwsh env: From a1b0f4233d45ea2c67f01cdf1cda490b068753c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20CORTIER?= Date: Wed, 1 Oct 2025 14:26:36 +0900 Subject: [PATCH 2/4] . --- .github/workflows/release.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 552664edd..cbcbb1eb1 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -246,9 +246,6 @@ jobs: # For the PowerShell module, only upload the nupkg. Remove-Item -Path (Join-Path devolutions-gateway PowerShell DevolutionsGateway-ps-*.tar) -Recurse -ErrorAction Ignore - # Remove leftover tun2socks.exe files. - Get-ChildItem -Recurse -Name "tun2socks.exe" | Remove-Item -ErrorAction Ignore - - name: Create jetsocat ZIP files for winget shell: pwsh run: | From 5577e199ce5f96a869de20be4d7b6553d291b9c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20CORTIER?= Date: Wed, 1 Oct 2025 16:11:27 +0900 Subject: [PATCH 3/4] . --- .github/workflows/release.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cbcbb1eb1..3b593496d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -236,15 +236,17 @@ jobs: - name: Manage artifacts shell: pwsh run: | - # workflow_call: The same artifacts persist across the entire run, so the PowerShell/DevolutionsGateway directory will still exist from the CI workflow - # FIXME: I suspect this line is no longer required. - Remove-Item -Path (Join-Path devolutions-gateway PowerShell DevolutionsGateway) -Recurse -ErrorAction Ignore + # The PowerShell module is already part of the installers, and is published on PsGallery. + Remove-Item -Path (Join-Path devolutions-gateway PowerShell) -Recurse # Devolutions Agent on Linux does not have any useful feature yet, so we filter out the Linux artifacts. - Remove-Item -Path (Join-Path devolutions-agent linux) -Recurse -ErrorAction Ignore + Remove-Item -Path (Join-Path devolutions-agent linux) -Recurse + + # Do not upload tun2socks.exe by itself. + Remove-Item -Path (Join-Path devolutions-agent tun2socks) -Recurse # For the PowerShell module, only upload the nupkg. - Remove-Item -Path (Join-Path devolutions-gateway PowerShell DevolutionsGateway-ps-*.tar) -Recurse -ErrorAction Ignore + Remove-Item -Path (Join-Path devolutions-gateway PowerShell DevolutionsGateway-ps-*.tar) -Recurse - name: Create jetsocat ZIP files for winget shell: pwsh From 9a00da5c098e5afe48b25ddc7d2252ff3bf6d938 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20CORTIER?= Date: Wed, 1 Oct 2025 16:20:40 +0900 Subject: [PATCH 4/4] . --- .github/workflows/release.yml | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3b593496d..0c462e8aa 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -127,11 +127,6 @@ jobs: gh run download ${{ needs.preflight.outputs.run }} -n webapp-client -n docker -n devolutions-gateway-signed -n native-libs --repo $Env:GITHUB_REPOSITORY Move-Item -Path devolutions-gateway-signed -Destination devolutions-gateway - ## workflow_call: The same artifacts persist across the entire run, so the PowerShell/DevolutionsGateway directory will still exist from the CI workflow - - name: Manage artifacts - shell: pwsh - run: Remove-Item -Path (Join-Path devolutions-gateway PowerShell DevolutionsGateway) -Recurse -ErrorAction Ignore - - name: Prepare artifacts id: prepare-artifacts shell: pwsh @@ -236,9 +231,6 @@ jobs: - name: Manage artifacts shell: pwsh run: | - # The PowerShell module is already part of the installers, and is published on PsGallery. - Remove-Item -Path (Join-Path devolutions-gateway PowerShell) -Recurse - # Devolutions Agent on Linux does not have any useful feature yet, so we filter out the Linux artifacts. Remove-Item -Path (Join-Path devolutions-agent linux) -Recurse @@ -246,7 +238,7 @@ jobs: Remove-Item -Path (Join-Path devolutions-agent tun2socks) -Recurse # For the PowerShell module, only upload the nupkg. - Remove-Item -Path (Join-Path devolutions-gateway PowerShell DevolutionsGateway-ps-*.tar) -Recurse + Remove-Item -Path (Join-Path devolutions-gateway PowerShell DevolutionsGateway-ps-*.tar) - name: Create jetsocat ZIP files for winget shell: pwsh