From 0c9e591f579177faf7185f35d6e46ea02da51c5e Mon Sep 17 00:00:00 2001 From: Stuart Turner Date: Thu, 14 Nov 2024 07:38:28 -0600 Subject: [PATCH] Improve build system --- .github/FUNDING.yml | 3 +++ .github/workflows/build.yml | 7 ------ .github/workflows/release.yml | 40 +++++++++++++++++++++++++++++++++++ Directory.Build.props | 1 - 4 files changed, 43 insertions(+), 8 deletions(-) create mode 100644 .github/FUNDING.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml new file mode 100644 index 0000000..c4a8cfb --- /dev/null +++ b/.github/FUNDING.yml @@ -0,0 +1,3 @@ +# These are supported funding model platforms + +github: [viceroypenguin] diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5cbcb13..977e060 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -35,10 +35,3 @@ jobs: uses: codecov/codecov-action@v4 with: token: ${{ secrets.CODECOV_TOKEN }} - - - name: Package - run: dotnet pack -c Release --no-build -o nupkgs - if: startsWith(github.ref, 'refs/tags/') - - name: Push to Nuget - run: dotnet nuget push "./nupkgs/*.nupkg" --source "https://api.nuget.org/v3/index.json" --api-key ${{ secrets.NUGETPUBLISHKEY }} - if: startsWith(github.ref, 'refs/tags/') diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..1ec694b --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,40 @@ +name: Release + +on: + workflow_dispatch: + push: + tags: + - '**' + +permissions: + contents: write + +jobs: + release: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: | + 8.0.x + + - name: Restore dependencies + run: dotnet restore + - name: Build + run: dotnet build -c Release --no-restore + + - name: Package + run: dotnet pack -c Release --no-build --property:PackageOutputPath=../../nupkgs + - name: Push to Nuget + run: dotnet nuget push "./nupkgs/*.nupkg" --source "https://api.nuget.org/v3/index.json" --api-key ${{ secrets.NUGETPUBLISHKEY }} + + - name: Create Release + uses: ncipollo/release-action@v1 + with: + generateReleaseNotes: 'true' + makeLatest: 'true' diff --git a/Directory.Build.props b/Directory.Build.props index b52086b..f961c06 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -1,7 +1,6 @@ latest - net8.0 enable $(WarningsAsErrors);nullable;