Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
mikelieber committed Jul 24, 2024
1 parent 56d49a4 commit aa89ab9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 11 deletions.
7 changes: 3 additions & 4 deletions .github/workflows/build-client-pkg.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ jobs:
run: |
echo "TOTAL_COMMITS=$(git rev-list HEAD --count)" >> $GITHUB_ENV
echo "Total commits since start of the repo $TOTAL_COMMITS"
- name: Determine Version
id: gitversion
uses: gittools/actions/gitversion/execute@v0.9.7
Expand All @@ -57,7 +56,6 @@ jobs:
echo "File version: ${{ steps.gitversion.outputs.assemblySemFileVer }}"
echo "Info version: ${{ steps.gitversion.outputs.informationalVersion }}"
echo "NuGet package version: ${{ steps.pkg_calc.outputs.nugetPkgVersion }}"
create_artifacts:
runs-on: ubuntu-latest
needs: calculate_version
Expand All @@ -72,18 +70,19 @@ jobs:
with:
dotnet-version: 6.0.x

- name: Update NuGet sources
run: dotnet nuget add source https://nuget.pkg.github.com/youtoken/index.json -n YouHodlerGitHub -u user -p ${{secrets.NUGET_GITHUB_TOKEN}} --store-password-in-clear-text

- name: Build
run: |
dotnet build --configuration Release /p:AssemblyVersion=${{ needs.calculate_version.outputs.assemblyVersion }} /p:FileVersion=${{ needs.calculate_version.outputs.fileVersion }} /p:InformationalVersion=${{ needs.calculate_version.outputs.infoVersion }}
- name: Test
run: dotnet test --no-build --configuration Release

- name: Library Packaging
run: |
echo "Create package ${{ env.CLIENT_PROJ }} with version ${{ needs.calculate_version.outputs.pkgVersion }}"
dotnet pack --configuration Release ${{ env.CLIENT_PROJ }} /p:PackageVersion=${{ needs.calculate_version.outputs.pkgVersion }}
- name: Upload package to artifacts
uses: actions/upload-artifact@v3
with:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,49 @@ name: Release tcp client library
on:
push:
tags:
- "client-*"
- "*.*.*"

jobs:
test-and-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup .NET Core
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
dotnet-version: 6.0.*

- name: Update NuGet sources
run: dotnet nuget add source https://nuget.pkg.github.com/youtoken/index.json -n YouHodlerGitHub -u user -p ${{secrets.NUGET_GITHUB_TOKEN}} --store-password-in-clear-text

- name: Library Test
run: dotnet test --no-build --configuration Release

- name: Calculate VERSION
id: calculate-version
run: |
echo "TAG=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
echo "MAJOR_MINOR_PATCH=$(echo ${GITHUB_REF#refs/tags/} | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+')" >> $GITHUB_OUTPUT
- name: Library Build
run: dotnet build --configuration Release /p:AssemblyVersion=${GITHUB_REF#refs/tags/client-}
run: |
echo "Calculated VERSION: ${{ steps.calculate-version.outputs.MAJOR_MINOR_PATCH }}"
dotnet build --configuration Release /p:AssemblyVersion=${{ steps.calculate-version.outputs.MAJOR_MINOR_PATCH }}
- name: Library wrap
run: dotnet pack --configuration Release MyServiceBus.TcpClient /p:PackageVersion=${GITHUB_REF#refs/tags/client-}
run: |
echo "Package VERSION: ${{ steps.calculate-version.outputs.TAG }}"
dotnet pack --configuration Release MyServiceBus.TcpClient /p:PackageVersion=${{ steps.calculate-version.outputs.TAG }}
- name: Upload package to artifacts
uses: actions/upload-artifact@v3
with:
name: package
path: MyServiceBus/bin/Release/*.nupkg
path: MyServiceBus.TcpClient/bin/Release/*.nupkg

upload-to-github-nuget:
needs: test-and-build
Expand All @@ -43,7 +60,7 @@ jobs:
env:
NUGET_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}

- name: Download built library
- name: Download builded library
uses: actions/download-artifact@v3
with:
name: package
Expand Down

0 comments on commit aa89ab9

Please sign in to comment.