mirror of
https://github.com/SawyerHood/dev-browser.git
synced 2026-09-20 13:44:44 +08:00
0817e87dcb
* feat(cli): add Windows IPC and daemon lifecycle support * feat(release): add Windows x64 packaging and CI * docs: document Windows installation and verification * fix(windows): align pipe naming and shutdown detection
128 lines
3.9 KiB
YAML
128 lines
3.9 KiB
YAML
name: Release
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
|
|
jobs:
|
|
build-daemon:
|
|
name: Build Daemon Bundles
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: latest
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
- run: cd daemon && pnpm install
|
|
- run: cd daemon && pnpm run bundle
|
|
- run: cd daemon && pnpm run bundle:sandbox-client
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: daemon-bundles
|
|
path: |
|
|
daemon/dist/daemon.bundle.mjs
|
|
daemon/dist/sandbox-client.js
|
|
|
|
build-binaries:
|
|
needs: build-daemon
|
|
strategy:
|
|
matrix:
|
|
include:
|
|
- target: aarch64-apple-darwin
|
|
os: macos-latest
|
|
binary: dev-browser-darwin-arm64
|
|
source_binary: dev-browser
|
|
- target: x86_64-apple-darwin
|
|
os: macos-latest
|
|
binary: dev-browser-darwin-x64
|
|
source_binary: dev-browser
|
|
- target: x86_64-unknown-linux-gnu
|
|
os: ubuntu-latest
|
|
binary: dev-browser-linux-x64
|
|
source_binary: dev-browser
|
|
- target: aarch64-unknown-linux-gnu
|
|
os: ubuntu-latest
|
|
binary: dev-browser-linux-arm64
|
|
cross: true
|
|
source_binary: dev-browser
|
|
- target: x86_64-unknown-linux-musl
|
|
os: ubuntu-latest
|
|
binary: dev-browser-linux-musl-x64
|
|
cross: true
|
|
source_binary: dev-browser
|
|
- target: x86_64-pc-windows-msvc
|
|
os: windows-latest
|
|
binary: dev-browser-windows-x64.exe
|
|
source_binary: dev-browser.exe
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/download-artifact@v4
|
|
with:
|
|
name: daemon-bundles
|
|
path: daemon/dist/
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
with:
|
|
targets: ${{ matrix.target }}
|
|
- name: Install cross (if needed)
|
|
if: matrix.cross
|
|
run: cargo install cross
|
|
- name: Build
|
|
shell: bash
|
|
run: |
|
|
if [ "${{ matrix.cross }}" = "true" ]; then
|
|
cross build --release --target ${{ matrix.target }} --manifest-path cli/Cargo.toml
|
|
else
|
|
cargo build --release --target ${{ matrix.target }} --manifest-path cli/Cargo.toml
|
|
fi
|
|
- name: Rename binary
|
|
shell: bash
|
|
run: cp cli/target/${{ matrix.target }}/release/${{ matrix.source_binary }} ${{ matrix.binary }}
|
|
- uses: actions/upload-artifact@v4
|
|
with:
|
|
name: ${{ matrix.binary }}
|
|
path: ${{ matrix.binary }}
|
|
|
|
publish:
|
|
needs: build-binaries
|
|
runs-on: ubuntu-latest
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/download-artifact@v4
|
|
with:
|
|
path: artifacts/
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: latest
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
registry-url: 'https://registry.npmjs.org'
|
|
- run: cd daemon && pnpm install && pnpm run bundle && pnpm run bundle:sandbox-client
|
|
- run: |
|
|
mkdir -p dist/bin dist/scripts dist/daemon/dist
|
|
cp bin/dev-browser.js dist/bin/
|
|
cp scripts/postinstall.js dist/scripts/
|
|
cp scripts/sync-version.js dist/scripts/ 2>/dev/null || true
|
|
cp daemon/dist/daemon.bundle.mjs dist/daemon/dist/
|
|
cp daemon/dist/sandbox-client.js dist/daemon/dist/
|
|
cp package.json dist/
|
|
cp README.md dist/
|
|
cp LICENSE dist/ 2>/dev/null || true
|
|
- run: cd dist && npm publish
|
|
env:
|
|
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
- uses: softprops/action-gh-release@v2
|
|
with:
|
|
files: artifacts/**/*
|
|
generate_release_notes: true
|