From b43d7a262c1c87872e7b982ba5181e002210b212 Mon Sep 17 00:00:00 2001 From: "Luke Parker [SSW]" <10430890+Hona@users.noreply.github.com> Date: Wed, 20 Mar 2024 10:57:44 +1000 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=F0=9F=8F=BB=20Automatically=20crea?= =?UTF-8?q?te=20GitHub=20release=20after=20nuspec=20version=20change=20(#3?= =?UTF-8?q?4)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/package.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 963e54a..994b45f 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -10,6 +10,8 @@ jobs: publish: name: Publish to NuGet.org runs-on: ubuntu-latest + permissions: + contents: write steps: - uses: actions/checkout@v2 @@ -22,3 +24,25 @@ jobs: - name: Publish the package run: nuget push *.nupkg -Source 'https://api.nuget.org/v3/index.json' -ApiKey ${{secrets.NUGET_API_KEY}} + + - name: Get version + id: package_version + uses: KageKirin/get-csproj-version@v1.0.0 + with: + file: VerticalSliceArchitecture.nuspec + xpath: /package/metadata/version + + - name: Create git tag + run: | + git tag -m "CI: create new tag" ${{ steps.package_version.outputs.version }} + git push https://${{ github.token }}@github.com/Hona/VerticalSliceArchitecture + + - name: Create release + uses: ncipollo/release-action@v1.14.0 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + draft: false + prerelease: false + generateReleaseNotes: true + tag: ${{ steps.package_version.outputs.version }} \ No newline at end of file