Skip to content

v2.1.0

v2.1.0 #27

Workflow file for this run

name: Release
on:
release:
types:
- published
permissions:
contents: write
packages: write
env:
CONFIGURATION: Release
DOTNET_NOLOGO: true
FORCE_COLOR: 3
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Get version from tag
id: tag_name
run: echo "current_version=${GITHUB_REF#refs/tags/v}" >> $GITHUB_OUTPUT
- name: Check out repository
uses: actions/checkout@v4.1.2
- name: Set up Node
uses: actions/setup-node@v4.0.2
with:
node-version-file: .nvmrc
- name: Set up .NET
uses: xt0rted/setup-dotnet@v1.5.0
- name: Set up .NET
uses: xt0rted/setup-dotnet@v1.5.0
with:
colored-output: false
strip-comments-from-global-json: false
dotnet-version: |
6.0.x
- run: npm ci
- run: dotnet tool restore
- run: dotnet r build
- run: dotnet r test -- --no-build --logger GitHubActions
- run: dotnet r pack -- --no-build
- name: Publish artifacts
uses: actions/upload-artifact@v4.3.1
with:
path: ./artifacts/*.nupkg
- name: Get changelog entry
uses: mindsers/changelog-reader-action@v2.2.3
id: changelog_reader
with:
version: ${{ steps.tag_name.outputs.current_version }}
- name: Upload release assets
uses: softprops/action-gh-release@v2.0.4
id: release_updater
with:
body: ${{ steps.changelog_reader.outputs.changes }}
files: ./artifacts/*.nupkg
- name: Create discussion for release
run: |
gh api \
--method PATCH \
-H "Accept: application/vnd.github+json" \
/repos/${{ github.repository }}/releases/${{ steps.release_updater.outputs.id }} \
-f discussion_category_name='Announcements'
env:
GITHUB_TOKEN: ${{ secrets.RELEASE_TOKEN }}
- name: Publish to GPR
run: |
dotnet nuget push "./artifacts/*.nupkg" \
--api-key ${{ secrets.GITHUB_TOKEN }} \
--source https://nuget.pkg.github.com/${{ github.repository_owner }}
- name: Publish to nuget.org
run: |
dotnet nuget push "./artifacts/*.nupkg" \
--api-key ${{ secrets.NUGET_TOKEN }} \
--source https://api.nuget.org/v3/index.json