#147 retry fixing #14
Workflow file for this run
This file contains hidden or 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: "2. Continuous Deployment (Release)" | |
| on: | |
| push: | |
| tags: | |
| - "v[0-9]+.[0-9]+.[0-9]+" | |
| - "v[0-9]+.[0-9]+.[0-9]+-preview*" | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 15 | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 | |
| - name: Verify commit exists in origin/main | |
| run: git branch --remote --contains | grep origin/main | |
| - name: Extract release notes | |
| run: | | |
| git log --pretty=format:'%d %s' ${GITHUB_REF} | perl -pe 's| \(.*tag: v(\d+.\d+.\d+(-preview[0-9A-Za-z\.\-]+)?)?(, .*?)*\)|\n## \1\n|g' > RELEASE-NOTES | |
| - name: Setup .NET | |
| uses: actions/setup-dotnet@v4 | |
| with: | |
| dotnet-version: 8.0.x | |
| - name: Set VERSION variable from tag | |
| run: | | |
| RAW_VERSION=${GITHUB_REF/refs\/tags\/v/} | |
| BASE=$(echo $RAW_VERSION | cut -d- -f1) | |
| PRE=$(echo $RAW_VERSION | cut -s -d- -f2-) | |
| if [ -n "$PRE" ]; then | |
| # Split prerelease into parts by dot and strip leading zeros from numbers | |
| CLEAN_PRE=$(echo $PRE | awk -F. '{ | |
| out=$1; | |
| for (i=2;i<=NF;i++) { | |
| if ($i ~ /^[0-9]+$/) sub(/^0+/, "", $i); | |
| if ($i == "") $i="0"; | |
| out=out"."$i | |
| } | |
| print out | |
| }') | |
| VERSION="$BASE-$CLEAN_PRE" | |
| else | |
| VERSION="$BASE" | |
| fi | |
| echo "Using VERSION=$VERSION" | |
| echo "VERSION=$VERSION" >> $GITHUB_ENV | |
| - name: Build | |
| run: dotnet build --configuration Release /p:Version=${VERSION} | |
| - name: Test | |
| run: dotnet test --configuration Release /p:Version=${VERSION} --no-build | |
| - name: Pack | |
| run: dotnet pack --configuration Release /p:Version=${VERSION} --no-build --output . | |
| - name: Push | |
| run: dotnet nuget push CryptoNet.${VERSION}.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_TOKEN} | |
| env: | |
| NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }} |