Skip to content

Build scoop

Build scoop #12

Workflow file for this run

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 --version
run: termusix --version
shell: pwsh
- name:
uses: actions/upload-artifact@v4
with:
name: scoop-manifest
path: termusix.json