From 1b6c27247fec319f1c319c0ca248f9aa96ab3853 Mon Sep 17 00:00:00 2001 From: HueByte Date: Tue, 24 Feb 2026 22:12:26 +0100 Subject: [PATCH] chore: update release workflow to include Chocolatey package publishing --- .github/workflows/release.yml | 38 +++++++++++++++++++++++++---------- src/EchoHub.Server/Dockerfile | 2 ++ 2 files changed, 29 insertions(+), 11 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 618917d..2ad99d8 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,6 +12,10 @@ jobs: release: name: Create Release runs-on: ubuntu-latest + outputs: + should_release: ${{ steps.changes.outputs.src_changed == 'true' && steps.check_release.outputs.exists == 'false' }} + version: ${{ steps.version.outputs.version }} + tag: ${{ steps.version.outputs.tag }} steps: - uses: actions/checkout@v4 with: @@ -158,21 +162,33 @@ jobs: env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Publish Chocolatey package - if: steps.changes.outputs.src_changed == 'true' && steps.check_release.outputs.exists == 'false' + choco: + name: Publish to Chocolatey + needs: release + if: needs.release.outputs.should_release == 'true' + runs-on: windows-latest + steps: + - uses: actions/checkout@v4 + + - name: Download release asset + run: gh release download "v${{ needs.release.outputs.version }}" --pattern "EchoHub-Client-win-x64.zip" + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Pack and push + shell: pwsh run: | - VERSION="${{ steps.version.outputs.version }}" - CHECKSUM=$(sha256sum EchoHub-Client-win-x64.zip | awk '{print $1}') + $version = "${{ needs.release.outputs.version }}" + $checksum = (Get-FileHash EchoHub-Client-win-x64.zip -Algorithm SHA256).Hash.ToLower() # Stamp version and checksum into package templates - sed -i "s/__VERSION__/$VERSION/g" packaging/choco/echohub.nuspec - sed -i "s/__VERSION__/$VERSION/g" packaging/choco/tools/chocolateyInstall.ps1 - sed -i "s/__CHECKSUM64__/$CHECKSUM/g" packaging/choco/tools/chocolateyInstall.ps1 + (Get-Content packaging/choco/echohub.nuspec) -replace '__VERSION__', $version | Set-Content packaging/choco/echohub.nuspec + (Get-Content packaging/choco/tools/chocolateyInstall.ps1) -replace '__VERSION__', $version | Set-Content packaging/choco/tools/chocolateyInstall.ps1 + (Get-Content packaging/choco/tools/chocolateyInstall.ps1) -replace '__CHECKSUM64__', $checksum | Set-Content packaging/choco/tools/chocolateyInstall.ps1 - # Build and push the package - mkdir -p /tmp/choco-out cd packaging/choco - choco pack echohub.nuspec --output-directory /tmp/choco-out - choco push /tmp/choco-out/echohub.*.nupkg --source https://push.chocolatey.org/ --api-key "$CHOCO_API_KEY" + choco pack echohub.nuspec --output-directory $env:TEMP + $pkg = Get-ChildItem "$env:TEMP\echohub.*.nupkg" | Select-Object -First 1 + choco push $pkg.FullName --source https://push.chocolatey.org/ --api-key $env:CHOCO_API_KEY env: CHOCO_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }} diff --git a/src/EchoHub.Server/Dockerfile b/src/EchoHub.Server/Dockerfile index c4b94a9..7fc44c8 100644 --- a/src/EchoHub.Server/Dockerfile +++ b/src/EchoHub.Server/Dockerfile @@ -12,6 +12,8 @@ RUN dotnet restore EchoHub.Server/EchoHub.Server.csproj COPY EchoHub.Core/ EchoHub.Core/ COPY EchoHub.Server.Irc/ EchoHub.Server.Irc/ COPY EchoHub.Server/ EchoHub.Server/ +# Icon referenced by Server.csproj ApplicationIcon +COPY EchoHub.Client/Assets/hue_icon.ico EchoHub.Client/Assets/hue_icon.ico RUN dotnet publish EchoHub.Server/EchoHub.Server.csproj -c Release -o /app/publish --no-restore # Runtime