fixes (#24) #10
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: Build and Pack FastTrack | |
on: | |
push: | |
branches: | |
- main | |
paths-ignore: | |
- 'Readme.md' | |
workflow_dispatch: | |
inputs: | |
reason: | |
description: 'Reason for running this workflow' | |
type: string | |
required: true | |
default: Manual run | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: 'Print manual run reason' | |
if: ${{ github.event_name == 'workflow_dispatch' }} | |
run: | | |
echo 'Reason: ${{ github.event.inputs.reason }}' | |
- name: Setup .NET | |
uses: actions/setup-dotnet@v4 | |
with: | |
dotnet-version: '9.0.x' | |
- name: Restore dependencies for FastTrack.Common | |
run: dotnet restore src/Common/Common.csproj | |
- name: Build FastTrack.Common | |
run: dotnet build src/Common/Common.csproj --configuration Release --no-restore | |
- name: Clean packages folder | |
run: rm -rf ./packages | |
shell: bash | |
- name: Pack FastTrack.Common NuGet package | |
run: dotnet pack src/Common/Common.csproj --configuration Release --no-build --output ./packages | |
- name: Check if FastTrack.Common package was created | |
id: check_common_nupkg | |
run: | | |
if ls ./packages/FastTrack.Common*.nupkg 1> /dev/null 2>&1; then | |
echo "FastTrack.Common NuGet package found." | |
echo "found=true" >> $GITHUB_OUTPUT | |
else | |
echo "FastTrack.Common NuGet package NOT found. Terminating workflow." | |
echo "found=false" >> $GITHUB_OUTPUT | |
exit 1 | |
fi | |
- name: Restore dependencies for FastTrack | |
if: steps.check_common_nupkg.outputs.found == 'true' | |
run: dotnet restore src/FastTrack/FastTrack.csproj | |
- name: Build FastTrack | |
if: steps.check_common_nupkg.outputs.found == 'true' | |
run: dotnet build src/FastTrack/FastTrack.csproj --configuration Release --no-restore | |
- name: Pack FastTrack NuGet package | |
if: steps.check_common_nupkg.outputs.found == 'true' | |
run: dotnet pack src/FastTrack/FastTrack.csproj --configuration Release --no-build --output ./packages | |
- name: Upload package artifact | |
uses: actions/upload-artifact@v4.6.2 | |
with: | |
name: FastTrack-nuget-package | |
path: ./packages/*.nupkg |