Merge pull request #16 from dawedawe/fix_preview_sdk #8
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: Release | |
on: | |
push: | |
tags: | |
- "v*" | |
jobs: | |
release: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Get version from tag | |
id: tag_name | |
run: | | |
echo ::set-output name=current_version::${GITHUB_REF#refs/tags/v} | |
shell: bash | |
- uses: actions/checkout@v3 | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v3 | |
with: | |
dotnet-version: 8.0.x | |
- name: Restore tools | |
run: dotnet tool restore | |
- name: Restore dependencies | |
run: dotnet restore | |
- name: Check formatting | |
run: dotnet fantomas --check . | |
- name: Build | |
run: dotnet build --no-restore -c Release | |
- name: Test | |
run: dotnet test --no-build -c Release --verbosity normal | |
- name: Pack | |
run: dotnet pack -c Release | |
- name: Get Changelog Entry | |
id: changelog_reader | |
uses: mindsers/changelog-reader-action@v2 | |
with: | |
validation_level: none | |
version: ${{ steps.tag_name.outputs.current_version }} | |
path: ./CHANGELOG.md | |
- name: Create Release | |
uses: ncipollo/release-action@v1 | |
with: | |
artifacts: "./nupkg/*.nupkg" | |
name: Release ${{ steps.changelog_reader.outputs.version }} | |
body: ${{ steps.changelog_reader.outputs.changes }} | |
prerelease: ${{ steps.changelog_reader.outputs.status == 'prereleased' }} | |
draft: ${{ steps.changelog_reader.outputs.status == 'unreleased' }} | |
- name: Push packages | |
run: dotnet nuget push "**/*.nupkg" -s "https://api.nuget.org/v3/index.json" -k ${{ secrets.NUGET_API_KEY }} --skip-duplicate |