Skip to content

v0.8.2

v0.8.2 #415

Workflow file for this run

name: Release
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: 'Tag to release (e.g., v1.2.3). If provided, will checkout and release this tag regardless of current branch.'
required: false
type: string
permissions:
contents: write # Required for electron-builder to upload release assets
env:
RELEASE_TAG: ${{ inputs.tag || github.event.release.tag_name || github.ref_name }}
jobs:
preflight:
name: Validate release target
runs-on: ubuntu-latest
steps:
- name: Ensure release tag context
run: |
if [ -z "$RELEASE_TAG" ]; then
echo "::error::RELEASE_TAG is empty. Ensure this workflow runs on a release event or refs/tags/* ref."
exit 1
fi
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
if [ -n "${{ inputs.tag }}" ]; then
echo "workflow_dispatch with explicit tag input: ${{ inputs.tag }}"
elif [[ "$GITHUB_REF" != refs/tags/* ]]; then
echo "::error::workflow_dispatch runs must either provide a 'tag' input or target a tag ref. Current ref: $GITHUB_REF"
exit 1
fi
fi
echo "Publishing tag $RELEASE_TAG"
build-macos:
name: Build and Release macOS
needs: preflight
runs-on: ${{ github.repository_owner == 'coder' && 'depot-macos-15' || 'macos-latest' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || github.ref }}
fetch-depth: 0 # Required for git describe to find tags
- uses: ./.github/actions/setup-mux
- name: Build application
run: bun run build
- name: Setup code signing
run: ./scripts/setup-macos-signing.sh
env:
MACOS_CERTIFICATE: ${{ secrets.MACOS_CERTIFICATE }}
MACOS_CERTIFICATE_PWD: ${{ secrets.MACOS_CERTIFICATE_PWD }}
AC_APIKEY_P8_BASE64: ${{ secrets.AC_APIKEY_P8_BASE64 }}
AC_APIKEY_ID: ${{ secrets.AC_APIKEY_ID }}
AC_APIKEY_ISSUER_ID: ${{ secrets.AC_APIKEY_ISSUER_ID }}
- name: Package and publish for macOS
run: make dist-mac-release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-linux:
name: Build and Release Linux
needs: preflight
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || github.ref }}
fetch-depth: 0 # Required for git describe to find tags
- uses: ./.github/actions/setup-mux
- name: Build application
run: bun run build
- name: Package and publish for Linux
run: bun x electron-builder --linux --publish always
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
build-vscode-extension:
name: Build and Release VS Code Extension
needs: preflight
runs-on: ${{ github.repository_owner == 'coder' && 'depot-ubuntu-22.04-16' || 'ubuntu-latest' }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || github.ref }}
fetch-depth: 0 # Required for git describe to find tags
- uses: ./.github/actions/setup-mux
- uses: ./.github/actions/build-vscode-extension
- name: Wait for GitHub release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
for attempt in $(seq 1 30); do
if gh release view "$RELEASE_TAG" >/dev/null 2>&1; then
echo "Release $RELEASE_TAG is available"
exit 0
fi
echo "Release $RELEASE_TAG not found yet (attempt $attempt/30); waiting 10s..."
sleep 10
done
echo "::error::Timed out waiting for release $RELEASE_TAG"
exit 1
- name: Upload VS Code extension to release
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
gh release upload "$RELEASE_TAG" \
vscode/mux-*.vsix \
--clobber
- name: Publish to VS Code Marketplace
working-directory: vscode
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}
run: |
if [ -z "$VSCE_PAT" ]; then
echo "VSCE_PAT secret is not set; skipping VS Code Marketplace publish."
exit 0
fi
bunx vsce publish -p "$VSCE_PAT"
build-windows:
name: Build and Release Windows
needs: preflight
runs-on: windows-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ inputs.tag || github.ref }}
fetch-depth: 0 # Required for git describe to find tags
- uses: ./.github/actions/setup-mux
- name: Install GNU Make (for build)
run: choco install -y make
- name: Verify tools
shell: bash
run: |
make --version
bun --version
magick --version | head -1
- name: Build application
run: bun run build
- name: Package and publish for Windows (.exe)
run: bun x electron-builder --win --publish always
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}