Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

📦 Set up GitHub releases #8

Merged
merged 2 commits into from
Jul 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 18 additions & 7 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
pull_request:
branches: [main]

env:
REPO_NAME: ${{ github.event.repository.name }}

jobs:
build:
name: Build
Expand All @@ -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:
Expand All @@ -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 }}