Skip to content

feat(selfhost): add @opptrix/selfhost CLI package, Linux bootstrap, a… #1

feat(selfhost): add @opptrix/selfhost CLI package, Linux bootstrap, a…

feat(selfhost): add @opptrix/selfhost CLI package, Linux bootstrap, a… #1

# Publish @opptrix/selfhost to npm
# Triggers: tag selfhost-v* or workflow_dispatch
#
# Release helper (local):
# node scripts/release-selfhost.mjs patch # bump + print tag steps
# git push origin/gitee main + tag → this workflow publishes
name: Publish selfhost
on:
push:
tags:
- 'selfhost-v*'
workflow_dispatch:
inputs:
dry_run:
description: 'Pack only (no npm publish)'
type: boolean
default: false
permissions:
contents: read
jobs:
publish:
name: Build & publish @opptrix/selfhost
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Setup Node.js
uses: actions/setup-node@v5
with:
node-version: '24'
cache: npm
registry-url: 'https://registry.npmjs.org'
- name: Install dependencies
run: npm ci
- name: Sync package version from tag
if: startsWith(github.ref, 'refs/tags/selfhost-v')
run: |
TAG="${GITHUB_REF_NAME#selfhost-v}"
echo "tag version=$TAG"
npm version "$TAG" -w @opptrix/selfhost --no-git-tag-version --allow-same-version
- name: Build selfhost bundle
run: npm run build -w @opptrix/selfhost
- name: Verify pack contents
run: |
npm pack -w @opptrix/selfhost --dry-run
test -f packages/selfhost/bundle/docker-compose.yml
test -f packages/selfhost/bundle/Dockerfile
test -f packages/selfhost/bin/opptrix.mjs
- name: Publish
if: ${{ github.event_name == 'push' || inputs.dry_run == false }}
run: npm publish -w @opptrix/selfhost --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Dry-run pack artifact
if: ${{ github.event_name == 'workflow_dispatch' && inputs.dry_run == true }}
run: |
npm pack -w @opptrix/selfhost
ls -la opptrix-selfhost-*.tgz