-
Notifications
You must be signed in to change notification settings - Fork 528
78 lines (73 loc) · 2.66 KB
/
extra-package.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
name: extra-package
on:
workflow_dispatch:
inputs:
set-release-version:
description: 'Desired release version (x.y.z)'
required: true
type: string
push-to-chocolatey:
description: 'Push to chocolatey'
type: boolean
default: false
push-to-winget:
description: 'Push to winget'
type: boolean
default: false
concurrency: extra-package
jobs:
check-release:
env:
GH_TOKEN: ${{ github.token }}
RELEASE_VERSION: ${{ github.event.inputs.set-release-version }}
name: Check-release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/[email protected]
with:
fetch-depth: 1
ref: ${{ github.event.inputs.set-release-version }}
- name: Check if branch is a published release
run: |
if gh release list --exclude-drafts --exclude-pre-releases | grep -E "^${RELEASE_VERSION}" ; then
echo "✅ Desired release ${RELEASE_VERSION} is a published release"
else
echo "❌ You have to run this workflow for a published release (excluding draft and pre-release), but the desired one [${RELEASE_VERSION}] is not."
exit 1
fi
push-to-chocolatey:
if: github.event.inputs.push-to-chocolatey == 'true'
needs: check-release
env:
RELEASE_VERSION: ${{ github.event.inputs.set-release-version }}
CHOCOLATEY_TOKEN: ${{ secrets.LEPAPAREIL_CHOCOLATEY_TOKEN }}
name: Push to chocolatey
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/[email protected]
with:
fetch-depth: 1
ref: ${{ github.event.inputs.set-release-version }}
- name: Push to chocolatey
run: .\bin\release\push_package_to_chocolatey.ps1 $env:RELEASE_VERSION $env:CHOCOLATEY_TOKEN
push-to-winget:
if: github.event.inputs.push-to-winget == 'true'
needs: check-release
env:
RELEASE_VERSION: ${{ github.event.inputs.set-release-version }}
WINGET_TOKEN: ${{ secrets.LEPAPAREIL_WINGET_TOKEN }}
name: Push to winget
runs-on: windows-latest
steps:
- name: Checkout repository
uses: actions/[email protected]
with:
fetch-depth: 1
ref: ${{ github.event.inputs.set-release-version }}
- name: Push to winget
run: |
Invoke-WebRequest https://aka.ms/wingetcreate/latest -OutFile .\wingetcreate.exe
.\wingetcreate.exe version
.\bin\release\push_package_to_winget.ps1 "$env:RELEASE_VERSION" "$env:LEPAPAREIL_WINGET_TOKEN"