Skip to content

chore: update Microsoft.Build.Traversal SDK version to 4.1.0 (#85) #17

chore: update Microsoft.Build.Traversal SDK version to 4.1.0 (#85)

chore: update Microsoft.Build.Traversal SDK version to 4.1.0 (#85) #17

Workflow file for this run

name: Release NuGet Package
on:
push:
tags:
- 'v*'
workflow_dispatch:
inputs:
skip_affected:
description: 'Whether to skip detecting if anything is affected or not'
default: false
required: false
type: boolean
jobs:
build:
uses: ./.github/workflows/build.yml
with:
os_matrix: "[\"ubuntu-latest\"]"
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Install .NET
run: |
./eng/install-sdk.sh
echo "DOTNET_ROOT=$GITHUB_WORKSPACE/eng/.dotnet" >> $GITHUB_ENV
echo "$GITHUB_WORKSPACE/eng/.dotnet" >> $GITHUB_PATH
- uses: nrwl/last-successful-commit-action@v1
name: Build Commit Range
id: last_successful_commit
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref_name }}
workflow_id: 'release.yml'
- uses: actions/download-artifact@v3
name: Download build artifacts
with:
name: artifacts
path: "."
- name: Detect Affected
id: affected
if: success() && steps.last_successful_commit.outputs.commit_hash != '' && !github.event.inputs.skip_affected
run: |
set +e
chmod +x ./dotnet-affected
./dotnet-affected -p $GITHUB_WORKSPACE -v \
--from ${{ steps.last_successful_commit.outputs.commit_hash }} \
--to ${{ github.sha }} \
--format text
exitCode=$?
if [ $exitCode -eq 0 ]; then
echo "::set-output name=should_deploy::true"
echo "Affected projects detected. Will deploy"
elif [ $exitCode -eq 166 ]; then
echo "::set-output name=should_deploy::false"
echo "No affected projects detected."
else
echo "Failed to run dotnet affected"
exit $exitCode
fi
- uses: actions/download-artifact@master
name: Download Package Artifact
if: success() && (steps.affected.outputs.should_deploy == 'true' || github.event.inputs.skip_affected || steps.last_successful_commit.outputs.commit_hash == '')
with:
name: packages
path: "."
- name: Push to NuGet
if: success() && (steps.affected.outputs.should_deploy == 'true' || github.event.inputs.skip_affected || steps.last_successful_commit.outputs.commit_hash == '')
run: dotnet nuget push *.nupkg --skip-duplicate -s https://api.nuget.org/v3/index.json -k ${{secrets.NUGET_API_KEY}}