workflow change #2540
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
name: .NET Core Desktop | |
on: | |
push: | |
branches: | |
- "main" | |
- "DEV" | |
pull_request: | |
branches: | |
- "main" | |
- "DEV" | |
jobs: | |
build: | |
strategy: | |
matrix: | |
configuration: [Debug] #, Release] | |
runs-on: windows-latest | |
env: | |
Solution_Name: ClearDashboard | |
Solution_Path: src\ClearDashboard.sln | |
Test_Project_Path: src\ClearDashboard.Tests\ClearDashboard.Tests.csproj | |
Wpf_Project_Path: src\ClearDashboard.WPF\ClearDashboard.WPF.csproj | |
Wap_Project_Directory: ClearDashboard.WPF.Package | |
Wap_Project_Path: ClearDashboard.App.Package\ClearDashboard.Package.wapproj | |
steps: | |
# Checkout repository with Git LFS support | |
- name: Checkout repository | |
uses: actions/checkout@v3 | |
with: | |
lfs: true # Ensures LFS files are downloaded | |
token: ${{ secrets.GH_PACKAGES_PAT }} # Use a PAT if needed for LFS authentication | |
# Install .NET Core | |
- name: Install .NET Core | |
uses: actions/setup-dotnet@v1 | |
with: | |
dotnet-version: 8.0.x | |
# Setup MSBuild | |
- name: Setup MSBuild.exe | |
uses: microsoft/[email protected] | |
# Setup NuGet | |
- name: Setup NuGet | |
uses: Nuget/[email protected] | |
# Configure NuGet sources | |
- name: Configure ClearBible GitHub NuGet package source | |
run: dotnet nuget add source --username ${{ secrets.GH_PACKAGES_USER }} --password ${{ secrets.GH_PACKAGES_PAT }} --store-password-in-clear-text --name github "https://nuget.pkg.github.com/clear-bible/index.json" | |
- name: Configure Caliburn.Micro NuGet package source | |
run: dotnet nuget add source --name myget-caliburn-micro "https://www.myget.org/F/caliburn-micro-builds/api/v3/index.json" | |
# Restore NuGet packages | |
- name: Restore NuGet packages | |
run: nuget restore $env:Solution_Path | |
# Build the solution | |
- name: Build | |
run: dotnet build $env:Solution_Path --no-restore | |
# Execute unit tests | |
- name: Execute unit tests | |
run: dotnet test $env:Test_Project_Path --no-build --verbosity normal | |
# Upload build artifacts | |
- name: Upload build artifacts | |
uses: actions/upload-artifact@v3 | |
with: | |
name: MSIX Package | |
path: ${{ env.Wap_Project_Directory }}\AppPackages | |
# Slack notifications | |
- name: Post success to Slack | |
if: "contains(job.status, 'success')" | |
uses: slackapi/[email protected] | |
with: | |
channel-id: "some_id_here" | |
slack-message: ":grin: GitHub build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}" | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} | |
- name: Post failure to Slack | |
if: "!contains(job.status, 'success')" | |
uses: slackapi/[email protected] | |
with: | |
channel-id: "some_id_here" | |
slack-message: ":poop: GitHub build result: ${{ job.status }}\n${{ github.event.pull_request.html_url || github.event.head_commit.url }}" | |
env: | |
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }} |