Skip to content

release: v1.1.0

release: v1.1.0 #16

Workflow file for this run

name: Release
run-name: "${{ inputs.version && format('release: v{0}', inputs.version) || 'Release' }}"
on:
workflow_dispatch:
inputs:
version:
description: "Version override (leave empty to use Cargo.toml)"
required: false
type: string
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
env:
CARGO_TERM_COLOR: always
jobs:
# ── Resolve version ─────────────────────────────────────────────
preflight:
name: Preflight
runs-on: ubuntu-latest
outputs:
version: ${{ steps.meta.outputs.version }}
tag: ${{ steps.meta.outputs.tag }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Resolve version
id: meta
shell: bash
run: |
if [ -n "${{ inputs.version }}" ]; then
VERSION="${{ inputs.version }}"
VERSION="${VERSION#v}"
else
VERSION=$(grep '^version' Cargo.toml | head -1 | sed 's/.*"\(.*\)"/\1/')
fi
echo "version=$VERSION" >> "$GITHUB_OUTPUT"
echo "tag=v$VERSION" >> "$GITHUB_OUTPUT"
echo "Resolved version: $VERSION"
# ── Windows x64 (NSIS installer) ───────────────────────────────
build-windows:
name: Windows x64
needs: preflight
runs-on: windows-latest
timeout-minutes: 30
env:
VERSION: ${{ needs.preflight.outputs.version }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-pc-windows-msvc
- uses: Swatinem/rust-cache@v2
with:
key: windows-x64-release
- name: Build
run: cargo build --release --locked --target x86_64-pc-windows-msvc
- name: Install NSIS
shell: pwsh
run: choco install nsis -y --no-progress
- name: Build NSIS installer
shell: pwsh
run: |
Copy-Item "target\x86_64-pc-windows-msvc\release\void.exe" "installer\void.exe"
& "${env:ProgramFiles(x86)}\NSIS\makensis.exe" /DVERSION=$env:VERSION installer\void.nsi
- uses: actions/upload-artifact@v4
with:
name: windows-x64
path: installer/void-*-x86_64-setup.exe
# ── macOS ARM64 (Apple Silicon) ────────────────────────────────
build-macos-arm64:
name: macOS Apple Silicon
needs: preflight
runs-on: macos-latest
timeout-minutes: 30
env:
VERSION: ${{ needs.preflight.outputs.version }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: aarch64-apple-darwin
- uses: Swatinem/rust-cache@v2
with:
key: macos-arm64-release
- name: Build
run: cargo build --release --locked --target aarch64-apple-darwin
- name: Package .dmg
run: |
APP="Void.app"
mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources"
cp target/aarch64-apple-darwin/release/void "$APP/Contents/MacOS/void"
chmod +x "$APP/Contents/MacOS/void"
cp assets/icon.png "$APP/Contents/Resources/icon.png"
cat > "$APP/Contents/Info.plist" << 'PLIST'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"><dict>
<key>CFBundleName</key><string>Void</string>
<key>CFBundleIdentifier</key><string>sh.void.terminal</string>
<key>CFBundleVersion</key><string>${VERSION}</string>
<key>CFBundleShortVersionString</key><string>${VERSION}</string>
<key>CFBundleExecutable</key><string>void</string>
<key>CFBundlePackageType</key><string>APPL</string>
<key>CFBundleIconFile</key><string>icon</string>
<key>NSHighResolutionCapable</key><true/>
<key>LSMinimumSystemVersion</key><string>11.0</string>
</dict></plist>
PLIST
mkdir -p dmg-stage
cp -r "$APP" dmg-stage/
ln -s /Applications dmg-stage/Applications
hdiutil create -volname "Void" -srcfolder dmg-stage -ov -format UDZO \
"void-${VERSION}-aarch64-apple-darwin-setup.dmg"
- uses: actions/upload-artifact@v4
with:
name: macos-arm64
path: "*.dmg"
# ── macOS x64 (Intel) ──────────────────────────────────────────
build-macos-x64:
name: macOS Intel
needs: preflight
runs-on: macos-latest
timeout-minutes: 30
env:
VERSION: ${{ needs.preflight.outputs.version }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
targets: x86_64-apple-darwin
- uses: Swatinem/rust-cache@v2
with:
key: macos-x64-release
- name: Build
run: cargo build --release --locked --target x86_64-apple-darwin
- name: Package .dmg
run: |
APP="Void.app"
mkdir -p "$APP/Contents/MacOS" "$APP/Contents/Resources"
cp target/x86_64-apple-darwin/release/void "$APP/Contents/MacOS/void"
chmod +x "$APP/Contents/MacOS/void"
cp assets/icon.png "$APP/Contents/Resources/icon.png"
cat > "$APP/Contents/Info.plist" << 'PLIST'
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"><dict>
<key>CFBundleName</key><string>Void</string>
<key>CFBundleIdentifier</key><string>sh.void.terminal</string>
<key>CFBundleVersion</key><string>${VERSION}</string>
<key>CFBundleShortVersionString</key><string>${VERSION}</string>
<key>CFBundleExecutable</key><string>void</string>
<key>CFBundlePackageType</key><string>APPL</string>
<key>CFBundleIconFile</key><string>icon</string>
<key>NSHighResolutionCapable</key><true/>
<key>LSMinimumSystemVersion</key><string>11.0</string>
</dict></plist>
PLIST
mkdir -p dmg-stage
cp -r "$APP" dmg-stage/
ln -s /Applications dmg-stage/Applications
hdiutil create -volname "Void" -srcfolder dmg-stage -ov -format UDZO \
"void-${VERSION}-x86_64-apple-darwin-setup.dmg"
- uses: actions/upload-artifact@v4
with:
name: macos-x64
path: "*.dmg"
# ── Linux x64 (.deb + tar.gz) ──────────────────────────────────
build-linux:
name: Linux x64
needs: preflight
runs-on: ubuntu-22.04
timeout-minutes: 30
env:
VERSION: ${{ needs.preflight.outputs.version }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
key: linux-x64-release
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
libasound2-dev libudev-dev libwayland-dev \
libx11-dev libxcursor-dev libxi-dev libxinerama-dev \
libxkbcommon-dev libxrandr-dev pkg-config
- name: Build
run: cargo build --release --locked
- name: Package tar.gz
run: |
mkdir -p "void-${VERSION}-x86_64-linux-setup"
cp target/release/void "void-${VERSION}-x86_64-linux-setup/"
tar czf "void-${VERSION}-x86_64-linux-setup.tar.gz" "void-${VERSION}-x86_64-linux-setup"
- name: Package .deb
run: |
PKG="void-terminal_${VERSION}_amd64"
mkdir -p "$PKG/DEBIAN" "$PKG/usr/bin" "$PKG/usr/share/applications" "$PKG/usr/share/icons/hicolor/256x256/apps"
cp target/release/void "$PKG/usr/bin/void"
chmod 755 "$PKG/usr/bin/void"
cp assets/icon.png "$PKG/usr/share/icons/hicolor/256x256/apps/void-terminal.png"
cat > "$PKG/usr/share/applications/void-terminal.desktop" << 'EOF'
[Desktop Entry]
Name=Void Terminal
Comment=Infinite Canvas Terminal
Exec=void
Icon=void-terminal
Terminal=false
Type=Application
Categories=System;TerminalEmulator;
EOF
cat > "$PKG/DEBIAN/control" << EOF
Package: void-terminal
Version: ${VERSION}
Section: utils
Priority: optional
Architecture: amd64
Depends: libasound2, libx11-6, libxcursor1, libxi6, libxrandr2, libxkbcommon0, libwayland-client0
Maintainer: 190km <190km@void.sh>
Description: Infinite Canvas Terminal
GPU-accelerated terminal emulator with an infinite 2D canvas.
Homepage: https://void.sh
EOF
dpkg-deb --build --root-owner-group "$PKG"
mv "${PKG}.deb" "void-${VERSION}-x86_64-linux-setup.deb"
- uses: actions/upload-artifact@v4
with:
name: linux-x64
path: |
void-*-x86_64-linux-setup.tar.gz
void-*-x86_64-linux-setup.deb
# ── Publish GitHub Release ─────────────────────────────────────
publish:
name: Publish Release
needs:
- preflight
- build-windows
- build-macos-arm64
- build-macos-x64
- build-linux
if: >-
always() &&
needs.preflight.result == 'success' &&
(needs.build-windows.result == 'success' ||
needs.build-macos-arm64.result == 'success' ||
needs.build-linux.result == 'success')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/download-artifact@v4
with:
merge-multiple: true
path: release-assets
- name: Publish release
uses: softprops/action-gh-release@v2
with:
tag_name: ${{ needs.preflight.outputs.tag }}
name: Void v${{ needs.preflight.outputs.version }}
generate_release_notes: true
make_latest: true
files: release-assets/*
fail_on_unmatched_files: false