Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
73a2387
CLI v2: TypeScript rewrite against the Registry Service API
roncodes Oct 22, 2026
63d7287
CLI v2: flb listing, and instance register through registry:register
roncodes Oct 23, 2026
bdd89ed
e2e: avoid early-closed pipes under pipefail (GNU tar write error in CI)
roncodes Oct 23, 2026
25606f8
fix: resolve CodeQL alerts in manifest and init
roncodes Oct 23, 2026
65b6180
fix: remove exponential backtracking from the Composer package-name r…
roncodes Oct 23, 2026
c1fdc1c
fix(instance): re-registering rotates the same instance
roncodes Oct 24, 2026
08f3e6a
feat(publish): trusted publishing from GitHub Actions
roncodes Nov 18, 2026
886e53b
Merge pull request #14 from fleetbase/feat/trusted-publishing
roncodes Nov 19, 2026
14a0b64
Merge pull request #13 from fleetbase/v2
roncodes Nov 19, 2026
7f96c44
fix(init): default compat to console 0.8+ and core-api 2.x
roncodes Nov 19, 2026
bd0b411
Merge pull request #15 from fleetbase/fix/init-default-compat
roncodes Nov 19, 2026
f7e5d28
docs(init): describe the new compat defaults
roncodes Nov 19, 2026
cd356e9
feat(installer): provision the socket auth key in the project .env
roncodes Nov 19, 2026
e9e2e88
Merge pull request #16 from fleetbase/docs/init-compat-comment
roncodes Nov 19, 2026
6b0ab3a
Merge pull request #18 from fleetbase/feat/installer-socket-auth
roncodes Nov 19, 2026
ff68cb0
feat(listing): manage the catalog listing from extension.json
roncodes Nov 23, 2026
6e36fd0
feat(manifest): compat.extensions for the other extensions a release …
roncodes Nov 24, 2026
d6675c3
feat(listing): highlights and setup steps in the listing block
roncodes Nov 24, 2026
455a546
ci: run the end-to-end test against the registry's release/v2.0.0
roncodes Nov 24, 2026
95e7132
chore(release): v2.0.0
roncodes Nov 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
181 changes: 143 additions & 38 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,71 +2,176 @@ name: Fleetbase CLI CI

on:
push:
branches: [ main ]
branches: [main, v2]
tags:
- 'v*'
pull_request:
branches: [ main, 'release/v*', 'dev-v*' ]
branches: [main, v2, 'release/v*', 'dev-v*']

permissions:
contents: read

concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
test:
name: Unit tests (Node ${{ matrix.node-version }})
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
node-version: [18.x] # Build on Node.js 18
node-version: ['20.x', '22.x']
steps:
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: npm

- name: Install dependencies
run: npm ci

- name: Typecheck
run: npm run typecheck

- name: Build
run: npm run build

- name: Unit tests
run: npm test

- name: Installer tests
run: npm test -w @fleetbase/installer

e2e:
name: End-to-end against the Registry Service
runs-on: ubuntu-latest
needs: test
env:
PHP_CLI_SERVER_WORKERS: 4
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

# The registry's release branch: CLI v2 ships with Registry Service v2.0.0, and the CLI's newer commands
# (the extension.json listing, compat.extensions) need endpoints the old `v2` branch never had.
- name: Check out the Registry Service (release/v2.0.0)
uses: actions/checkout@v4
with:
repository: fleetbase/registry
ref: release/v2.0.0
path: registry

- uses: actions/setup-node@v4
with:
node-version: '22.x'
cache: npm

- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- name: Set up PHP
uses: shivammathur/setup-php@v2
with:
php-version: '8.3'
extensions: mbstring, intl, bcmath, zip, pdo_sqlite, sqlite3, phar, zlib
coverage: none
tools: composer:v2

- name: Cache Composer packages
uses: actions/cache@v4
with:
path: ~/.composer/cache
key: composer-${{ runner.os }}-8.3-${{ hashFiles('registry/composer.lock') }}
restore-keys: composer-${{ runner.os }}-8.3-

- name: Prepare the service
working-directory: registry
# artisan serve reads .env, not the job environment; checks run in the request (sync queue)
run: |
composer install --no-interaction --prefer-dist --no-progress
cp .env.example .env
sed -i 's/^QUEUE_CONNECTION=.*/QUEUE_CONNECTION=sync/; s/^MAIL_MAILER=.*/MAIL_MAILER=log/' .env
php artisan key:generate --ansi
touch database/database.sqlite
php artisan migrate --seed --force
php artisan registry:seed --seed-release

- name: Start the service
working-directory: registry
run: |
php artisan serve --host=127.0.0.1 --port=8000 > storage/logs/serve.log 2>&1 &
for i in $(seq 1 30); do curl -sf http://127.0.0.1:8000/up > /dev/null && exit 0; sleep 1; done
cat storage/logs/serve.log; exit 1

- name: Install and build the CLI
run: |
npm ci
npm run build

- name: End-to-end
env:
FLB_E2E_REGISTRY: http://127.0.0.1:8000
FLB_E2E_SERVICE: ${{ github.workspace }}/registry
run: bash test/e2e/run.sh

- name: Install Dependencies
run: npm install
- name: Service logs
if: failure()
working-directory: registry
run: |
cat storage/logs/serve.log || true
tail -n 200 storage/logs/laravel.log || true

npm_publish:
needs: build
needs: [test, e2e]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- uses: actions/setup-node@v4
with:
node-version: '22.x'
registry-url: 'https://registry.npmjs.org'

- name: Setup Node.js 18.x
uses: actions/setup-node@v2
with:
node-version: 18.x
- name: Install dependencies
run: npm ci

- name: Install Dependencies
run: npm install
- name: Publish @fleetbase/cli
run: npm publish --access public --tag ${{ contains(github.ref_name, '-') && 'next' || 'latest' }}
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

- name: Set up npm
run: echo "//registry.npmjs.org/:_authToken=${{ secrets.NPM_AUTH_TOKEN }}" > ~/.npmrc
- name: Publish @fleetbase/installer when its version is new
run: |
version=$(node -p "require('./packages/installer/package.json').version")
if npm view "@fleetbase/installer@$version" version >/dev/null 2>&1; then
echo "@fleetbase/installer@$version is already published"
else
npm publish -w @fleetbase/installer --access public
fi
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

- name: Publish
run: npm publish --access public

github_publish:
needs: build
needs: [test, e2e]
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4

- name: Setup Node.js 18.x
uses: actions/setup-node@v2
- uses: actions/setup-node@v4
with:
node-version: 18.x
node-version: '22.x'
registry-url: 'https://npm.pkg.github.com'
scope: '@fleetbase'

- name: Install Dependencies
run: npm install

- name: Configure npm for GitHub registry
run: |
echo "@fleetbase:registry=https://npm.pkg.github.com/" >> ~/.npmrc
echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> ~/.npmrc
- name: Install dependencies
run: npm ci

- name: Publish to GitHub registry
- name: Publish to GitHub Packages
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
/node_modules
.npmrc
/packages/*/node_modules
/dist
/coverage
.npmrc
Loading
Loading