зеркало из https://github.com/microsoft/git.git
Adding winget workflows
This commit is contained in:
Родитель
45d9255492
Коммит
be87d8c067
|
@ -0,0 +1,40 @@
|
||||||
|
name: "release-winget"
|
||||||
|
on:
|
||||||
|
release:
|
||||||
|
types: [released]
|
||||||
|
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
release:
|
||||||
|
description: 'Release Id'
|
||||||
|
required: true
|
||||||
|
default: 'latest'
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
release:
|
||||||
|
runs-on: windows-latest
|
||||||
|
steps:
|
||||||
|
- name: Publish manifest with winget-create
|
||||||
|
run: |
|
||||||
|
# Get correct release asset
|
||||||
|
$github = Get-Content '${{ github.event_path }}' | ConvertFrom-Json
|
||||||
|
$asset = $github.release.assets | Where-Object -Property name -match '64-bit.exe$'
|
||||||
|
|
||||||
|
# Remove 'v' and 'vfs' from the version
|
||||||
|
$github.release.tag_name -match '\d.*'
|
||||||
|
$version = $Matches[0] -replace ".vfs",""
|
||||||
|
|
||||||
|
# Download wingetcreate and create manifests
|
||||||
|
Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
|
||||||
|
.\wingetcreate.exe update Microsoft.Git -u $asset.browser_download_url -v $version -o manifests
|
||||||
|
|
||||||
|
# Manually substitute the name of the default branch in the License
|
||||||
|
# and Copyright URLs since the tooling cannot do that for us.
|
||||||
|
$shortenedVersion = $version -replace ".{4}$"
|
||||||
|
$manifestPath = dir -Path ./manifests -Filter Microsoft.Git.locale.en-US.yaml -Recurse | %{$_.FullName}
|
||||||
|
sed -i "s/vfs-[.0-9]*/vfs-$shortenedVersion/g" "$manifestPath"
|
||||||
|
|
||||||
|
# Submit manifests
|
||||||
|
$manifestDirectory = Split-Path "$manifestPath"
|
||||||
|
.\wingetcreate.exe submit -t "${{ secrets.WINGET_TOKEN }}" $manifestDirectory
|
||||||
|
shell: powershell
|
Загрузка…
Ссылка в новой задаче