-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: .NET Build | ||
|
||
on: | ||
push: | ||
branches: [ main ] | ||
paths: | ||
- '**/*.csproj' # Trigger only when .csproj files are changed | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
build: | ||
runs-on: windows-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 # Fetches all history for all branches and tags, necessary for SonarCloud or similar analysis if used. | ||
|
||
- name: Setup .NET Core | ||
uses: actions/setup-dotnet@v2 | ||
with: | ||
dotnet-version: '8.0' # Specify the .NET version | ||
|
||
- name: Restore dependencies | ||
run: dotnet restore TinyColorMap.sln | ||
|
||
- name: Build | ||
run: dotnet build --configuration Release --no-restore TinyColorMap.sln | ||
|
||
- name: Run Tests | ||
run: dotnet test --no-restore --verbosity normal TinyColorMap.sln | ||
|
||
## Pack and publish steps (only) for push to main branch | ||
# - name: Pack | ||
# if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
# run: dotnet pack --configuration Release --no-build --output nupkgs | ||
# env: | ||
# VERSION_SUFFIX: ${{ github.run_number }} | ||
# | ||
# - name: Publish NuGet Package | ||
# if: github.event_name == 'push' && github.ref == 'refs/heads/main' | ||
# run: dotnet nuget push "nupkgs/**/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json |