Skip to content

Commit

Permalink
Merge pull request #19 from kwtc/chore/update-publish-action
Browse files Browse the repository at this point in the history
Updated publish action
  • Loading branch information
kwtc committed Jun 19, 2023
2 parents 2bfe9a5 + ce5e2ee commit 43ce67a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
17 changes: 13 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,24 +10,33 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:

- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Verify commit exists in origin/main
run: git branch --remote --contains | grep origin/main

- name: Extract release notes
run: |
git log --pretty=format:'%d %s' ${GITHUB_REF} | perl -pe 's| \(.*tag: v(\d+.\d+.\d+(-preview\d{3})?)(, .*?)*\)|\n## \1\n|g' > RELEASE-NOTES
- name: Set VERSION variable from tag
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV

- name: Build
run: dotnet build -c Release /p:Version=${VERSION}

- name: Test
run: dotnet test -c Release /p:Version=${VERSION} --no-build

- name: Pack
run: dotnet pack -c Release /p:Version=${VERSION} --no-build --output .
- name: Push
run: dotnet nuget push **\*.nupkg --source https://nuget.pkg.github.com/kwtc/index.json --api-key ${GITHUB_TOKEN}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Push package to Nuget.org
run: dotnet nuget push **\*.nupkg --api-key ${{secrets.NUGET_API_KEY}} --source https://api.nuget.org/v3/index.json

- name: Push package to Github
run: dotnet nuget push **\*.nupkg --api-key ${{secrets.GITHUB_TOKEN}} --source https://nuget.pkg.github.com/kwtc/index.json
6 changes: 4 additions & 2 deletions Kwtc.Persistence/Kwtc.Persistence.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@

<PropertyGroup>
<PackageId>Kwtc.Persistence</PackageId>
<Version>2.0.1</Version>
<Authors>Kasper Christiansen</Authors>
<RepositoryUrl>https://github.com/kwtc/kwtc-persistence</RepositoryUrl>
<RepositoryUrl>https://github.com/kwtc/persistence</RepositoryUrl>
<PackageProjectUrl>https://github.com/kwtc/persistence</PackageProjectUrl>
<Description>A collection of utilities for working with persistence in .NET using Dapper.</Description>
<PackageTags>MySQL SQLite MSSQL Dapper In-memory-database Dbconnection</PackageTags>
</PropertyGroup>

<ItemGroup>
Expand Down

0 comments on commit 43ce67a

Please sign in to comment.