Skip to content

Merge pull request #73 from TeamStepping/net8 #13

Merge pull request #73 from TeamStepping/net8

Merge pull request #73 from TeamStepping/net8 #13

Workflow file for this run

name: Publish
on:
push:
tags:
- '*.*.*'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: NuGet/[email protected]
- uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
- name: Read common.props
id: commonProps
uses: juliangruber/read-file-action@v1
with:
path: ./common.props
- name: Get version in common.props
id: commonVersion
uses: AsasInnab/regex-action@v1
with:
regex_pattern: '(?<=>)[^<>]+(?=</Version>)'
regex_flags: 'gim'
search_string: '${{ steps.commonProps.outputs.content }}'
- name: Resolve version from the git tag name
id: tagVersion
run: echo ::set-output name=value::${GITHUB_REF##*/}
- name: Exit if the versions are different
if: ${{ steps.commonVersion.outputs.first_match != steps.tagVersion.outputs.value }}
run: |
echo Version in common.props: ${{ steps.commonVersion.outputs.first_match }}
echo Version of git tag name: ${{ steps.tagVersion.outputs.value }}
exit 1
- name: .NET restore
run: dotnet restore -s "https://api.nuget.org/v3/index.json"
- name: .NET build
run: dotnet build -c Release
- name: .NET pack
run: dotnet pack -c Release --no-build -o dest
- name: List the packages
run: ls dest
- name: Publishing approval request
uses: trstringer/manual-approval@v1
with:
secret: ${{ github.TOKEN }}
approvers: gdlcf88
minimum-approvals: 1
- name: Push to NuGet
working-directory: dest
run: dotnet nuget push *.nupkg -k ${{secrets.NUGET_API_KEY}} -s https://api.nuget.org/v3/index.json --skip-duplicate