Merge pull request #81 from horch004/master #2
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: true | |
jobs: | |
release: | |
runs-on: windows-latest | |
timeout-minutes: 15 | |
permissions: | |
packages: write | |
contents: write | |
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 | |
- uses: actions/[email protected] | |
with: | |
path: ~/.nuget/packages | |
# Look to see if there is a cache hit for the corresponding requirements file | |
# key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }} | |
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/[email protected] | |
with: | |
name: packages | |
path: bin/*.nupkg | |
# - name: deploy github.com | |
# run: | | |
# dotnet nuget add source --username $NUGET_USR --password $NUGET_PSW --store-password-in-clear-text --name github $NUGET_SOURCE | |
# find bin -name '*.nupkg' | xargs dotnet nuget push -s github --skip-duplicate --force-english-output | |
# shell: bash | |
# env: | |
# NUGET_SOURCE: https://nuget.pkg.github.com/${{ github.repository_owner }}/index.json | |
# NUGET_KEY: ${{ secrets.GITHUB_TOKEN }} | |
- 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 }} | |
- uses: marvinpinto/[email protected] | |
with: | |
repo_token: ${{ secrets.GITHUB_TOKEN }} | |
prerelease: ${{ contains(github.ref_name, '-') }} |