Skip to content

Commit

Permalink
📦 Set up GitHub releases (#8)
Browse files Browse the repository at this point in the history
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
connorjs authored Jul 23, 2024
1 parent 50269f1 commit 69a298c
Showing 1 changed file with 18 additions and 7 deletions.
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 }}

0 comments on commit 69a298c

Please sign in to comment.