Skip to content

Merge pull request #178 #20

Merge pull request #178

Merge pull request #178 #20

Workflow file for this run

name: Create Release
on:
push:
tags:
- '*'
jobs:
build:
runs-on: ubuntu-22.04
env:
COREHOST_TRACE: false
DOTNET_CLI_TELEMETRY_OPTOUT: 1 # Disable sending usage data to Microsoft
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1 # prevent the caching of the packages on the build machine
DOTNET_NOLOGO: true # removes logo and telemetry message from first run of dotnet cli
NUGET_XMLDOC_MODE: skip # prevent the download of the XML documentation for the packages
defaults:
run:
shell: bash
steps:
- uses: actions/checkout@v6
- name: Setup .NET 8
uses: actions/setup-dotnet@v5
with:
dotnet-version: |
7.0.x
8.0.x
- name: Setup Nuget Cache
uses: actions/cache@v5
id: nuget-cache
with:
path: ~/.nuget
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }}
restore-keys: ${{ runner.os }}-nuget-
- name: Restore Nuget packages
run: dotnet restore -v:n
- name: Prepare Release Assets
id: get-version
run: |
echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_OUTPUT
.github/release-notes.sh CHANGELOG.md > release-notes.txt
- name: Creates Nuget package
run: dotnet pack --configuration Release --output ./SignNow.Net/bin/Publish SignNow.Net
- name: Create Release
uses: ncipollo/release-action@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
token: ${{ env.GITHUB_TOKEN }}
name: signNow .Net SDK v${{ steps.get-version.outputs.VERSION }}
tag: ${{ steps.get-version.outputs.VERSION }}
bodyFile: ${{ github.workspace }}/release-notes.txt
allowUpdates: true
artifacts: ${{ github.workspace }}/SignNow.Net/bin/Publish/*.nupkg
artifactContentType: application/octet-stream
- name: Publish Nuget Package
working-directory: ${{ github.workspace }}/SignNow.Net/bin/Publish
env:
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}
run: |
dotnet nuget push SignNow.Net.${{ steps.get-version.outputs.VERSION }}.nupkg \
--api-key ${{ env.NUGET_TOKEN }} \
--source https://api.nuget.org/v3/index.json