mirror of
https://github.com/RedWizardsLab/EchoHub.git
synced 2026-09-04 08:36:11 +02:00
Merge pull request #32 from HueByte/dev
chore: update release workflow to include Chocolatey package publishing
This commit is contained in:
@@ -12,6 +12,10 @@ jobs:
|
|||||||
release:
|
release:
|
||||||
name: Create Release
|
name: Create Release
|
||||||
runs-on: ubuntu-latest
|
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:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@@ -158,21 +162,33 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
- name: Publish Chocolatey package
|
choco:
|
||||||
if: steps.changes.outputs.src_changed == 'true' && steps.check_release.outputs.exists == 'false'
|
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: |
|
run: |
|
||||||
VERSION="${{ steps.version.outputs.version }}"
|
$version = "${{ needs.release.outputs.version }}"
|
||||||
CHECKSUM=$(sha256sum EchoHub-Client-win-x64.zip | awk '{print $1}')
|
$checksum = (Get-FileHash EchoHub-Client-win-x64.zip -Algorithm SHA256).Hash.ToLower()
|
||||||
|
|
||||||
# Stamp version and checksum into package templates
|
# Stamp version and checksum into package templates
|
||||||
sed -i "s/__VERSION__/$VERSION/g" packaging/choco/echohub.nuspec
|
(Get-Content packaging/choco/echohub.nuspec) -replace '__VERSION__', $version | Set-Content packaging/choco/echohub.nuspec
|
||||||
sed -i "s/__VERSION__/$VERSION/g" packaging/choco/tools/chocolateyInstall.ps1
|
(Get-Content packaging/choco/tools/chocolateyInstall.ps1) -replace '__VERSION__', $version | Set-Content packaging/choco/tools/chocolateyInstall.ps1
|
||||||
sed -i "s/__CHECKSUM64__/$CHECKSUM/g" 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
|
cd packaging/choco
|
||||||
choco pack echohub.nuspec --output-directory /tmp/choco-out
|
choco pack echohub.nuspec --output-directory $env:TEMP
|
||||||
choco push /tmp/choco-out/echohub.*.nupkg --source https://push.chocolatey.org/ --api-key "$CHOCO_API_KEY"
|
$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:
|
env:
|
||||||
CHOCO_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}
|
CHOCO_API_KEY: ${{ secrets.CHOCOLATEY_API_KEY }}
|
||||||
|
|||||||
@@ -12,6 +12,8 @@ RUN dotnet restore EchoHub.Server/EchoHub.Server.csproj
|
|||||||
COPY EchoHub.Core/ EchoHub.Core/
|
COPY EchoHub.Core/ EchoHub.Core/
|
||||||
COPY EchoHub.Server.Irc/ EchoHub.Server.Irc/
|
COPY EchoHub.Server.Irc/ EchoHub.Server.Irc/
|
||||||
COPY EchoHub.Server/ EchoHub.Server/
|
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
|
RUN dotnet publish EchoHub.Server/EchoHub.Server.csproj -c Release -o /app/publish --no-restore
|
||||||
|
|
||||||
# Runtime
|
# Runtime
|
||||||
|
|||||||
Reference in New Issue
Block a user