Skip to content

Commit

Permalink
ci: fix publish
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasteles committed Jul 6, 2023
1 parent d3208b4 commit c767acb
Showing 1 changed file with 45 additions and 45 deletions.
90 changes: 45 additions & 45 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,63 +16,63 @@ jobs:
CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: 5.x
- name: Install GitVersion
uses: gittools/actions/gitversion/[email protected]
with:
versionSpec: 5.x

- name: Determine Version
uses: gittools/actions/gitversion/[email protected]
id: gitversion
- name: Determine Version
uses: gittools/actions/gitversion/[email protected]
id: gitversion

- name: Display GitVersion outputs
run: |
echo "Version: ${{ steps.gitversion.outputs.SemVer }}"
echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}"
- name: Display GitVersion outputs
run: |
echo "Version: ${{ steps.gitversion.outputs.SemVer }}"
echo "CommitsSinceVersionSource: ${{ steps.gitversion.outputs.CommitsSinceVersionSource }}"
- name: Setup .NET Core
uses: actions/setup-dotnet@v2
with:
global-json-file: global.json
- name: Setup .NET Core
uses: actions/setup-dotnet@v2
with:
global-json-file: global.json

- name: Tool Restore
run: dotnet tool restore
- name: Tool Restore
run: dotnet tool restore

- name: Test
run: dotnet nuke test
- name: Test
run: dotnet nuke test

- name: Build and Pack NuGet package
run: dotnet pack src/ --configuration Release --include-symbols -p:Version='${{ steps.gitversion.outputs.SemVer }}' --output ./Package
- name: Build and Pack NuGet package
run: dotnet pack --configuration Release --include-symbols -p:Version='${{ steps.gitversion.outputs.SemVer }}' --output ./Package

- name: Upload lib NuGet package artifact to GitHub
uses: actions/upload-artifact@v2
with:
name: libPackage
path: ./Package
- name: Upload lib NuGet package artifact to GitHub
uses: actions/upload-artifact@v2
with:
name: libPackage
path: ./Package

release:
runs-on: ubuntu-latest
if: github.ref == 'refs/heads/master' && needs.build.outputs.CommitsSinceVersionSource > 0 #Only release if there has been a commit/version change
needs: build

steps:
- name: Download lib nuget package artifact
uses: actions/[email protected]
with:
name: libPackage

- name: Push package to Nuget
run: |
dotnet nuget push libPackage/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: ${{ needs.build.outputs.Version }}
name: Release ${{ needs.build.outputs.Version }}
artifacts: "libPackage/*"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Download lib nuget package artifact
uses: actions/[email protected]
with:
name: libPackage

- name: Push package to Nuget
run: |
dotnet nuget push libPackage/*.nupkg --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json
- name: Create Release
uses: ncipollo/release-action@v1
with:
tag: ${{ needs.build.outputs.Version }}
name: Release ${{ needs.build.outputs.Version }}
artifacts: "libPackage/*"
token: ${{ secrets.GITHUB_TOKEN }}

0 comments on commit c767acb

Please sign in to comment.