Skip to content

Commit

Permalink
Tag and publish release
Browse files Browse the repository at this point in the history
  • Loading branch information
ptr727 committed Feb 20, 2022
1 parent 050f713 commit 081189d
Showing 1 changed file with 22 additions and 3 deletions.
25 changes: 22 additions & 3 deletions .github/workflows/BuildPublishPipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
- name: 'Build Project'
run: >-
dotnet build ./Utilities/Utilities.csproj
--output ./Utilities/Artifacts
--output ./Publish/
--configuration ${{ endsWith(github.ref, 'refs/heads/main') && 'Release' || 'Debug' }}
-property:Version=${{ steps.nbgv.outputs.AssemblyVersion }}
-property:FileVersion=${{ steps.nbgv.outputs.AssemblyFileVersion }}
Expand All @@ -62,7 +62,7 @@ jobs:
if: ${{ github.event_name != 'pull_request' }}
# Use build platform specific path convention, relative paths do not work
run: >-
dotnet nuget push ${{ github.workspace }}/Utilities/Artifacts/*.nupkg
dotnet nuget push ${{ github.workspace }}/Publish/*.nupkg
--source https://api.nuget.org/v3/index.json
--api-key ${{ secrets.NUGET_API_KEY}}
--skip-duplicate
Expand All @@ -74,7 +74,26 @@ jobs:
if: ${{ github.event_name != 'pull_request' }}
# Use build platform specific path convention, relative paths do not work
run: >-
dotnet nuget push ${{ github.workspace }}/Utilities/Artifacts/*.nupkg
dotnet nuget push ${{ github.workspace }}/Publish/*.nupkg
--source https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json
--api-key ${{ secrets.GITHUB_TOKEN }}
--skip-duplicate
# Zip the output
- name: 'Zip Output'
run: 7z a -t7z ./Publish/Utilities.7z ./Publish/*

# Create GitHub release
# https://github.com/marketplace/actions/automatic-releases
- name: 'Create GitHub Release'
# Do not push on pull requests
if: ${{ (github.event_name != 'pull_request') }}
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: ${{ steps.nbgv.outputs.SemVer2 }}
# Only main branch is not a pre-release
prerelease: ${{ !endsWith(github.ref, 'refs/heads/main') }}
files: |
LICENSE
./Publish/Utilities.7z

0 comments on commit 081189d

Please sign in to comment.