-
-
Notifications
You must be signed in to change notification settings - Fork 94
46 lines (43 loc) · 1.78 KB
/
chocolatey-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
name: Chocolatey Deploy
on:
release:
types: [published]
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
chocolatey:
name: Deploy
runs-on: windows-latest
if: github.repository == 'rcmaehl/MSEdgeRedirect'
steps:
- name: Clone Repository
uses: actions/checkout@v4
- uses: oprypin/find-latest-tag@v1
with:
repository: ${{ github.repository }} # The repository to scan.
releases-only: true # We know that all relevant tags have a GitHub release for them.
id: latesttag
- name: Set Checksum
run: |
filename="MSEdgeRedirect.exe"
url="https://github.com/${{ github.repository }}/releases/download/${{ steps.latesttag.outputs.tag }}/${filename}"
sed -i "s#{URL64}#${url}#g" "Assets/Choco/MSEdgeRedirect/tools/chocolateyinstall.ps1"
curl -sSL "${url}" -o "Assets/Choco/${filename}"
sha256=$(cat "Assets/Choco/${filename}" | sha256sum -)
sed -i "s/{SHA256CHECKSUM64}/${sha256:0:64}/g" "Assets/Choco/MSEdgeRedirect/tools/chocolateyinstall.ps1"
- name: Set Version
id: version
run: |
version=${{ steps.latesttag.outputs.tag }}
echo "nuget=$version" >> $GITHUB_OUTPUT
sed -i "s/{VERSION}/${version}/g" "Assets/Choco/MSEdgeRedirect/msedgeredirect.nuspec"
- name: Pack Release
uses: crazy-max/ghaction-chocolatey@v3
with:
args: pack Assets/Choco/MSEdgeRedirect/msedgeredirect.nuspec --outputdirectory Assets/Choco/MSEdgeRedirect
- name: Upload Release
uses: crazy-max/ghaction-chocolatey@v3
with:
args: push Assets/Choco/MSEdgeRedirect/msedgeredirect.${{ steps.version.outputs.nuget }}.nupkg -s https://push.chocolatey.org/ -k ${{ secrets.CHOCO_KEY }}