Skip to content

Commit

Permalink
Create deploy-nuget-packages.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
phamhongphuc1403 authored May 31, 2024
1 parent 7afbc77 commit 751160e
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/deploy-nuget-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# This workflow will build a .NET project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-net

name: .NET

on:
push:
branches: [ "test" ]
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Work out last successful commit
id: setSHAs
uses: nrwl/nx-set-shas@v4

- name: Determine affected projects
id: dotnet_affected
run: |
dotnet tool install dotnet-affected && touch affected.txt
if dotnet affected -f text traversal \
--from "${{ steps.setSHAs.outputs.base }}" \
--to "${{ github.sha }}"; then
if [ -s affected.txt ]; then
cat affected.txt
echo "Number of affected projects: " $(wc -l < affected.txt)
echo "has_output=true" >> $GITHUB_OUTPUT
else
echo "No affected projects."
echo "has_output=false" >> $GITHUB_OUTPUT
fi
elif [ $? -ne 166 ]; then
echo "Exiting, error occurred"
exit 1
else
echo "No affected projects."
echo "has_output=false" >> $GITHUB_OUTPUT
fi

- name: Test affected projects
if: steps.dotnet_affected.outputs.has_output == 'true'
run: dotnet test affected.proj

0 comments on commit 751160e

Please sign in to comment.