name: Release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
mycui:
name: MycUI (${{ matrix.platform }})
strategy:
fail-fast: false
matrix:
include:
- platform: macos-latest args: "--target universal-apple-darwin"
- platform: ubuntu-latest
args: ""
- platform: windows-latest
args: ""
runs-on: ${{ matrix.platform }}
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.platform == 'macos-latest' && 'aarch64-apple-darwin,x86_64-apple-darwin' || '' }}
- name: Install Bun
uses: oven-sh/setup-bun@v2
- name: Install Linux system deps
if: matrix.platform == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install -y \
libwebkit2gtk-4.1-dev \
libappindicator3-dev \
librsvg2-dev \
patchelf \
libgtk-3-dev
- name: Install frontend deps
working-directory: mycui
run: bun install
- name: Build + bundle MycUI and upload to the release
uses: tauri-apps/tauri-action@v0
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
projectPath: mycui
tagName: ${{ github.ref_name }}
releaseName: "Mycelium ${{ github.ref_name }}"
releaseBody: "MycUI desktop app + `myc` CLI. See assets below."
releaseDraft: false
prerelease: false
args: ${{ matrix.args }}
cli:
name: myc CLI (${{ matrix.target }})
strategy:
fail-fast: false
matrix:
include:
- os: macos-latest
target: aarch64-apple-darwin
- os: macos-latest
target: x86_64-apple-darwin
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: windows-latest
target: x86_64-pc-windows-msvc
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install Rust
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Build myc
run: cargo build --release --bin myc --target ${{ matrix.target }}
- name: Package (unix)
if: matrix.os != 'windows-latest'
run: |
bin="target/${{ matrix.target }}/release/myc"
tar -czf "myc-${{ matrix.target }}.tar.gz" -C "$(dirname "$bin")" myc
- name: Package (windows)
if: matrix.os == 'windows-latest'
run: |
Compress-Archive -Path "target/${{ matrix.target }}/release/myc.exe" -DestinationPath "myc-${{ matrix.target }}.zip"
- name: Upload CLI archive to the release
uses: softprops/action-gh-release@v2
with:
files: |
myc-${{ matrix.target }}.tar.gz
myc-${{ matrix.target }}.zip
fail_on_unmatched_files: false
brew:
name: Update Homebrew tap
needs: cli
runs-on: ubuntu-latest
steps:
- name: Compute checksums and render formula
env:
REPO: ${{ github.repository }}
TAG: ${{ github.ref_name }}
run: |
set -euo pipefail
version="${TAG#v}"
base="https://github.com/$REPO/releases/download/$TAG"
fetch_sha() {
curl -fsSL "$base/$1" -o "$1"
sha256sum "$1" | cut -d' ' -f1
}
sha_arm_mac=$(fetch_sha "myc-aarch64-apple-darwin.tar.gz")
sha_x86_mac=$(fetch_sha "myc-x86_64-apple-darwin.tar.gz")
sha_x86_linux=$(fetch_sha "myc-x86_64-unknown-linux-gnu.tar.gz")
mkdir -p Formula
cat > Formula/myc.rb <<EOF
# This file is auto-generated by .github/workflows/release.yml.
# Do not edit by hand — changes are overwritten on the next release.
class Myc < Formula
desc "Robust, production-grade task/plan manager CLI (mycelium)"
homepage "https://github.com/$REPO"
version "$version"
license "MIT"
on_macos do
if Hardware::CPU.arm?
url "$base/myc-aarch64-apple-darwin.tar.gz"
sha256 "$sha_arm_mac"
else
url "$base/myc-x86_64-apple-darwin.tar.gz"
sha256 "$sha_x86_mac"
end
end
on_linux do
# Only x86_64 Linux binaries are published today.
url "$base/myc-x86_64-unknown-linux-gnu.tar.gz"
sha256 "$sha_x86_linux"
end
def install
bin.install "myc"
end
test do
assert_match "myc #{version}", shell_output("#{bin}/myc --version")
end
end
EOF
echo "Rendered Formula/myc.rb for $version"
- name: Push formula to the tap
env:
GH_TOKEN: ${{ secrets.HOMEBREW_TAP_TOKEN }}
TAG: ${{ github.ref_name }}
run: |
set -euo pipefail
git clone "https://x-access-token:${GH_TOKEN}@github.com/tcsenpai/homebrew-tap.git" tap
mkdir -p tap/Formula
cp Formula/myc.rb tap/Formula/myc.rb
cd tap
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add Formula/myc.rb
# Check AFTER staging: `git diff --quiet` alone ignores a brand-new
# untracked formula, so the first release would silently no-op.
if git diff --cached --quiet; then
echo "Formula unchanged; nothing to push."
exit 0
fi
git commit -m "myc ${TAG#v}"
git push