Telemetry showed a growing number of Termux (Android) users running the CLI, but the release workflow only builds linux-amd64 -- those users had to build from source since Termux runs on ARM64. Adds a linux-arm64 binary and install line so they can just curl it. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
111 lines
4.4 KiB
YAML
111 lines
4.4 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/ | grep -v '^- chore(winget)' | head -30)
|
|
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.
|
|
|
|
**Linux/macOS:**
|
|
```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 (United States)" # 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"
|