-
Notifications
You must be signed in to change notification settings - Fork 21
55 lines (51 loc) · 1.69 KB
/
publish-cli-winget.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
name: Publish to WinGet (CLI)
on:
workflow_dispatch:
inputs:
version:
type: string
description: The version to publish.
required: true
workflow_call:
inputs:
version:
type: string
description: The version to publish.
required: true
environment:
type: string
description: The environment to publish to.
secrets:
WINGET_PAT:
required: true
jobs:
sync-repo:
name: Sync winget-pkgs repo
runs-on: ubuntu-latest
environment: ${{ inputs.environment || 'winget-pkgs' }}
steps:
- run: gh repo sync anatawa12-bot/winget-pkgs -b master
env:
GH_TOKEN: ${{ secrets.WINGET_PAT }}
winget:
name: Publish winget package
needs: sync-repo
runs-on: windows-latest
environment: ${{ inputs.environment || 'winget-pkgs' }}
steps:
- name: Submit package to Windows Package Manager Community Repository
env:
WINGET_PAT: ${{ secrets.WINGET_PAT }}
CLI_VERSION: ${{ inputs.version }}
run: |
# Update package using wingetcreate
Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
# Update package
# the pwsh uses ` for escape character
.\wingetcreate.exe update "anatawa12.vrc-get" `
--version "$env:CLI_VERSION" `
--urls `
"https://github.com/vrc-get/vrc-get/releases/download/v$env:CLI_VERSION/aarch64-pc-windows-msvc-vrc-get.exe" `
"https://github.com/vrc-get/vrc-get/releases/download/v$env:CLI_VERSION/x86_64-pc-windows-msvc-vrc-get.exe" `
--submit `
--token "$env:WINGET_PAT"