From c28bf626f6bb16bd2b2af178dfdf8e6e7c52842e Mon Sep 17 00:00:00 2001 From: Jamesssssssssssssss <87044058+Jamesssssssssssssss@users.noreply.github.com> Date: Mon, 19 Jan 2026 19:14:18 +0000 Subject: [PATCH] build.yml Enhancements (#476) * update build.yml to build both ehr.dll and cta.exe, plus can now be run manually * retention days 1 * too detailed comments --- .github/workflows/build.yml | 81 ++++++++++++++++++++++++++++--------- 1 file changed, 62 insertions(+), 19 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ff5cca596..d23777106 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -3,31 +3,74 @@ name: Build on: pull_request: branches: [ main ] + workflow_dispatch: jobs: - build: - if: github.head_ref != 'translation' + # --------------------------------------------------------- + # 1) Build EHR + # --------------------------------------------------------- + build-ehr: runs-on: ubuntu-latest steps: - - name: Checkout repository - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - - name: Setup .NET - uses: actions/setup-dotnet@v3 - with: - dotnet-version: 8.0.x + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 6.0.x - - name: Cache NuGet packages - uses: actions/cache@v3 - with: - path: ~/.nuget/packages - key: ${{ runner.os }}-nuget-${{ hashFiles('**/*.csproj') }} - restore-keys: | - ${{ runner.os }}-nuget- + - name: Build EHR + run: dotnet build EHR.csproj -c Release -o build/ - - name: Restore dependencies - run: dotnet restore + - name: Upload EHR artifact + uses: actions/upload-artifact@v4 + with: + name: ehr + path: build/EHR.dll + retention-days: 1 - - name: Build - run: dotnet build --configuration Release --no-restore + # --------------------------------------------------------- + # 2) Build Control Panel + # --------------------------------------------------------- + build-control-panel: + runs-on: windows-latest + + steps: + - uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: 6.0.x + + - name: Setup MSBuild + uses: microsoft/setup-msbuild@v2 + + - name: Restore .NET packages + run: dotnet restore -p:SelfContained=true CTA/CustomTeamAssigner/CustomTeamAssigner.csproj + + - name: Build Control Panel (MSBuild) + run: | + msbuild CTA/CustomTeamAssigner/CustomTeamAssigner.csproj ` + /p:Configuration=Release ` + /p:Platform="x64" ` + /p:PublishSingleFile=true ` + /p:SelfContained=true ` + /p:RuntimeIdentifier=win-x64 ` + /p:IncludeAllContentForSelfExtract=true ` + /p:DebugType=None ` + /p:PublishDir=build\ ` + /t:publish + + - name: Rename exe file + run: | + mkdir build/ + mv CTA/CustomTeamAssigner/build/CustomTeamAssigner.exe build/EHR_Control-Panel_BETA.exe + + - name: Upload Control Panel artifact + uses: actions/upload-artifact@v4 + with: + name: control-panel + path: build/EHR_Control-Panel_BETA.exe + retention-days: 1