Skip to content

cli: add launch <job> command #5

cli: add launch <job> command

cli: add launch <job> command #5

Workflow file for this run

name: release
on:
push:
tags:
- "v*"
permissions:
contents: write
jobs:
release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: oven-sh/setup-bun@v2
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Build all targets
run: |
set -euo pipefail
mkdir -p dist
build() {
local target="$1"
local artifact="$2"
bun build src/cli.tsx --compile --target="${target}" --outfile=colflow
tar -czvf "dist/${artifact}.tar.gz" colflow
sha256sum "dist/${artifact}.tar.gz" | awk '{print $1}' > "dist/${artifact}.sha256"
rm colflow
}
build bun-darwin-arm64 colflow-darwin-arm64
build bun-darwin-x64 colflow-darwin-amd64
build bun-linux-x64 colflow-linux-amd64
build bun-linux-arm64 colflow-linux-arm64
- name: Read sha256s
id: hashes
run: |
echo "darwin_arm64_sha=$(cat dist/colflow-darwin-arm64.sha256)" >> "$GITHUB_OUTPUT"
echo "darwin_amd64_sha=$(cat dist/colflow-darwin-amd64.sha256)" >> "$GITHUB_OUTPUT"
echo "linux_amd64_sha=$(cat dist/colflow-linux-amd64.sha256)" >> "$GITHUB_OUTPUT"
echo "linux_arm64_sha=$(cat dist/colflow-linux-arm64.sha256)" >> "$GITHUB_OUTPUT"
- name: Create GitHub release
uses: softprops/action-gh-release@v2
with:
files: |
dist/colflow-darwin-arm64.tar.gz
dist/colflow-darwin-amd64.tar.gz
dist/colflow-linux-amd64.tar.gz
dist/colflow-linux-arm64.tar.gz
generate_release_notes: true
- name: Update Homebrew formula
env:
TAP_GITHUB_TOKEN: ${{ secrets.TAP_GITHUB_TOKEN }}
TAG: ${{ github.ref_name }}
DARWIN_ARM64_SHA: ${{ steps.hashes.outputs.darwin_arm64_sha }}
DARWIN_AMD64_SHA: ${{ steps.hashes.outputs.darwin_amd64_sha }}
LINUX_AMD64_SHA: ${{ steps.hashes.outputs.linux_amd64_sha }}
LINUX_ARM64_SHA: ${{ steps.hashes.outputs.linux_arm64_sha }}
run: |
VERSION="${TAG#v}"
REPO="https://github.com/CogappLabs/colflow-cli-react/releases/download/${TAG}"
cat > colflow.rb <<FORMULA
class Colflow < Formula
desc "TUI for Dagster collection-flow pipelines"
homepage "https://github.com/CogappLabs/colflow-cli-react"
version "${VERSION}"
license "MIT"
on_macos do
if Hardware::CPU.arm?
url "${REPO}/colflow-darwin-arm64.tar.gz"
sha256 "${DARWIN_ARM64_SHA}"
else
url "${REPO}/colflow-darwin-amd64.tar.gz"
sha256 "${DARWIN_AMD64_SHA}"
end
end
on_linux do
if Hardware::CPU.arm?
url "${REPO}/colflow-linux-arm64.tar.gz"
sha256 "${LINUX_ARM64_SHA}"
else
url "${REPO}/colflow-linux-amd64.tar.gz"
sha256 "${LINUX_AMD64_SHA}"
end
end
def install
bin.install "colflow"
end
test do
system "#{bin}/colflow", "--help"
end
end
FORMULA
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git config --global user.name "github-actions[bot]"
git clone \
"https://x-access-token:${TAP_GITHUB_TOKEN}@github.com/CogappLabs/homebrew-tap.git" \
tap-repo
cp colflow.rb tap-repo/Formula/colflow.rb
cd tap-repo
git add Formula/colflow.rb
git commit -m "colflow ${TAG}"
git push