Skip to content

Commit

Permalink
Create release.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
drr00t authored May 17, 2022
1 parent 17a7b83 commit 4c356d2
Showing 1 changed file with 39 additions and 0 deletions.
39 changes: 39 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
on:
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"


name: Release

jobs:
nuget:
name: Publish Nuget
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Get the version
id: get_version
run: echo "VERSION=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Setup .NET
uses: actions/setup-dotnet@v1
with:
dotnet-version: 5.x
- name: Pack
run: dotnet pack --configuration Release /p:Version=${VERSION} --output .
- name: Push
run: dotnet nuget push *.${VERSION}.nupkg -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_KEY}}
create-github-release:
name: Create GitHub Release
runs-on: ubuntu-latest
needs: nuget
steps:
- name: Create Release Notes
uses: actions/github-script@v4.0.2
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
await github.request(`POST /repos/${{ github.repository }}/releases`, {
tag_name: "${{ github.ref }}",
generate_release_notes: true
});

0 comments on commit 4c356d2

Please sign in to comment.