From f226358b1c6c7fda434162c6a5a0568665985b1d Mon Sep 17 00:00:00 2001 From: objz Date: Mon, 27 Apr 2026 14:52:01 +0200 Subject: [PATCH] ci: include winget manifest in releases --- .github/workflows/publish-winget.yml | 14 +++++++++++++- .github/workflows/release.yml | 5 ++++- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/publish-winget.yml b/.github/workflows/publish-winget.yml index c9f736e..41e93b0 100644 --- a/.github/workflows/publish-winget.yml +++ b/.github/workflows/publish-winget.yml @@ -8,7 +8,7 @@ on: type: string permissions: - contents: read + contents: write jobs: publish: @@ -26,6 +26,7 @@ jobs: $version = $plan.releases[0].app_version $identifier = 'Objz.MclLauncher' $packagePath = "manifests/o/Objz/MclLauncher/$version" + $assetPath = "winget-manifest-$version.zip" $installerFile = 'mcl-launcher-x86_64-pc-windows-msvc.msi' $checksumFile = "$installerFile.sha256" $installerUrl = "https://github.com/objz/mcl/releases/download/$tag/$installerFile" @@ -94,8 +95,19 @@ jobs: $localeManifest | Set-Content -Path "$packagePath/$identifier.locale.en-US.yaml" -Encoding utf8 Remove-Item "$packagePath/$checksumFile" + Compress-Archive -Path manifests -DestinationPath $assetPath -Force "path=$packagePath" >> $env:GITHUB_OUTPUT + "asset=$assetPath" >> $env:GITHUB_OUTPUT + + - name: upload WinGet manifest to GitHub Release + shell: pwsh + env: + GH_TOKEN: ${{ github.token }} + PLAN: ${{ inputs.plan }} + run: | + $plan = $env:PLAN | ConvertFrom-Json + gh release upload "$($plan.announcement_tag)" "${{ steps.manifest.outputs.asset }}" --clobber - name: submit WinGet manifest shell: pwsh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6c34abe..71c387a 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -288,6 +288,7 @@ jobs: RELEASE_COMMIT: "${{ github.sha }}" CHANGELOG: "${{ steps.changelog.outputs.content }}" RELEASE_TAG: "${{ needs.plan.outputs.tag }}" + APP_VERSION: "${{ fromJson(steps.host.outputs.manifest).releases[0].app_version }}" run: | echo "$CHANGELOG" > $RUNNER_TEMP/notes.txt cat >> $RUNNER_TEMP/notes.txt <