Skip to content

Commit

Permalink
Merge pull request #31 from d-velop/github-actions
Browse files Browse the repository at this point in the history
GitHub actions
  • Loading branch information
ckuetbach authored Apr 15, 2024
2 parents 3117492 + 0f97601 commit cdef24d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
11 changes: 7 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,22 @@ jobs:
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x
- uses: ./.github/workflows/build-action
- name: Create Version
run: echo "VERSION=$(grep -oPm1 "(?<=<VersionPrefix>)[^<]+" ./Directory.Build.props)" >> $GITHUB_ENV
- name: Print Version
run: echo ${{ env.VERSION }}
- uses: ./.github/workflows/build-action
- if: ${{startsWith(github.event.ref, 'refs/tags/v')}}
name: Publish Release NuGet
run: |
dotnet build -c Release
dotnet pack -c Release /p:Version=${{ env.VERSION }}.${{ github.run_number }} /p:InformationalVersion="${{ env.VERSION }}+${{github.ref_name}}/${{github.sha}}"
dotnet clean
dotnet build -c Release /p:Version="${{ env.VERSION }}.${{ github.run_number }}"
dotnet pack -c Release /p:Version="${{ env.VERSION }}.${{ github.run_number }}" /p:InformationalVersion="${{ env.VERSION }}+${{github.ref_name}}/${{github.sha}}"
dotnet nuget push "**/*.${{ env.VERSION }}.${{ github.run_number }}.nupkg" -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_PUSH}} --skip-duplicate
- if: ${{ !startsWith(github.event.ref, 'refs/tags/v') }}
name: Publish Prerelease NuGet
run: |
dotnet pack -c Debug /p:Version=${{ env.VERSION }}.${{ github.run_number }}-prerelease /p:InformationalVersion="${{ env.VERSION }}+${{github.ref_name}}/${{github.sha}}"
dotnet clean
dotnet build -c Debug /p:Version="${{ env.VERSION }}.${{ github.run_number }}-prerelease"
dotnet pack -c Debug /p:Version="${{ env.VERSION }}.${{ github.run_number }}-prerelease" /p:InformationalVersion="${{ env.VERSION }}+${{github.ref_name}}/${{github.sha}}"
dotnet nuget push "**/*.${{ env.VERSION }}.${{ github.run_number }}-prerelease.nupkg" -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_PUSH}} --skip-duplicate
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
<Company>d.velop AG</Company>
<Copyright>Copyright (c) 2024</Copyright>
<PackageProjectUrl>https://github.com/d-velop/dvelop-sdk-cs</PackageProjectUrl>
<VersionPrefix>0.0.9</VersionPrefix>
<VersionPrefix>0.0.10</VersionPrefix>
</PropertyGroup>
</Project>

0 comments on commit cdef24d

Please sign in to comment.