specify folder #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
on: | |
push: | |
tags: | |
- goodrouter-net@*.*.* | |
jobs: | |
publish-nuget: | |
runs-on: ubuntu-latest | |
container: mcr.microsoft.com/dotnet/sdk:6.0 | |
env: | |
NUGET_API_KEY: ${{ secrets.NUGET_API_KEY }} | |
# from https://semver.org/ | |
SEMVER_REGEX: > | |
^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$ | |
steps: | |
- run: apt update | |
- run: apt install git-lfs | |
- uses: actions/checkout@v3 | |
with: | |
lfs: true | |
# see https://learn.microsoft.com/en-us/dotnet/standard/library-guidance/versioning | |
- run: > | |
dotnet pack goodrouter-net/Goodrouter | |
--configuration Release | |
--property Version=$(echo ${GITHUB_REF_NAME} | perl -pe "s/@(.*)$/\1/") | |
--property AssemblyVersion=$(echo ${GITHUB_REF_NAME} | perl -pe "s/@(.*)$/\1/" | perl -pe "s/${SEMVER_REGEX}/\1.0.0.0/") | |
--property FileVersion=$(echo ${GITHUB_REF_NAME} | perl -pe "s/@(.*)$/\1/" | perl -pe "s/${SEMVER_REGEX}/\1.\2.\3.${GITHUB_RUN_ID}/") | |
- run: > | |
dotnet nuget push | |
--api-key $NUGET_API_KEY | |
--source https://api.nuget.org/v3/index.json 'goodrouter-net/Goodrouter/bin/Release/*.nupkg' |