Update version script #35
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Create Release | |
on: | |
push: | |
tags: | |
- "*.*.*" | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Create Release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 8.0.x | |
- name: Fetch all commits | |
run: git fetch --unshallow | |
- name: Update version | |
id: version | |
run: ./get-version.sh | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Build | |
run: dotnet build --no-restore --configuration Release | |
- name: Test | |
run: dotnet test --no-build --configuration Release --verbosity normal | |
- name: Deploy to NuGet | |
if: ${{ startsWith(github.ref, 'refs/tags/v') }} | |
run: | | |
dotnet pack -c Release /p:Version=${{ steps.version.outputs.SemVer }} -o "nuget" | |
dotnet nuget push nuget/*.nupkg -k ${{ secrets.NUGET_KEY }} -s https://api.nuget.org/v3/index.json | |
- name: Extract release notes | |
id: extract-release-notes | |
uses: ffurrer2/extract-release-notes@v1 | |
- name: Read release notes preface | |
id: release_preface | |
uses: juliangruber/read-file-action@v1 | |
with: | |
path: .github/RELEASE_TEMPLATE.md | |
- name: Create release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref }} | |
release_name: ${{ github.ref }} | |
draft: true | |
prerelease: true | |
body: | | |
${{ steps.release_preface.outputs.content }} | |
${{ steps.extract-release-notes.outputs.release_notes }} |