-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
150 lines (150 loc) · 9.28 KB
/
action.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
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
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
name: 'Winget Push Test'
description: 'Push packages to a test winget repository using Github workflow instead of pushing to the main winget repository via workflow'
inputs:
url:
description: 'Package url'
urlarm:
description: 'Package url (arm)'
url32:
description: 'Package url (32-bit)'
url64:
description: 'Package url (64-bit)'
urlarmhf:
description: 'Package url (armhf)'
urlarm64:
description: 'Package url (arm64)'
version:
description: 'Version of your winget package. Recommended to not keep any letter behind version number'
required: true
token:
description: 'Personal access token (auto-populated) to submit package to winget repo'
required: true
packageid:
description: 'Package ID of your winget package'
required: true
user:
description: 'Github username where the test winget repo is created'
required: true
default: microsoft
repo:
description: 'Name of winget test repository'
required: true
default: winget-pkgs
forcearch:
description: 'Force the submitting architecture for the given package URLs'
default: false
runs:
using: "composite"
steps:
- if: ${{ inputs.url != '' && inputs.urlarm == '' && inputs.url64 == '' && inputs.urlarm64 == '' && inputs.forcearch == 'false' }}
run: |
$url="${{ inputs.url }}"
$version="${{ inputs.version }}"
wget https://github.com/microsoft/winget-create/releases/latest/download/wingetcreate-self-contained.exe -O wingetcreate-self-contained.exe
./wingetcreate-self-contained.exe settings
$pathToJson = "$env:LOCALAPPDATA\Microsoft\WindowsPackageManagerManifestCreator\settings.json"
$pathTest = Get-Content $pathToJson | ConvertFrom-Json
$pathTest.WindowsPackageManagerRepository.owner = "${{ inputs.user }}"
$pathTest.WindowsPackageManagerRepository.name = "${{ inputs.repo }}"
$pathTest | ConvertTo-Json | set-content $pathToJson
Copy-Item -Path $env:LOCALAPPDATA\Microsoft\WindowsPackageManagerManifestCreator\settings.json -Destination C:\settings.json -PassThru
./wingetcreate-self-contained.exe update -u "$url" -v $version -t "${{ inputs.token }}" -s "${{ inputs.packageid }}"
shell: powershell
- if: ${{ inputs.url != '' && inputs.urlarm != '' && inputs.url64 == '' && inputs.urlarm64 == '' && inputs.forcearch == 'false' }}
run: |
$url="${{ inputs.url }}"
$urlarm="${{ inputs.urlarm }}"
$version="${{ inputs.version }}"
wget https://github.com/microsoft/winget-create/releases/latest/download/wingetcreate-self-contained.exe -O wingetcreate-self-contained.exe
./wingetcreate-self-contained.exe settings
$pathToJson = "$env:LOCALAPPDATA\Microsoft\WindowsPackageManagerManifestCreator\settings.json"
$pathTest = Get-Content $pathToJson | ConvertFrom-Json
$pathTest.WindowsPackageManagerRepository.owner = "${{ inputs.user }}"
$pathTest.WindowsPackageManagerRepository.name = "${{ inputs.repo }}"
$pathTest | ConvertTo-Json | set-content $pathToJson
Copy-Item -Path $env:LOCALAPPDATA\Microsoft\WindowsPackageManagerManifestCreator\settings.json -Destination C:\settings.json -PassThru
./wingetcreate-self-contained.exe update -u "$url" "$urlarm" -v $version -t "${{ inputs.token }}" -s "${{ inputs.packageid }}"
shell: powershell
- if: ${{ inputs.url == '' && inputs.urlarm == '' && inputs.url64 != '' && inputs.urlarm64 == '' && inputs.forcearch == 'false' }}
run: |
$url32="${{ inputs.url32 }}"
$url64="${{ inputs.url64 }}"
$version="${{ inputs.version }}"
wget https://github.com/microsoft/winget-create/releases/latest/download/wingetcreate-self-contained.exe -O wingetcreate-self-contained.exe
./wingetcreate-self-contained.exe settings
$pathToJson = "$env:LOCALAPPDATA\Microsoft\WindowsPackageManagerManifestCreator\settings.json"
$pathTest = Get-Content $pathToJson | ConvertFrom-Json
$pathTest.WindowsPackageManagerRepository.owner = "${{ inputs.user }}"
$pathTest.WindowsPackageManagerRepository.name = "${{ inputs.repo }}"
$pathTest | ConvertTo-Json | set-content $pathToJson
Copy-Item -Path $env:LOCALAPPDATA\Microsoft\WindowsPackageManagerManifestCreator\settings.json -Destination C:\settings.json -PassThru
./wingetcreate-self-contained.exe update -u "$url32" "$url64" -v $version -t "${{ inputs.token }}" -s "${{ inputs.packageid }}"
shell: powershell
- if: ${{ inputs.url == '' && inputs.urlarm != '' && inputs.url64 != '' && inputs.urlarm64 == '' && inputs.forcearch == 'false' }}
run: |
$url32="${{ inputs.url32 }}"
$url64="${{ inputs.url64 }}"
$urlarm="${{ inputs.urlarm }}"
$version="${{ inputs.version }}"
wget https://github.com/microsoft/winget-create/releases/latest/download/wingetcreate-self-contained.exe -O wingetcreate-self-contained.exe
./wingetcreate-self-contained.exe settings
$pathToJson = "$env:LOCALAPPDATA\Microsoft\WindowsPackageManagerManifestCreator\settings.json"
$pathTest = Get-Content $pathToJson | ConvertFrom-Json
$pathTest.WindowsPackageManagerRepository.owner = "${{ inputs.user }}"
$pathTest.WindowsPackageManagerRepository.name = "${{ inputs.repo }}"
$pathTest | ConvertTo-Json | set-content $pathToJson
Copy-Item -Path $env:LOCALAPPDATA\Microsoft\WindowsPackageManagerManifestCreator\settings.json -Destination C:\settings.json -PassThru
./wingetcreate-self-contained.exe update -u "$url32" "$url64" "$urlarm" -v $version -t "${{ inputs.token }}" -s "${{ inputs.packageid }}"
shell: powershell
- if: ${{ inputs.url == '' && inputs.urlarm == '' && inputs.url64 != '' && inputs.urlarm64 != '' && inputs.forcearch == 'false' }}
run: |
$url32="${{ inputs.url32 }}"
$url64="${{ inputs.url64 }}"
$urlarmhf="${{ inputs.urlarmhf }}"
$urlarm64="${{ inputs.urlarm64 }}"
$version="${{ inputs.version }}"
wget https://github.com/microsoft/winget-create/releases/latest/download/wingetcreate-self-contained.exe -O wingetcreate-self-contained.exe
./wingetcreate-self-contained.exe settings
$pathToJson = "$env:LOCALAPPDATA\Microsoft\WindowsPackageManagerManifestCreator\settings.json"
$pathTest = Get-Content $pathToJson | ConvertFrom-Json
$pathTest.WindowsPackageManagerRepository.owner = "${{ inputs.user }}"
$pathTest.WindowsPackageManagerRepository.name = "${{ inputs.repo }}"
$pathTest | ConvertTo-Json | set-content $pathToJson
Copy-Item -Path $env:LOCALAPPDATA\Microsoft\WindowsPackageManagerManifestCreator\settings.json -Destination C:\settings.json -PassThru
./wingetcreate-self-contained.exe update -u "$url32" "$url64" "$urlarmhf" "$urlarm64" -v $version -t "${{ inputs.token }}" -s "${{ inputs.packageid }}"
shell: powershell
- if: ${{ inputs.url == '' && inputs.urlarm == '' && inputs.url64 != '' && inputs.urlarm64 == '' && inputs.forcearch == 'true' }}
run: |
$url32="${{ inputs.url32 }}"
$url64="${{ inputs.url64 }}"
$version="${{ inputs.version }}"
wget https://github.com/microsoft/winget-create/releases/latest/download/wingetcreate-self-contained.exe -O wingetcreate-self-contained.exe
./wingetcreate-self-contained.exe settings
$pathToJson = "$env:LOCALAPPDATA\Microsoft\WindowsPackageManagerManifestCreator\settings.json"
$pathTest = Get-Content $pathToJson | ConvertFrom-Json
$pathTest.WindowsPackageManagerRepository.owner = "${{ inputs.user }}"
$pathTest.WindowsPackageManagerRepository.name = "${{ inputs.repo }}"
$pathTest | ConvertTo-Json | set-content $pathToJson
Copy-Item -Path $env:LOCALAPPDATA\Microsoft\WindowsPackageManagerManifestCreator\settings.json -Destination C:\settings.json -PassThru
./wingetcreate-self-contained.exe update -u "$url32|x86" "$url64|x64" -v $version -t "${{ inputs.token }}" -s "${{ inputs.packageid }}"
shell: powershell
- if: ${{ inputs.url == '' && inputs.urlarm == '' && inputs.url64 != '' && inputs.urlarm64 != '' && inputs.forcearch == 'true' }}
run: |
$url32="${{ inputs.url32 }}"
$url64="${{ inputs.url64 }}"
$urlarmhf="${{ inputs.urlarmhf }}"
$urlarm64="${{ inputs.urlarm64 }}"
$version="${{ inputs.version }}"
wget https://github.com/microsoft/winget-create/releases/latest/download/wingetcreate-self-contained.exe -O wingetcreate-self-contained.exe
./wingetcreate-self-contained.exe settings
$pathToJson = "$env:LOCALAPPDATA\Microsoft\WindowsPackageManagerManifestCreator\settings.json"
$pathTest = Get-Content $pathToJson | ConvertFrom-Json
$pathTest.WindowsPackageManagerRepository.owner = "${{ inputs.user }}"
$pathTest.WindowsPackageManagerRepository.name = "${{ inputs.repo }}"
$pathTest | ConvertTo-Json | set-content $pathToJson
Copy-Item -Path $env:LOCALAPPDATA\Microsoft\WindowsPackageManagerManifestCreator\settings.json -Destination C:\settings.json -PassThru
./wingetcreate-self-contained.exe update -u "$url32|x86" "$url64|x64" "$urlarmhf|arm" "$urlarm64|arm64" -v $version -t "${{ inputs.token }}" -s "${{ inputs.packageid }}"
shell: powershell
branding:
icon: 'log-in'
color: 'orange'