From 93a6f5c73eeacaeb0ec3efc13f536fc628fdeef5 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 2 Mar 2026 16:59:42 +0000 Subject: [PATCH 1/4] Add GitHub Actions build workflow for CI/CD Co-authored-by: HakanL <407941+HakanL@users.noreply.github.com> --- .github/workflows/build.yml | 68 +++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..6ffde80 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,68 @@ +name: Build + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: windows-latest + permissions: + contents: write + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Setup .NET + uses: actions/setup-dotnet@v4 + with: + dotnet-version: '8.x' + + - name: Restore dependencies + run: dotnet restore Seq.Client.WindowsLogins.sln + + - name: Build + run: dotnet build Seq.Client.WindowsLogins.sln --configuration Release --no-restore + + - name: Test + run: dotnet test Seq.Client.WindowsLogins.sln --configuration Release --no-build --verbosity normal + + - name: Get version + id: get_version + shell: pwsh + run: | + $xml = [xml](Get-Content "Seq.Client.WindowsLogins/Seq.Client.WindowsLogins.csproj") + $version = $xml.Project.PropertyGroup.Version | Where-Object { $_ -ne $null } | Select-Object -First 1 + if (-not $version) { + Write-Error "Could not extract version from Seq.Client.WindowsLogins.csproj. Ensure a element is present." + exit 1 + } + echo "VERSION=$version" >> $env:GITHUB_OUTPUT + + - name: Create release package + shell: pwsh + run: | + $version = "${{ steps.get_version.outputs.VERSION }}" + $outputDir = "Seq.Client.WindowsLogins/bin/Release/net462" + $zipName = "Seq.Client.WindowsLogins-$version.zip" + Compress-Archive -Path "$outputDir/*" -DestinationPath $zipName + echo "ZIP_NAME=$zipName" >> $env:GITHUB_OUTPUT + id: create_package + + - name: Upload build artifact + uses: actions/upload-artifact@v4 + with: + name: Seq.Client.WindowsLogins-${{ steps.get_version.outputs.VERSION }} + path: ${{ steps.create_package.outputs.ZIP_NAME }} + + - name: Create GitHub release + if: github.event_name == 'push' && github.ref == 'refs/heads/master' + uses: softprops/action-gh-release@v2 + with: + tag_name: v${{ steps.get_version.outputs.VERSION }} + name: Release v${{ steps.get_version.outputs.VERSION }} + files: ${{ steps.create_package.outputs.ZIP_NAME }} + generate_release_notes: true From bb4d8f54487ce276d296ec64efd7ea1098d9e0ee Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 2 Mar 2026 17:12:45 +0000 Subject: [PATCH 2/4] Add version.json and automatic build number / AppVersion stamping Co-authored-by: HakanL <407941+HakanL@users.noreply.github.com> --- .github/workflows/build.yml | 69 +++++++++++++++++++++++++------------ version.json | 3 ++ 2 files changed, 50 insertions(+), 22 deletions(-) create mode 100644 version.json diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6ffde80..17196a1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -16,6 +16,44 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Get base version from version.json + id: version + uses: notiz-dev/github-action-json-property@release + with: + path: version.json + prop_path: 'version' + + - name: Set branch name (push) + if: startsWith(github.ref, 'refs/heads/') + shell: pwsh + run: | + $branch = "${{ github.ref }}" -replace 'refs/heads/', '' -replace '[\s_]', '-' + echo "BRANCH_NAME=$branch" >> $env:GITHUB_ENV + + - name: Set branch name (PR) + if: startsWith(github.ref, 'refs/pull/') + shell: pwsh + run: | + $prNumber = "${{ github.ref }}" -replace 'refs/pull/', '' -replace '/merge', '' + echo "BRANCH_NAME=PR-$prNumber" >> $env:GITHUB_ENV + + - name: Set package version (master) + if: github.ref == 'refs/heads/master' + shell: pwsh + run: | + $numericVersion = "${{ steps.version.outputs.prop }}.${{ github.run_number }}" + echo "PACKAGE_VERSION=$numericVersion" >> $env:GITHUB_ENV + echo "ASSEMBLY_VERSION=$numericVersion.0" >> $env:GITHUB_ENV + + - name: Set package version (non-master) + if: github.ref != 'refs/heads/master' + shell: pwsh + run: | + $sha = "${{ github.sha }}".Substring(0, 8) + $numericVersion = "${{ steps.version.outputs.prop }}.${{ github.run_number }}" + echo "PACKAGE_VERSION=$numericVersion-$env:BRANCH_NAME-$sha" >> $env:GITHUB_ENV + echo "ASSEMBLY_VERSION=$numericVersion.0" >> $env:GITHUB_ENV + - name: Setup .NET uses: actions/setup-dotnet@v4 with: @@ -25,44 +63,31 @@ jobs: run: dotnet restore Seq.Client.WindowsLogins.sln - name: Build - run: dotnet build Seq.Client.WindowsLogins.sln --configuration Release --no-restore + run: dotnet build Seq.Client.WindowsLogins.sln --configuration Release --no-restore /p:Version="$env:PACKAGE_VERSION" /p:AssemblyVersion="$env:ASSEMBLY_VERSION" /p:FileVersion="$env:ASSEMBLY_VERSION" - name: Test run: dotnet test Seq.Client.WindowsLogins.sln --configuration Release --no-build --verbosity normal - - name: Get version - id: get_version - shell: pwsh - run: | - $xml = [xml](Get-Content "Seq.Client.WindowsLogins/Seq.Client.WindowsLogins.csproj") - $version = $xml.Project.PropertyGroup.Version | Where-Object { $_ -ne $null } | Select-Object -First 1 - if (-not $version) { - Write-Error "Could not extract version from Seq.Client.WindowsLogins.csproj. Ensure a element is present." - exit 1 - } - echo "VERSION=$version" >> $env:GITHUB_OUTPUT - - name: Create release package + id: create_package shell: pwsh run: | - $version = "${{ steps.get_version.outputs.VERSION }}" $outputDir = "Seq.Client.WindowsLogins/bin/Release/net462" - $zipName = "Seq.Client.WindowsLogins-$version.zip" + $zipName = "Seq.Client.WindowsLogins-$env:PACKAGE_VERSION.zip" Compress-Archive -Path "$outputDir/*" -DestinationPath $zipName - echo "ZIP_NAME=$zipName" >> $env:GITHUB_OUTPUT - id: create_package + echo "ZIP_NAME=$zipName" >> $env:GITHUB_ENV - name: Upload build artifact uses: actions/upload-artifact@v4 with: - name: Seq.Client.WindowsLogins-${{ steps.get_version.outputs.VERSION }} - path: ${{ steps.create_package.outputs.ZIP_NAME }} + name: Seq.Client.WindowsLogins-${{ env.PACKAGE_VERSION }} + path: ${{ env.ZIP_NAME }} - name: Create GitHub release if: github.event_name == 'push' && github.ref == 'refs/heads/master' uses: softprops/action-gh-release@v2 with: - tag_name: v${{ steps.get_version.outputs.VERSION }} - name: Release v${{ steps.get_version.outputs.VERSION }} - files: ${{ steps.create_package.outputs.ZIP_NAME }} + tag_name: v${{ env.PACKAGE_VERSION }} + name: Release v${{ env.PACKAGE_VERSION }} + files: ${{ env.ZIP_NAME }} generate_release_notes: true diff --git a/version.json b/version.json new file mode 100644 index 0000000..dde0723 --- /dev/null +++ b/version.json @@ -0,0 +1,3 @@ +{ + "version": "1.1" +} From 7c5accb657371719df2560029cfcaffb60644d1c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 2 Mar 2026 17:17:52 +0000 Subject: [PATCH 3/4] Post PR comment with artifact download link after PR builds Co-authored-by: HakanL <407941+HakanL@users.noreply.github.com> --- .github/workflows/build.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 17196a1..a305f44 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -11,6 +11,7 @@ jobs: runs-on: windows-latest permissions: contents: write + pull-requests: write steps: - name: Checkout repository @@ -83,6 +84,20 @@ jobs: name: Seq.Client.WindowsLogins-${{ env.PACKAGE_VERSION }} path: ${{ env.ZIP_NAME }} + - name: Comment on PR with artifact link + if: github.event_name == 'pull_request' + uses: actions/github-script@v7 + with: + script: | + const runUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`; + const version = process.env.PACKAGE_VERSION || 'unknown'; + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + body: `📦 **Build artifact ready:** \`Seq.Client.WindowsLogins-${version}\`\n\nDownload it from the [workflow run artifacts](${runUrl}#artifacts).` + }); + - name: Create GitHub release if: github.event_name == 'push' && github.ref == 'refs/heads/master' uses: softprops/action-gh-release@v2 From aaee4d5d04b5b5c616355f9f0db6400ffc39aced Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 2 Mar 2026 18:22:47 +0000 Subject: [PATCH 4/4] Fix double-zip artifact by uploading directory contents directly Co-authored-by: HakanL <407941+HakanL@users.noreply.github.com> --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index a305f44..8f30cfb 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -82,7 +82,7 @@ jobs: uses: actions/upload-artifact@v4 with: name: Seq.Client.WindowsLogins-${{ env.PACKAGE_VERSION }} - path: ${{ env.ZIP_NAME }} + path: Seq.Client.WindowsLogins/bin/Release/net462/ - name: Comment on PR with artifact link if: github.event_name == 'pull_request'