forked from isaacrlevin/winget-publish-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yaml
82 lines (79 loc) · 3.03 KB
/
action.yaml
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: 'Winget Publish'
description: 'Publish Package to Winget using Winget Create'
inputs:
token:
description: 'GitHub PAT'
required: true
default: ''
publish-type:
description: 'Create or Update'
required: true
default: 'Create'
user:
description: 'User Submitting Package'
required: true
default: 'user'
package:
description: 'Name of Package being submitted'
required: true
default: 'package'
version:
description: 'Semantic Version of Package'
required: true
default: '0.0.0'
url:
description: 'Url of Installer'
required: true
default: ''
arch:
description: 'Architecture of Installer (x86, x64, arm, arm64)'
required: false
default: ''
installer-type:
description: 'Installer Type (The Windows Package Manager supports MSIX, MSI, and executable installers. Some well known formats (Inno, Nullsoft, WiX, and Burn) provide standard sets of installer switches to provide different installer experiences.)'
required: false
default: ''
publisher:
description: 'Name of the publisher for a given package'
required: false
default: ''
package-name:
description: 'The full package name to be displayed as the publisher or ISV wishes'
required: false
default: ''
license:
description: 'The license governing the use and or distribution for the product'
required: false
default: ''
short-description:
description: 'The description for a package. This will apprear with winget show commands'
required: false
default: ''
family-name:
description: 'Optional MSIX package family name'
required: false
default: ''
runs:
using: "composite"
steps:
- run: |
echo GitHub Actions Runner needs to be Windows
exit 1
if: ${{ (runner.os == 'macOS') || (runner.os == 'Linux') }}
shell: bash
- run: |
echo Publish Type Specified not Create or Update
exit 1
if: ${{ (inputs.publish-type != 'Create') && (inputs.publish-type != 'Update') }}
shell: bash
- name: Use WingetCreate Update to update existing manigest
if: ${{ inputs.publish-type == 'Update' }}
run: |
Invoke-WebRequest -Uri https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
.\wingetcreate.exe update ${{ inputs.user }}.${{ inputs.package }} -u "${{ inputs.url }}" -v "${{ inputs.version }}" -t ${{ inputs.token }} -s
shell: pwsh
- name: Populate Winget manifest files and use WingetCreate Submit to submit manifest
run: |
${{ github.action_path }}\build.ps1 -Token ${{ inputs.token }} -User "${{ inputs.user }}" -Package "${{ inputs.package }}" -Url "${{ inputs.url }}" -ShortDescription "${{ inputs.short-description }}" -FamilyName "${{ inputs.family-name }}" -Version ${{ inputs.version }} -Arch "${{ inputs.arch }}" -InstallerType "${{ inputs.installer-type }}" -Publisher "${{ inputs.publisher }}" -PackageName "${{ inputs.package-name }}" -License "${{ inputs.license }}"
if: ${{ inputs.publish-type == 'Create' }}
shell: pwsh