windows-iso-downloader/.github/workflows/cli-release.yml
Shekhar Vaidya 5eec0351e7 feat: add curl | bash installer for Linux/macOS without Homebrew
Adds a GET /install.sh endpoint on the backend (embedded via Go's
embed package, so the script stays a real, shellcheck-able .sh file
rather than a Go string literal). Auto-detects OS/arch (including
Termux on Android via $PREFIX) and always resolves the latest GitHub
release via the /releases/latest/download/ redirect, so unlike the
winget/brew/AUR manifests it needs no per-release maintenance.

Verified end-to-end in an ephemeral Ubuntu container (both the normal
/usr/local/bin path and the Termux $PREFIX path), and locally against
a running backend instance.

Documented alongside the existing winget/Homebrew instructions in
README.md, the release notes template, the web CLI page, and the
per-product CliHandoff card.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-13 22:28:23 +05:30

126 lines
5 KiB
YAML

name: CLI Release
on:
push:
tags:
- 'cli/v*'
jobs:
release:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-go@v5
with:
go-version: '1.21'
- name: Build binaries
working-directory: cli
run: |
VERSION="${{ github.ref_name }}"
VERSION="${VERSION#cli/v}"
mkdir -p ../dist
GOOS=linux GOARCH=amd64 go build -ldflags="-s -w -X main.Version=${VERSION}" -o ../dist/msdl-linux-amd64 .
GOOS=linux GOARCH=arm64 go build -ldflags="-s -w -X main.Version=${VERSION}" -o ../dist/msdl-linux-arm64 .
GOOS=darwin GOARCH=amd64 go build -ldflags="-s -w -X main.Version=${VERSION}" -o ../dist/msdl-darwin-amd64 .
GOOS=darwin GOARCH=arm64 go build -ldflags="-s -w -X main.Version=${VERSION}" -o ../dist/msdl-darwin-arm64 .
GOOS=windows GOARCH=amd64 go build -ldflags="-s -w -X main.Version=${VERSION}" -o ../dist/msdl-windows-amd64.exe .
- name: Generate changelog
id: changelog
run: |
PREV_TAG=$(git tag --sort=-version:refname | grep 'cli/v' | sed -n '2p')
if [ -n "$PREV_TAG" ]; then
CHANGELOG=$(git log --pretty=format:"- %s" "$PREV_TAG".."${{ github.ref_name }}" -- cli/ backend/ frontend/ .github/workflows/cli-release.yml | grep -v '^- chore(winget)' | grep -v '^- chore(release): bump' | head -30)
if [ -z "$CHANGELOG" ]; then
CHANGELOG="- Maintenance release (see commit history for details)"
fi
else
CHANGELOG="- Initial release"
fi
echo "changelog<<EOF" >> $GITHUB_OUTPUT
echo "$CHANGELOG" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ github.ref_name }}
name: "msdl CLI ${{ github.ref_name }}"
files: dist/*
body: |
## What's New
${{ steps.changelog.outputs.changelog }}
## Install
**Windows (winget):**
```
winget install starkSV.msdl
```
**Windows (direct download):** Download `msdl-windows-amd64.exe` below, rename to `msdl.exe`, place in a folder on your PATH.
**macOS/Linux (Homebrew):**
```bash
brew tap starkSV/msdl
brew install msdl
```
**macOS/Linux (no Homebrew):**
```bash
curl -fsSL https://api.msdl.tech-latest.com/install.sh | bash
```
Auto-detects OS/arch (including Termux on Android) and installs the latest release.
**Linux/macOS (direct download):**
```bash
# Linux x86_64
curl -L https://github.com/starkSV/windows-iso-downloader/releases/download/${{ github.ref_name }}/msdl-linux-amd64 -o msdl
chmod +x msdl && sudo mv msdl /usr/local/bin/
# Linux ARM64 (also works in Termux on Android)
curl -L https://github.com/starkSV/windows-iso-downloader/releases/download/${{ github.ref_name }}/msdl-linux-arm64 -o msdl
chmod +x msdl && mv msdl $PREFIX/bin/ 2>/dev/null || sudo mv msdl /usr/local/bin/
# macOS Apple Silicon
curl -L https://github.com/starkSV/windows-iso-downloader/releases/download/${{ github.ref_name }}/msdl-darwin-arm64 -o msdl
chmod +x msdl && sudo mv msdl /usr/local/bin/
# macOS Intel
curl -L https://github.com/starkSV/windows-iso-downloader/releases/download/${{ github.ref_name }}/msdl-darwin-amd64 -o msdl
chmod +x msdl && sudo mv msdl /usr/local/bin/
```
## Usage
```
msdl # fully interactive (includes Server/Enterprise)
msdl "windows 11 25h2" # filter products, pick language
msdl --id 3262 --lang "English" # direct, no prompts
msdl --eval server-2025 # evaluation ISOs directly
msdl --list # list all products
```
- name: Submit winget update
if: success()
env:
WINGET_TOKEN: ${{ secrets.WINGET_TOKEN }}
run: |
if [ -z "$WINGET_TOKEN" ]; then
echo "WINGET_TOKEN not set, skipping winget update"
exit 0
fi
dotnet tool install --global wingetcreate
VERSION="${{ github.ref_name }}"
VERSION="${VERSION#cli/v}"
wingetcreate update starkSV.msdl \
--version "$VERSION" \
--urls "https://github.com/starkSV/windows-iso-downloader/releases/download/${{ github.ref_name }}/msdl-windows-amd64.exe" \
--submit \
--token "$WINGET_TOKEN"