Skip to content

πŸ“ Prepare v0.8.0-rc1 release #12

πŸ“ Prepare v0.8.0-rc1 release

πŸ“ Prepare v0.8.0-rc1 release #12

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
# Set permissions for the GITHUB_TOKEN
permissions:
contents: write # For creating releases and uploading assets
packages: read # For reading packages if needed
jobs:
release:
name: Create Release
runs-on: ubuntu-latest
# Only run if CI workflow has passed
# needs: [CI] # Uncomment this line if you have a workflow named "CI"
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Needed for version detection
submodules: recursive # Checkout submodules for novnc embedding
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.24'
cache: true
- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/go/pkg/mod
~/go/bin
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
- name: Get version
id: version
run: |
VERSION=${GITHUB_REF#refs/tags/v}
echo "VERSION=${VERSION}" >> $GITHUB_OUTPUT
echo "Using version: ${VERSION}"
- name: Build binaries
run: |
mkdir -p dist
# Build for multiple platforms
platforms=(
"linux/amd64"
"linux/arm64"
"darwin/amd64"
"darwin/arm64"
"windows/amd64"
"windows/arm64"
)
for platform in "${platforms[@]}"; do
GOOS=${platform%/*}
GOARCH=${platform#*/}
if [ "$GOOS" = "windows" ]; then
BINARY_NAME="proxmox-tui-${GOOS}-${GOARCH}.exe"
OUTPUT="dist/proxmox-tui-${GOOS}-${GOARCH}.exe"
else
BINARY_NAME="proxmox-tui-${GOOS}-${GOARCH}"
OUTPUT="dist/proxmox-tui-${GOOS}-${GOARCH}"
fi
echo "πŸš€ Building $BINARY_NAME..."
CGO_ENABLED=0 GOOS=$GOOS GOARCH=$GOARCH \
go build -ldflags="-s -w -X main.version=${{ steps.version.outputs.VERSION }} -X main.buildDate=$(date -u +%Y-%m-%dT%H:%M:%SZ) -X main.commitHash=$(git rev-parse --short HEAD)" \
-o "$OUTPUT" ./cmd/proxmox-tui
done
# List built binaries
echo "πŸ“¦ Built binaries:"
ls -la dist/
- name: Create archives
run: |
cd dist
# Create tar.gz archives for Unix-like systems
for file in proxmox-tui-linux-* proxmox-tui-darwin-*; do
if [ -f "$file" ] && [[ ! "$file" == *.tar.gz ]]; then
archive_name="${file}.tar.gz"
echo "πŸ“¦ Creating $archive_name..."
tar -czf "$archive_name" "$file"
rm "$file" # Remove the original binary
fi
done
# Create zip archives for Windows
for file in proxmox-tui-windows-*.exe; do
if [ -f "$file" ] && [[ ! "$file" == *.zip ]]; then
archive_name="${file%.exe}.zip"
echo "πŸ“¦ Creating $archive_name..."
zip -j "$archive_name" "$file"
rm "$file" # Remove the original binary
fi
done
# List all files
echo "πŸ“¦ Final artifacts:"
ls -la
- name: Generate checksums
run: |
cd dist
echo "πŸ”’ Generating checksums..."
shasum -a 256 -- * > checksums.txt
echo "πŸ” Checksums:"
cat checksums.txt
- name: Extract changelog content
id: changelog
run: |
VERSION=${{ steps.version.outputs.VERSION }}
echo "Extracting changelog for version $VERSION..."
# Extract content between version headers
CONTENT=$(sed -n "/## \[$VERSION\]/,/^## \[/p" CHANGELOG.md | sed '/^## \[/d' | tail -n +2)
# Save to file and environment variable
echo "$CONTENT" > changelog_content.md
# Set output for use in release body (escape for JSON)
{
echo 'CHANGELOG_CONTENT<<EOF'
echo "$CONTENT"
echo 'EOF'
} >> $GITHUB_OUTPUT
- name: Create GitHub Release
uses: softprops/action-gh-release@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: |
dist/*.tar.gz
dist/*.zip
dist/checksums.txt
draft: true
prerelease: ${{ contains(steps.version.outputs.VERSION, '-') }}
body: |
## πŸš€ Release ${{ steps.version.outputs.VERSION }}
${{ steps.changelog.outputs.CHANGELOG_CONTENT }}
## πŸ“¦ Downloads
Choose the appropriate binary for your platform:
- **Linux AMD64**: `proxmox-tui-linux-amd64.tar.gz`
- **Linux ARM64**: `proxmox-tui-linux-arm64.tar.gz`
- **macOS Intel**: `proxmox-tui-darwin-amd64.tar.gz`
- **macOS Apple Silicon**: `proxmox-tui-darwin-arm64.tar.gz`
- **Windows AMD64**: `proxmox-tui-windows-amd64.zip`
- **Windows ARM64**: `proxmox-tui-windows-arm64.zip`
## πŸ” Verification
Verify your download with the provided `checksums.txt` file:
```bash
shasum -a 256 -c checksums.txt
```
## πŸ“‹ Installation
1. Download the appropriate archive for your platform
2. Extract the binary: `tar -xzf proxmox-tui-*.tar.gz` (or unzip for Windows)
3. Make executable (Unix): `chmod +x proxmox-tui-*`
4. Run: `./proxmox-tui-* --help`