Skip to content

Commit

Permalink
Update package-publish.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
sn4k3 committed Jul 5, 2023
1 parent ad2c5bd commit 78cac75
Showing 1 changed file with 37 additions and 28 deletions.
65 changes: 37 additions & 28 deletions .github/workflows/package-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Winget and Nuget package publish

on:
release:
types: [published]
types: [released]

env:
WINGET_PACKAGE_NAME: .+win-x64.+\.msi
Expand All @@ -16,34 +16,43 @@ jobs:
winget:
name: Winget - Pull request
runs-on: windows-latest
timeout-minutes: 10
steps:
- name: Download WingetCreate.exe
run: iwr -Uri https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
- name: Set VERSION variable from tag
run: |
$github = Get-Content '${{ github.event_path }}' | ConvertFrom-Json
$version = $github.release.tag_name.Trim('v')
if($version.Length -lt 5)
{
Write-Error "Version $version is too short!"
exit -1
}
Write-Output "Version: ${version}"
"VERSION=${version}" >> $env:GITHUB_ENV
- name: Set INSTALLER_URL variable from release asset
run: |
$github = Get-Content '${{ github.event_path }}' | ConvertFrom-Json
$installerUrl = $github.release.assets | Where-Object -Property name -match "${env:WINGET_PACKAGE_NAME}" | Select -ExpandProperty browser_download_url -First 1
if($null -eq $installerUrl)
{
Write-Error "Installer URL not found on ${github.release.assets}"
exit -1
}
Write-Output "Installer url: ${installerUrl}"
"INSTALLER_URL=${installerUrl}" >> $env:GITHUB_ENV
- name: Submit package to Windows Package Manager Community Repository
run: .\wingetcreate.exe update ${env:WINGET_PACKAGE_ID} --version ${env:VERSION} --urls ${env:INSTALLER_URL} --token ${env:WINGET_TOKEN} --submit
- uses: vedantmgoyal2009/winget-releaser@v2
with:
identifier: ${env:WINGET_PACKAGE_ID}
token: ${env:WINGET_TOKEN}

#winget:
# name: Winget - Pull request
# runs-on: windows-latest
# timeout-minutes: 10
# steps:
# - name: Download WingetCreate.exe
# run: iwr -Uri https://aka.ms/wingetcreate/latest -OutFile wingetcreate.exe
# - name: Set VERSION variable from tag
# run: |
# $github = Get-Content '${{ github.event_path }}' | ConvertFrom-Json
# $version = $github.release.tag_name.Trim('v')
# if($version.Length -lt 5)
# {
# Write-Error "Version $version is too short!"
# exit -1
# }
# Write-Output "Version: ${version}"
# "VERSION=${version}" >> $env:GITHUB_ENV
# - name: Set INSTALLER_URL variable from release asset
# run: |
# $github = Get-Content '${{ github.event_path }}' | ConvertFrom-Json
# $installerUrl = $github.release.assets | Where-Object -Property name -match "${env:WINGET_PACKAGE_NAME}" | Select -ExpandProperty browser_download_url -First 1
# if($null -eq $installerUrl)
# {
# Write-Error "Installer URL not found on ${github.release.assets}"
# exit -1
# }
# Write-Output "Installer url: ${installerUrl}"
# "INSTALLER_URL=${installerUrl}" >> $env:GITHUB_ENV
# - name: Submit package to Windows Package Manager Community Repository
# run: .\wingetcreate.exe update ${env:WINGET_PACKAGE_ID} --version ${env:VERSION} --urls ${env:INSTALLER_URL} --token ${env:WINGET_TOKEN} --submit

# NOT WORKING
#homebrew:
Expand Down

0 comments on commit 78cac75

Please sign in to comment.