Skip to content
Merged
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
71 changes: 60 additions & 11 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -236,15 +231,69 @@ 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

# 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)

- 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
Expand Down
Loading