test: Code cleanup in test project (#82) #5
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* | |
# https://github.com/adamralph/minver | |
env: | |
DOTNET_NOLOGO: true | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.number || github.ref }} | |
cancel-in-progress: false | |
permissions: | |
contents: read | |
jobs: | |
nuget-release: | |
runs-on: windows-latest | |
timeout-minutes: 15 | |
env: | |
CONFIGURATION: Release | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
fetch-depth: 0 # needed so minver finds git tags https://github.com/actions/checkout/issues/172 | |
filter: blob:none # We don't need all blobs | |
- uses: actions/cache@13aacd865c20de90d75de3b17ebe84f7a17d57d2 # v4.0.0 | |
with: | |
path: ~/.nuget/packages | |
key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj', '**/*.props', '**/*.targets') }} | |
restore-keys: | | |
${{ runner.os }}-nuget | |
- name: restore | |
run: dotnet restore | |
- name: build | |
run: dotnet build --no-restore | |
- name: pack | |
run: dotnet pack -o bin | |
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1 | |
with: | |
name: packages | |
path: bin/*.nupkg | |
- name: deploy nuget.org | |
run: find bin -name '*.nupkg' | xargs dotnet nuget push -s $NUGET_SOURCE -k $NUGET_KEY --skip-duplicate --force-english-output | |
shell: bash | |
env: | |
NUGET_SOURCE: https://api.nuget.org/v3/index.json | |
NUGET_KEY: ${{ secrets.NUGET_API_KEY }} | |
gh-release: | |
needs: | |
- nuget-release | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
permissions: | |
contents: write | |
steps: | |
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | |
with: | |
fetch-depth: 0 # needed so minver finds git tags https://github.com/actions/checkout/issues/172 | |
filter: blob:none # We don't need all blobs | |
- name: prepare version | |
run: echo VERSION=${GITHUB_REF_NAME#v} >> $GITHUB_ENV | |
- name: Generate changelog with git-cliff | |
uses: tj-actions/git-cliff@b8b856ab6829a813d4ed58476b6faaec9c2b24ef # v1.4.2 | |
with: | |
args: --latest --strip all | |
output: 'CHANGELOG.md' | |
- uses: ncipollo/release-action@2c591bcc8ecdcd2db72b97d6147f871fcd833ba5 # v1.14.0 | |
with: | |
bodyFile: 'CHANGELOG.md' | |
name: ${{ env.VERSION }} | |
prerelease: ${{ contains(github.ref_name, '-') }} |