Skip to content

Next work local

Next work local #194

name: VS Code Extension
on:
push:
branches: [main]
paths:
- 'vscode-extension/**'
- 'icons/**'
- 'bindings/**'
- '.github/workflows/vscode-extension.yaml'
pull_request:
branches: [main]
paths:
- 'vscode-extension/**'
- 'icons/**'
- 'bindings/**'
workflow_dispatch:
inputs:
publish:
description: 'Publish to marketplace'
type: boolean
default: false
defaults:
run:
working-directory: vscode-extension
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'
jobs:
lint-test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: vscode-extension/package-lock.json
- name: Install dependencies
run: npm ci
- name: Copy generated types
run: npm run copy-types
- name: Generate icon font
run: mkdir -p images/icons/dist && npm run generate:icons
- name: Lint
run: npm run lint
- name: Check formatting
run: npm run fmt:check
- name: Compile
run: npm run compile
- name: Compile webview
run: npm run compile:webview
- name: Run tests with coverage
run: xvfb-run -a npm run test:coverage
env:
DISPLAY: ':99.0'
- name: Upload coverage to Codecov
if: always()
uses: codecov/codecov-action@v7
with:
files: vscode-extension/coverage/lcov.info
flags: vscode-extension
fail_ci_if_error: false
opr8r-build:
name: Build opr8r (${{ matrix.artifact }})
needs: lint-test
env:
MACOSX_DEPLOYMENT_TARGET: "12.0"
if: github.ref == 'refs/heads/main'
strategy:
fail-fast: false
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
artifact: opr8r-linux-x86_64
- target: aarch64-unknown-linux-gnu
os: ubuntu-24.04-arm
artifact: opr8r-linux-arm64
- target: aarch64-apple-darwin
os: macos-15
artifact: opr8r-macos-arm64
- target: x86_64-pc-windows-msvc
os: windows-latest
artifact: opr8r-windows-x86_64
extension: .exe
- target: aarch64-pc-windows-msvc
os: windows-11-arm
artifact: opr8r-windows-arm64
extension: .exe
runs-on: ${{ matrix.os }}
defaults:
run:
working-directory: opr8r
steps:
- uses: actions/checkout@v7
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@1.95
- name: Cache cargo registry
uses: actions/cache@v6
with:
path: |
~/.cargo/registry
~/.cargo/git
opr8r/target
key: opr8r-${{ matrix.artifact }}-cargo-${{ hashFiles('opr8r/Cargo.lock') }}
restore-keys: |
opr8r-${{ matrix.artifact }}-cargo-
- name: Build release binary
run: cargo build --locked --release
- name: Strip binary (Linux/macOS)
if: runner.os != 'Windows'
run: strip target/release/opr8r || true
# Apple code signing + notarization (macOS only)
- name: Codesign opr8r binary
if: runner.os == 'macOS'
working-directory: .
env:
APPLE_CERTIFICATE_P12_BASE64: ${{ secrets.APPLE_CERTIFICATE_P12_BASE64 }}
APPLE_CERTIFICATE_PASSWORD: ${{ secrets.APPLE_CERTIFICATE_PASSWORD }}
run: scripts/codesign.sh opr8r/target/release/opr8r
- name: Notarize opr8r binary
if: runner.os == 'macOS'
working-directory: .
env:
APPLE_NOTARY_KEY_BASE64: ${{ secrets.APPLE_NOTARY_KEY_BASE64 }}
APPLE_NOTARY_KEY_ID: ${{ secrets.APPLE_NOTARY_KEY_ID }}
APPLE_NOTARY_ISSUER_ID: ${{ secrets.APPLE_NOTARY_ISSUER_ID }}
run: scripts/notarize.sh opr8r/target/release/opr8r
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: ${{ matrix.artifact }}
path: opr8r/target/release/opr8r${{ matrix.extension || '' }}
build-vsix:
name: Build VSIX (${{ matrix.vscode_target }})
needs: [lint-test, opr8r-build]
if: github.ref == 'refs/heads/main'
strategy:
fail-fast: false
matrix:
include:
- vscode_target: linux-x64
opr8r_artifact: opr8r-linux-x86_64
- vscode_target: linux-arm64
opr8r_artifact: opr8r-linux-arm64
- vscode_target: darwin-arm64
opr8r_artifact: opr8r-macos-arm64
- vscode_target: win32-x64
opr8r_artifact: opr8r-windows-x86_64
opr8r_extension: .exe
- vscode_target: win32-arm64
opr8r_artifact: opr8r-windows-arm64
opr8r_extension: .exe
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: vscode-extension/package-lock.json
- name: Download opr8r binary
uses: actions/download-artifact@v8
with:
name: ${{ matrix.opr8r_artifact }}
path: vscode-extension/bin
- name: Prepare binary
run: |
# Unix binaries need execute permission, Windows binaries already have .exe extension
if [ -f "bin/opr8r" ]; then
chmod +x bin/opr8r
fi
ls -la bin/
- name: Install dependencies
run: npm ci
- name: Generate icon font
run: mkdir -p images/icons/dist && npm run generate:icons
- name: Package platform-specific VSIX
run: npx vsce package --target ${{ matrix.vscode_target }}
- name: Upload VSIX artifact
uses: actions/upload-artifact@v7
with:
name: vsix-${{ matrix.vscode_target }}
path: vscode-extension/*.vsix
publish:
name: Publish to Marketplace
needs: build-vsix
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
defaults:
run:
working-directory: . # Override global default - publish job runs from repo root
steps:
- uses: actions/checkout@v7
- name: Setup Node.js
uses: actions/setup-node@v7
with:
node-version: '22'
- name: Install vsce
run: npm install -g @vscode/vsce
- name: Download all VSIX artifacts
uses: actions/download-artifact@v8
with:
pattern: vsix-*
path: vsix-packages
merge-multiple: true
- name: List VSIX packages
run: ls -la vsix-packages/
- name: Publish all platforms
run: |
for vsix in vsix-packages/*.vsix; do
echo "Publishing $vsix"
vsce publish --packagePath "$vsix"
done
env:
VSCE_PAT: ${{ secrets.VSCE_PAT }}