-
-
Notifications
You must be signed in to change notification settings - Fork 105
97 lines (84 loc) · 3.3 KB
/
package-publish.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
name: Winget and Nuget package publish
on:
release:
types: [released]
env:
WINGET_PACKAGE_NAME: .+win-x64.+\.msi
WINGET_PACKAGE_ID: PTRTECH.UVtools
WINGET_TOKEN: ${{ secrets.WINGET_TOKEN }}
HOMEBREW_GITHUB_API_TOKEN: ${{ secrets.PUBLIC_ACCESS_TOKEN }}
NUGET_TOKEN: ${{ secrets.NUGET_TOKEN }}
jobs:
winget:
name: 🚀 Winget - Pull request
runs-on: windows-latest
steps:
- uses: vedantmgoyal2009/winget-releaser@v2
with:
identifier: ${{ env.WINGET_PACKAGE_ID }}
token: ${{ env.WINGET_TOKEN }}
# Manual way
#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
#homebrew:
# name: 🚀 Homebrew Cask - Pull request
# runs-on: macos-latest
# steps:
# - uses: macauley/action-homebrew-bump-cask@v1
# with:
# token: ${{ env.WINGET_TOKEN }}
# cask: uvtools
nuget:
name: 📦 Nuget - Publish package
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: 🛒 Checkout
uses: actions/checkout@v4
- name: Verify commit exists in origin/master
run: |
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
git branch --remote --contains | grep origin/master
- name: 🟣 Setup .NET 7.0
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
#- name: Set VERSION variable from tag
# run: |
# TAG=${{ github.event.release.tag_name }}
# echo "VERSION=${TAG#v}" >> $GITHUB_ENV
- name: 📦 Pack
run: |
dotnet pack UVtools.Core --configuration Release --output .
dotnet pack UVtools.AvaloniaControls --configuration Release --output .
- name: 🚀 Push nuget.org
run: dotnet nuget push UVtools*.nupkg --source https://api.nuget.org/v3/index.json --api-key ${NUGET_TOKEN} --skip-duplicate