Skip to content

release gui-first v1.5.2 #19

release gui-first v1.5.2

release gui-first v1.5.2 #19

Workflow file for this run

name: Release
on:
push:
tags:
- "v*.*.*"
permissions:
contents: write
jobs:
build-and-release:
name: Build & Release
runs-on: windows-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.21"
cache: true
- name: Parse version
id: version
shell: bash
run: |
TAG="${GITHUB_REF_NAME}"
VER="${TAG#v}"
COMMIT=$(git rev-parse --short HEAD)
BUILD_TIME=$(date -u +%Y-%m-%dT%H:%M:%SZ)
echo "tag=$TAG" >> "$GITHUB_OUTPUT"
echo "version=$VER" >> "$GITHUB_OUTPUT"
echo "commit=$COMMIT" >> "$GITHUB_OUTPUT"
echo "build_time=$BUILD_TIME" >> "$GITHUB_OUTPUT"
- name: Install rsrc
run: go install github.com/akavel/rsrc@latest
- name: Embed icon
shell: cmd
run: |
if not exist build\icon.ico (
echo "Missing build\\icon.ico"
exit /b 1
)
rsrc -ico build\icon.ico -o cmd\indus-terminal\rsrc.syso
if not exist cmd\indus-terminal\rsrc.syso (
echo "Icon embed failed: cmd\\indus-terminal\\rsrc.syso not found"
exit /b 1
)
- name: Build binary
shell: cmd
env:
GOOS: windows
GOARCH: amd64
CGO_ENABLED: "0"
run: |
if not exist dist mkdir dist
echo Building console version (ind.exe)...
go build ^
-ldflags "-s -w -X main.version=${{ steps.version.outputs.version }} -X main.commit=${{ steps.version.outputs.commit }} -X main.buildTime=${{ steps.version.outputs.build_time }}" ^
-o dist\ind.exe ^
.\cmd\indus-terminal
copy /Y dist\ind.exe dist\indus.exe >nul
echo Building GUI version (indus-gui.exe)...
go build ^
-ldflags "-s -w -H windowsgui -X main.version=${{ steps.version.outputs.version }} -X main.commit=${{ steps.version.outputs.commit }} -X main.buildTime=${{ steps.version.outputs.build_time }}" ^
-o dist\indus-gui.exe ^
.\cmd\indus-terminal
if not exist dist\ind.exe (
echo "Binary build failed: dist\\ind.exe not found"
exit /b 1
)
if not exist dist\indus.exe (
echo "Alias build failed: dist\\indus.exe not found"
exit /b 1
)
if not exist dist\indus-gui.exe (
echo "GUI build failed: dist\\indus-gui.exe not found"
exit /b 1
)
- name: Run unit tests
shell: powershell
run: go test ./...
- name: Smoke test native commands
shell: powershell
run: |
.\scripts\release_smoke.ps1 -BinaryPath "$pwd\dist\ind.exe" -ReportDir "$pwd\dist"
- name: Install Inno Setup
shell: cmd
run: choco install innosetup --yes --no-progress
- name: Build installer
shell: cmd
run: |
"C:\Program Files (x86)\Inno Setup 6\ISCC.exe" installer\indus-setup.iss
if not exist dist\indus-setup.exe (
echo "Installer build failed!"
exit /b 1
)
- name: Rename installer
shell: cmd
run: |
rename dist\indus-setup.exe indus-setup-${{ steps.version.outputs.tag }}-windows-amd64.exe
- name: Generate checksums
shell: powershell
run: |
$files = @(
"dist\ind.exe",
"dist\indus.exe",
"dist\indus-gui.exe",
"dist\indus-setup-${{ steps.version.outputs.tag }}-windows-amd64.exe"
)
$lines = foreach ($f in $files) {
$hash = (Get-FileHash $f -Algorithm SHA256).Hash.ToLower()
"$hash $(Split-Path $f -Leaf)"
}
$lines | Set-Content dist\checksums.txt
Get-Content dist\checksums.txt
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ steps.version.outputs.tag }}
name: "INDUS Terminal ${{ steps.version.outputs.tag }}"
body: |
## INDUS Terminal ${{ steps.version.outputs.tag }}
### Install
1. Download **indus-setup-${{ steps.version.outputs.tag }}-windows-amd64.exe**
2. Run it to install INDUS and add it to PATH
3. Open a new terminal and run `ind` (or `indus`)
### Manual install
- **CLI version**: Download `ind.exe` or `indus.exe`, place in PATH
- **GUI version**: Download `indus-gui.exe` for standalone window (double-click to launch)
---
**Build info**
| | |
|---|---|
| Version | `${{ steps.version.outputs.version }}` |
| Commit | `${{ steps.version.outputs.commit }}` |
| Built | `${{ steps.version.outputs.build_time }}` |
files: |
dist/indus-setup-${{ steps.version.outputs.tag }}-windows-amd64.exe
dist/ind.exe
dist/indus.exe
dist/indus-gui.exe
dist/checksums.txt
dist/smoke-summary.txt
dist/smoke-report.json
draft: false
prerelease: ${{ contains(steps.version.outputs.tag, '-') }}