-
Notifications
You must be signed in to change notification settings - Fork 0
84 lines (82 loc) · 2.86 KB
/
scoop-build.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
name: "Build scoop"
on:
workflow_dispatch:
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
jobs:
test-install-with-scoop:
name: Test install app manifest with scoop
runs-on: windows-latest
steps:
- uses: actions/checkout@v4
- name: Get latest release version
id: get_latest_release
run: |
$release = gh release view --json tagName --jq ".tagName"
echo "Latest release version: $release"
echo "VERSION=$release" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh
- name: Debug version
run: |
echo "VERSION from environment: $env:VERSION"
shell: pwsh
- name: Download the latest release file
run: |
$version = "${{ env.VERSION }}"
$url = "https://github.com/sumoduduk/termusix/releases/download/$version/termusix-x86_64-windows.exe"
echo "Downloading file from: $url"
Invoke-WebRequest -Uri $url -OutFile "termusix-x86_64-windows.exe"
shell: pwsh
- name: Calculate SHA256
id: calculate_sha
run: |
$hash = Get-FileHash -Path "termusix-x86_64-windows.exe" -Algorithm SHA256
echo "SHA256: $($hash.Hash)"
echo "SHA256=$($hash.Hash)" | Out-File -FilePath $Env:GITHUB_ENV -Encoding utf8 -Append
shell: pwsh
- name: Write JSON file
run: |
$version = "${{ env.VERSION }}"
$hash = "${{ env.SHA256 }}"
$jsonContent = @"
{
"version" : "$version",
"homepage": "https://github.com/sumoduduk/termusix",
"description" : "A terminal-based music player with a user-friendly terminal UI, built with Rust",
"license": "GPL-3.0",
"architecture": {
"64bit": {
"url": "https://github.com/sumoduduk/termusix/releases/download/$version/termusix-x86_64-windows.exe#/termusix.exe",
"hash": "$hash"
}
},
"bin": "termusix.exe",
"checkver": "github",
"autoupdate": {
"architecture": {
"64bit": {
"url": "https://github.com/sumoduduk/termusix/releases/download/$version/termusix-x86_64-windows.exe#/termusix.exe"
}
}
}
}
"@
$jsonContent | Set-Content -Path "termusix.json"
shell: pwsh
- name: Install scoop
uses: MinoruSekine/setup-scoop@v4
- name: Install Termusix
run: |
scoop install termusix.json
shell: pwsh
- name: Check Termusix Path
run: |
$env:PATH
where termusix.exe
shell: pwsh
- name: Run Termusix with --help
run: |
termusix --version
termusix --help > output.txt
Get-Content -Path output.txt
shell: pwsh