Skip to content

Fixing the workflow again #5

Fixing the workflow again

Fixing the workflow again #5

Workflow file for this run

# .github/workflows/dotnet.yml
name: .NET CI
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: '7.x' # Specify the version or use 'latest' for the most recent
- name: Install dependencies
run: cd Tool/BuildAutomationTool && dotnet restore BuildAutomationTool.sln
- name: Lint the code
run: cd Tool/BuildAutomationTool && dotnet format --verify-no-changes
continue-on-error: true
- name: Build the project
run: cd Tool/BuildAutomationTool && dotnet build BuildAutomationTool.sln --no-restore --configuration Release
- name: Run unit tests
run: cd Tool/BuildAutomationTool && dotnet test BuildAutomationTool.sln --no-build --configuration Release --verbosity normal
- name: Package the project
run: cd Tool/BuildAutomationTool && dotnet pack BuildAutomationTool.sln --no-build --configuration Release -o ./artifacts
- name: Publish package to GitHub Packages
if: github.ref == 'refs/heads/main' && success() # Publish only on successful builds of the main branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: cd Tool/BuildAutomationTool && dotnet nuget push ./artifacts/*.nupkg --source "https://nuget.pkg.github.com/LoveDuckie/index.json" --api-key ${{ secrets.GITHUB_TOKEN }}