Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
2a9012a
updated to .net8.0 and added Github Action
FinnianDempsey Sep 2, 2025
8c89e88
Update build-tentacleping-dotnet.yml
FinnianDempsey Sep 2, 2025
2792af1
Update build-tentacleping-dotnet.yml
FinnianDempsey Sep 2, 2025
a1c47ae
Update build-tentacleping-dotnet.yml
FinnianDempsey Sep 2, 2025
82f651e
Update build-tentacleping-dotnet.yml
FinnianDempsey Sep 2, 2025
9f5abc4
Update build-tentacleping-dotnet.yml
FinnianDempsey Sep 2, 2025
405b393
Update build-tentacleping-dotnet.yml
FinnianDempsey Sep 2, 2025
222b7bb
Update build-tentacleping-dotnet.yml
FinnianDempsey Sep 2, 2025
5765c54
Update build-tentacleping-dotnet.yml
FinnianDempsey Sep 2, 2025
d422761
Update build-tentacleping-dotnet.yml
FinnianDempsey Sep 2, 2025
607be5f
Update build-tentacleping-dotnet.yml
FinnianDempsey Sep 2, 2025
d2b2696
Update build-tentacleping-dotnet.yml
FinnianDempsey Sep 2, 2025
637944e
Update build-tentacleping-dotnet.yml
FinnianDempsey Sep 2, 2025
3074c1e
Update build-tentacleping-dotnet.yml
FinnianDempsey Sep 2, 2025
6f032b7
Update build-tentacleping-dotnet.yml
FinnianDempsey Sep 2, 2025
3bd6128
Update build-tentacleping-dotnet.yml
FinnianDempsey Sep 2, 2025
bf40c27
Update build-tentacleping-dotnet.yml
FinnianDempsey Sep 2, 2025
e7c51f2
Update build-tentacleping-dotnet.yml
FinnianDempsey Sep 2, 2025
04c7b26
Update build-tentacleping-dotnet.yml
FinnianDempsey Sep 2, 2025
46c2b03
Update build-tentacleping-dotnet.yml
FinnianDempsey Sep 2, 2025
c8a664a
Update build-tentacleping-dotnet.yml
FinnianDempsey Sep 2, 2025
70b7e5e
Create release-tentacleping-dotnet.yml
FinnianDempsey Sep 2, 2025
f7887be
updated github actions
FinnianDempsey Sep 3, 2025
1985260
Update build-tentacleping-dotnet.yml
FinnianDempsey Sep 3, 2025
3167ff9
Update build-tentacleping-dotnet.yml
FinnianDempsey Sep 3, 2025
ed3cde9
Update build-tentacleping-dotnet.yml
FinnianDempsey Sep 3, 2025
2e63e2b
updated github actions
FinnianDempsey Sep 3, 2025
5dc5a4f
Update release-tentacleping-dotnet.yml
FinnianDempsey Sep 3, 2025
067b018
Update release-tentacleping-dotnet.yml
FinnianDempsey Sep 3, 2025
f670e88
Update README.md
FinnianDempsey Sep 3, 2025
16e4673
Update release-tentacleping-dotnet.yml
FinnianDempsey Sep 3, 2025
c072734
Update README.md
FinnianDempsey Sep 3, 2025
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
86 changes: 86 additions & 0 deletions .github/workflows/build-tentacleping-dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: Build TentaclePing

on:
pull_request:
branches: [ "main" ]
workflow_call: # This makes the workflow reusable

jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest, ubuntu-24.04-arm]
include:
- os: ubuntu-latest
runtime: linux-x64
framework: net8.0
- os: windows-latest
runtime: win-x64
framework: net8.0-windows
- os: ubuntu-24.04-arm
runtime: linux-arm64
framework: net8.0
runs-on: ${{ matrix.os }}

steps:
- uses: actions/checkout@v4

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Build Publish and Archive (Linux)
if: runner.os != 'Windows'
run: |
dotnet restore source/

if [ "${{ github.event_name }}" = "push" ] && [[ "${{ github.ref }}" == refs/tags/v* ]]; then
VERSION="${{ github.ref_name }}"
VERSION_NUMBER="${VERSION#v}"
dotnet build source/ --no-restore -c Release -p:Version=$VERSION_NUMBER -p:AssemblyVersion=$VERSION_NUMBER -p:FileVersion=$VERSION_NUMBER
dotnet publish source/ -c Release -r ${{ matrix.runtime }} --self-contained true -f ${{ matrix.framework }} -p:IncludeNativeLibrariesForSelfExtract=true -p:PublishSingleFile=true -p:DebugType=embedded -p:PublishReadyToRun=false -p:Version=$VERSION_NUMBER -p:AssemblyVersion=$VERSION_NUMBER -p:FileVersion=$VERSION_NUMBER -p:PublishTrimmed=true
else
VERSION_PREFIX=$(grep -oP '<VersionPrefix>\K[^<]+' source/TentaclePing/TentaclePing.csproj)
dotnet build source/ --no-restore -c Release -p:Version=$VERSION_PREFIX -p:AssemblyVersion=$VERSION_PREFIX -p:FileVersion=$VERSION_PREFIX
dotnet publish source/ -c Release -r ${{ matrix.runtime }} --self-contained true -f ${{ matrix.framework }} -p:IncludeNativeLibrariesForSelfExtract=true -p:PublishSingleFile=true -p:DebugType=embedded -p:PublishReadyToRun=false -p:Version=$VERSION_PREFIX -p:AssemblyVersion=$VERSION_PREFIX -p:FileVersion=$VERSION_PREFIX -p:PublishTrimmed=true
fi

mkdir -p dists
cp ./source/TentaclePing/bin/Release/${{ matrix.framework }}/${{ matrix.runtime }}/publish/TentaclePing dists/
cp ./source/TentaclePong/bin/Release/${{ matrix.framework }}/${{ matrix.runtime }}/publish/TentaclePong dists/
tar -czf TentaclePing-${{ matrix.runtime }}.tar.gz -C dists .
rm -rf dists

- name: Create Archives (Windows)
if: runner.os == 'Windows'
run: |
if ("${{ github.event_name }}" -eq "push" -and "${{ github.ref }}" -like "refs/tags/v*") {
$VERSION = "${{ github.ref_name }}"
$VERSION_NUMBER = $VERSION -replace '^v', ''
dotnet build source/ --no-restore -c Release -p:Version=$VERSION_NUMBER -p:AssemblyVersion=$VERSION_NUMBER -p:FileVersion=$VERSION_NUMBER
dotnet publish source/ -c Release -r ${{ matrix.runtime }} --self-contained true -f ${{ matrix.framework }} -p:IncludeNativeLibrariesForSelfExtract=true -p:PublishSingleFile=true -p:DebugType=embedded -p:PublishReadyToRun=false -p:Version=$VERSION_NUMBER -p:AssemblyVersion=$VERSION_NUMBER -p:FileVersion=$VERSION_NUMBER -p:PublishTrimmed=true
} else {
$VERSION_PREFIX = (Select-String -Path "source/TentaclePing/TentaclePing.csproj" -Pattern "<VersionPrefix>([^<]+)</VersionPrefix>").Matches.Groups[1].Value
dotnet build source/ --no-restore -c Release -p:Version=$VERSION_PREFIX -p:AssemblyVersion=$VERSION_PREFIX -p:FileVersion=$VERSION_PREFIX
dotnet publish source/ -c Release -r ${{ matrix.runtime }} --self-contained true -f ${{ matrix.framework }} -p:IncludeNativeLibrariesForSelfExtract=true -p:PublishSingleFile=true -p:DebugType=embedded -p:PublishReadyToRun=false -p:Version=$VERSION_PREFIX -p:AssemblyVersion=$VERSION_PREFIX -p:FileVersion=$VERSION_PREFIX -p:PublishTrimmed=true
}

New-Item -ItemType Directory -Path dists -Force
Copy-Item ./source/TentaclePing/bin/Release/${{ matrix.framework }}/${{ matrix.runtime }}/publish/TentaclePing.exe dists/
Copy-Item ./source/TentaclePong/bin/Release/${{ matrix.framework }}/${{ matrix.runtime }}/publish/TentaclePong.exe dists/
Compress-Archive -Path dists/* -DestinationPath TentaclePing-${{ matrix.runtime }}.zip
Remove-Item -Recurse -Force dists

- name: Upload Artifacts
uses: actions/upload-artifact@v4
with:
name: TentaclePing-${{ matrix.runtime }}
compression-level: 0
path: |
TentaclePing-${{ matrix.runtime }}.tar.gz
TentaclePing-${{ matrix.runtime }}.zip

68 changes: 68 additions & 0 deletions .github/workflows/release-tentacleping-dotnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
name: Create TentaclePing Release

on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
build:
uses: ./.github/workflows/build-tentacleping-dotnet.yml

release:
needs: build
runs-on: ubuntu-latest
permissions:
contents: write # Grant write permission to the GITHUB_TOKEN for creating a release
steps:
- name: Checkout code
uses: actions/checkout@v4

- uses: actions/download-artifact@v4
with:
path: artifacts

- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # Use the automatically generated GITHUB_TOKEN
with:
tag_name: ${{ github.ref_name }}
release_name: ${{ github.ref_name }}
body: |
# TentaclePing ${{ github.ref_name }}


draft: false
prerelease: false

- name: Upload Linux x64 TentaclePing
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/TentaclePing-linux-x64/TentaclePing-linux-x64.tar.gz
asset_name: TentaclePing-linux-x64.tar.gz
asset_content_type: application/gzip

- name: Upload Linux ARM64 TentaclePing
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/TentaclePing-linux-arm64/TentaclePing-linux-arm64.tar.gz
asset_name: TentaclePing-linux-arm64.tar.gz
asset_content_type: application/gzip

- name: Upload Windows x64 TentaclePing
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: artifacts/TentaclePing-win-x64/TentaclePing-win-x64.zip
asset_name: TentaclePing-win-x64.zip
asset_content_type: application/zip
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,12 @@ If you don't plan to watch TentaclePing run, you may want to pipe the results to
TentaclePing.exe MyServer 10933 > Output.txt

This file can then easily be sent to the Octopus support team (support@octopusdeploy.com) for analysis.


## Contributing

This project is managed by Github Actions.

Create a new branch for your changes and open a PR to main to build assests

Pushing a tag with the format v1.2.3 will trigger a new Release to be created
4 changes: 4 additions & 0 deletions source/TentaclePing/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ static int Main(string[] args)
{
chunkSize = int.Parse(args[3]);
}

#pragma warning disable SYSLIB0039
var sslProtocol = SslProtocols.Tls;
#pragma warning restore SYSLIB0039

if (args.Length == 5)
{
if (Enum.TryParse<SslProtocols>(args[4], out var parsedSslProtocol))
Expand Down
2 changes: 1 addition & 1 deletion source/TentaclePing/TentaclePing.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<RootNamespace>TentaclePing</RootNamespace>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworks>net8.0;net8.0-windows</TargetFrameworks>
<OutputType>EXE</OutputType>
</PropertyGroup>
<ItemGroup>
Expand Down
2 changes: 2 additions & 0 deletions source/TentaclePong/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,9 @@ static void ExecuteRequest(TcpClient client)
{
// We don't actually validate the client, accepting anything; validation
// status is reflected in validClientThumprint != null.
#pragma warning disable SYSLIB0039
ssl.AuthenticateAsServer(serverCertificate, true, SslProtocols.Tls, false);
#pragma warning restore SYSLIB0039

var reader = new StreamReader(ssl);

Expand Down
2 changes: 1 addition & 1 deletion source/TentaclePong/TentaclePong.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<RootNamespace>TentaclePong</RootNamespace>
<GenerateAssemblyTitleAttribute>false</GenerateAssemblyTitleAttribute>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
<TargetFramework>netcoreapp3.1</TargetFramework>
<TargetFrameworks>net8.0;net8.0-windows</TargetFrameworks>
<OutputType>EXE</OutputType>
</PropertyGroup>
<ItemGroup>
Expand Down
Loading