Skip to content

Commit

Permalink
Publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ASolomatin committed Sep 6, 2023
1 parent 5698111 commit ed5b215
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 2 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Publish

on:
push:
tags:
- 'v*' # Publish on any new tag starting with v

jobs:
build:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup .NET 6.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 6.0.x

- name: Set RELEASE_VERSION env
run: echo "RELEASE_VERSION=${GITHUB_REF#refs/*/v}" >> $GITHUB_ENV
- name: Create nuget package
run: dotnet pack src/TDigestNet/TDigestNet.csproj -c Release /p:Version=${{ env.RELEASE_VERSION }}

- name: prepare artifacts
run: |
ARTIFACT_NUPKG_PATHNAME=$(ls src/TDigestNet/bin/Release/*.nupkg | head -n 1)
echo "ARTIFACT_NUPKG_PATHNAME=${ARTIFACT_NUPKG_PATHNAME}" >> $GITHUB_ENV
cd src/TDigestNet/bin/Release/
ls */*.dll | xargs -I _FILE_ bash -c "cp _FILE_ \$(echo _FILE_ | sed 's/\//_/g')"
ls */*.pdb | xargs -I _FILE_ bash -c "cp _FILE_ \$(echo _FILE_ | sed 's/\//_/g')"
ls */*.xml | xargs -I _FILE_ bash -c "cp _FILE_ \$(echo _FILE_ | sed 's/\//_/g')"
- name: nuget push
run: dotnet nuget push "${NUPKG_PATH}" --api-key "${NUGET_KEY}" --source https://api.nuget.org/v3/index.json
env:
NUGET_KEY: ${{ secrets.NUGET_API_KEY }}
NUPKG_PATH: ${{ env.ARTIFACT_NUPKG_PATHNAME }}

- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
src/TDigestNet/bin/Release/*.nupkg
src/TDigestNet/bin/Release/*.dll
src/TDigestNet/bin/Release/*.pdb
src/TDigestNet/bin/Release/*.xml
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@
"cSpell.words": [
"Aleksej",
"netcoreapp",
"NUPKG",
"Quantile",
"Quantiles",
"quantumtunneling",
"softprops",
"Solomatin"
],
"dotnet-test-explorer.testProjectPath": "/src/TDigestNet.sln"
Expand Down
25 changes: 23 additions & 2 deletions src/TDigestNet/TDigestNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,41 @@
<LangVersion>10.0</LangVersion>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
</PropertyGroup>

<PropertyGroup>
<AssemblyTitle>TDigest</AssemblyTitle>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>https://github.com/ASolomatin/T-Digest.NET</RepositoryUrl>
<PackageProjectUrl>https://github.com/ASolomatin/T-Digest.NET</PackageProjectUrl>
<PackageTags>t-digest, tdigest, digest, percentile, quantile</PackageTags>
<PackageLicenseFile>LICENSE</PackageLicenseFile>
<PackageId>T-Digest.NET</PackageId>
<Description>
.NET Implementation of the relatively new T-Digest quantile estimation algorithm.
Useful for calculating highly accurate Quantiles or Percentiles from on-line streaming data,
or data-sets that are too large to store in memory and sort, which is required to calculate the true quantile.
</Description>
<Authors>Aleksej Solomatin</Authors>
</PropertyGroup>

<PropertyGroup>
<AssemblyTitle>T-Digest</AssemblyTitle>
<AssemblyDescription>Streaming Percentile Estimation</AssemblyDescription>
<AssemblyProduct>TDigest</AssemblyProduct>
<AssemblyCopyright>Copyright © 2019</AssemblyCopyright>
<AssemblyCopyright>Copyright Aleksej Solomatin © 2023</AssemblyCopyright>
</PropertyGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'net461'">
<Using Remove="System.Net.Http" />
<PackageReference Include="System.Memory" Version="4.5.5" />
</ItemGroup>

<ItemGroup>
<None Include="../../LICENSE" Pack="true" Visible="false" PackagePath=""/>
</ItemGroup>

<ItemGroup>
<InternalsVisibleTo Include="TDigestNet.Tests" />
</ItemGroup>
Expand Down

0 comments on commit ed5b215

Please sign in to comment.