mirror of
https://github.com/Suwayomi/Suwayomi-Server.git
synced 2026-07-07 04:44:35 -05:00
Improve winget action (#2164)
This commit is contained in:
37
.github/workflows/winget.yml
vendored
37
.github/workflows/winget.yml
vendored
@@ -1,19 +1,52 @@
|
|||||||
name: Publish to WinGet
|
name: Publish to WinGet
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
version:
|
version:
|
||||||
description: Version
|
description: Version
|
||||||
required: false
|
required: false
|
||||||
|
type: string
|
||||||
|
release:
|
||||||
|
types: [published]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
publish:
|
publish:
|
||||||
runs-on: windows-latest # action can only be run on windows
|
runs-on: windows-latest # action can only be run on windows
|
||||||
steps:
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Determine version
|
||||||
|
id: version
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
if [ -n "${{ inputs.version }}" ]; then
|
||||||
|
VERSION="${{ inputs.version }}"
|
||||||
|
elif [ "${{ github.event_name }}" = "release" ]; then
|
||||||
|
VERSION="${{ github.event.release.tag_name }}"
|
||||||
|
else
|
||||||
|
VERSION="$(gh release view --json tagName -q .tagName)"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
|
||||||
|
|
||||||
|
- name: Sync winget-pkgs fork with upstream
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
GH_TOKEN: ${{ secrets.WINGET_PUBLISH_PAT }}
|
||||||
|
run: |
|
||||||
|
gh api \
|
||||||
|
--method POST \
|
||||||
|
-H "Accept: application/vnd.github+json" \
|
||||||
|
"/repos/Suwayomi/winget-pkgs/merge-upstream" \
|
||||||
|
-f branch=master
|
||||||
|
|
||||||
- uses: vedantmgoyal2009/winget-releaser@v2
|
- uses: vedantmgoyal2009/winget-releaser@v2
|
||||||
with:
|
with:
|
||||||
identifier: Suwayomi.Suwayomi-Server
|
identifier: Suwayomi.Suwayomi-Server
|
||||||
installers-regex: '.*x64.msi$'
|
installers-regex: '.*x64.msi$'
|
||||||
token: ${{ secrets.WINGET_PUBLISH_PAT }}
|
token: ${{ secrets.WINGET_PUBLISH_PAT }}
|
||||||
version: ${{ inputs.version || github.ref_name }}
|
version: ${{ steps.version.outputs.version }}
|
||||||
release-tag: ${{ inputs.version || github.ref_name }}
|
release-tag: ${{ steps.version.outputs.version }}
|
||||||
Reference in New Issue
Block a user