Skip to content

Commit

Permalink
Update CI/CD to pack and push packages in any branch (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
phamhongphuc1403 authored Jun 1, 2024
1 parent 4c9fcef commit 4b9fc0c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions .github/workflows/build-and-push-nuget-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ name: .NET

on:
push:
branches: [ "main" ]
branches: [ "*" ]

jobs:
build:
Expand Down Expand Up @@ -52,7 +52,13 @@ jobs:

- name: Pack affected projects
if: steps.dotnet_affected.outputs.has_output == 'true'
run: dotnet pack affected.proj
run: |
if [ "${{ github.ref_name }}" == "main" ]; then
dotnet pack affected.proj
else
VERSION=$(date +"%Y.%m.%d.%H%M")
dotnet pack affected.proj /p:Version=${VERSION}-dev
fi
- name: Push NuGet packages
if: steps.dotnet_affected.outputs.has_output == 'true'
Expand Down

0 comments on commit 4b9fc0c

Please sign in to comment.