Skip to content

feat: notification service & dynamic command discover #37

feat: notification service & dynamic command discover

feat: notification service & dynamic command discover #37

Workflow file for this run

name: Build CLI Binaries
on:
push:
tags:
- '[0-9]+.[0-9]+.[0-9]+*'
workflow_dispatch:
permissions:
contents: write
id-token: write
jobs:
build:
runs-on: ubuntu-latest
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: actions/checkout@v4
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
version: 10
- name: Extract version from tag
id: version
run: |
# Tag is already the version (2.0.0)
VERSION=$GITHUB_REF_NAME
echo "version=$VERSION" >> $GITHUB_OUTPUT
echo "📦 Building CLI version: $VERSION"
- name: Set version in package.json files
run: |
VERSION=${{ steps.version.outputs.version }}
node -e "
const fs = require('fs');
for (const p of ['package.json', 'cli/package.json', 'packages/cli/package.json']) {
const pkg = JSON.parse(fs.readFileSync(p, 'utf8'));
pkg.version = '$VERSION';
fs.writeFileSync(p, JSON.stringify(pkg, null, 2) + '\n');
console.log('✓ ' + p + ' → ' + '$VERSION');
}
"
- name: Install CLI dependencies
run: |
cd cli
bun install
- name: Install UI dependencies
run: |
cd cli/ui
pnpm install --frozen-lockfile
- name: Build UI
run: |
cd cli/ui
pnpm build
- name: Build all platforms
run: |
cd cli
bun run scripts/build.ts
- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: dockflow-binaries-${{ steps.version.outputs.version }}
path: cli/dist/*
- name: Create Release
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@v1
with:
name: Dockflow ${{ steps.version.outputs.version }}
tag_name: ${{ github.ref_name }}
files: cli/dist/*
generate_release_notes: true
body: |
## Dockflow ${{ steps.version.outputs.version }}
### Installation
**Linux x64:**
```bash
curl -fsSL https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/dockflow-linux-x64 -o /usr/local/bin/dockflow
chmod +x /usr/local/bin/dockflow
```
**Linux ARM64:**
```bash
curl -fsSL https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/dockflow-linux-arm64 -o /usr/local/bin/dockflow
chmod +x /usr/local/bin/dockflow
```
**macOS x64:**
```bash
curl -fsSL https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/dockflow-macos-x64 -o /usr/local/bin/dockflow
chmod +x /usr/local/bin/dockflow
```
**macOS ARM64 (Apple Silicon):**
```bash
curl -fsSL https://github.com/${{ github.repository }}/releases/download/${{ github.ref_name }}/dockflow-macos-arm64 -o /usr/local/bin/dockflow
chmod +x /usr/local/bin/dockflow
```
**Windows x64:**
Download `dockflow-windows-x64.exe` and add it to your PATH.
**npm:**
```bash
npm install -g @dockflow-tools/cli
```
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
publish-npm:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '24'
registry-url: 'https://registry.npmjs.org'
- name: Set package version from tag
run: |
cd packages/cli
npm version ${{ needs.build.outputs.version }} --no-git-tag-version --allow-same-version
- name: Publish to npm
run: |
cd packages/cli
VERSION="${{ needs.build.outputs.version }}"
if [[ "$VERSION" == *-* ]]; then
npm publish --access public --tag dev
else
npm publish --access public
fi