-
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.
Sets up GitHub releases with GitReleaseManager. This should resolve the git tagging permission issue _and_ automate the release process, which improves CI/CD.
- Loading branch information
Showing
1 changed file
with
18 additions
and
7 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 |
---|---|---|
|
@@ -6,6 +6,9 @@ on: | |
pull_request: | ||
branches: [main] | ||
|
||
env: | ||
REPO_NAME: ${{ github.event.repository.name }} | ||
|
||
jobs: | ||
build: | ||
name: Build | ||
|
@@ -27,6 +30,10 @@ jobs: | |
useConfigFile: true | ||
additionalArguments: /updateprojectfiles | ||
|
||
- name: Set nupkg path (GitVersion-ed) | ||
run: | | ||
echo 'NUPKG_PATH=artifacts/package/release/${{ env.REPO_NAME }}.${{ env.GitVersion_SemVer }}.nupkg' >> "$GITHUB_ENV" | ||
- name: Use .NET | ||
uses: actions/setup-dotnet@v4 | ||
with: | ||
|
@@ -52,17 +59,21 @@ jobs: | |
- name: dotnet nuget push | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
run: >- | ||
dotnet nuget push | ||
artifacts/package/release/*.nupkg | ||
dotnet nuget push ${{ env.NUPKG_PATH }} | ||
--api-key $NUGET_AUTH_TOKEN | ||
--no-symbols | ||
--skip-duplicate | ||
--source https://api.nuget.org/v3/index.json | ||
env: | ||
NUGET_AUTH_TOKEN: ${{ secrets.NUGET_AUTH_TOKEN }} | ||
|
||
- name: git tag | ||
- uses: gittools/actions/gitreleasemanager/[email protected] | ||
if: ${{ github.ref == 'refs/heads/main' }} | ||
run: | | ||
git tag v${{ env.GitVersion_SemVer }} | ||
git push origin tag v${{ env.GitVersion_SemVer }} | ||
name: Create release (GitReleaseManager) | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
owner: ${{ env.GITHUB_REPOSITORY_OWNER }} | ||
repository: ${{ env.REPO_NAME }} | ||
milestone: ${{ env.GitVersion_SemVer }} | ||
name: v${{ env.GitVersion_SemVer }} | ||
assets: | | ||
${{ env.NUPKG_PATH }} |