windows-iso-downloader/.github/workflows/cli-release.yml
Shekhar Vaidya 4dce41483d fix: update Homebrew install command to msdl-cli formula
homebrew/core already has an unrelated package literally named "msdl"
(a streaming-protocol downloader). brew install msdl silently
resolved to that instead of our tap, since Homebrew always prefers
core for a bare-name collision -- confirmed in production when a
user's `brew install msdl` pulled homebrew-core's msdl 1.2.7-r2
instead of ours. The tap's formula is renamed to msdl-cli
(starkSV/homebrew-msdl, separate repo) to fix this permanently; the
installed command itself is unaffected, still just `msdl`.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-07-14 00:52:57 +05:30

127 lines
5.1 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-cli
```
(formula is `msdl-cli`, not `msdl` -- homebrew/core has an unrelated package named `msdl`; the installed command is still just `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"