-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5698111
commit ed5b215
Showing
3 changed files
with
73 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters