Add local CLI #144

Merged
schmelczer merged 16 commits from asch/local-cli into main 2025-10-21 22:45:47 +01:00
3 changed files with 45 additions and 39 deletions
Showing only changes of commit 27adbf6660 - Show all commits

Rename files

Andras Schmelczer 2025-10-21 20:50:21 +01:00

View file

@ -50,7 +50,7 @@ jobs:
with: with:
context: frontend context: frontend
file: frontend/local-client-cli/Dockerfile file: frontend/local-client-cli/Dockerfile
platforms: linux/amd64,linux/arm64 platforms: linux/amd64
push: true push: true
tags: ${{ steps.meta.outputs.tags }} tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }} labels: ${{ steps.meta.outputs.labels }}
@ -62,41 +62,3 @@ jobs:
TAGS: ${{ steps.meta.outputs.tags }} TAGS: ${{ steps.meta.outputs.tags }}
DIGEST: ${{ steps.build-and-push.outputs.digest }} DIGEST: ${{ steps.build-and-push.outputs.digest }}
run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST} run: echo "${TAGS}" | xargs -I {} cosign sign --yes {}@${DIGEST}
publish-npm:
runs-on: self-hosted
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js environment
uses: actions/setup-node@v4.2.0
with:
node-version: "22.x"
check-latest: true
registry-url: 'https://npm.pkg.github.com'
scope: '@schmelczer'
- name: Install dependencies
run: |
cd frontend
npm ci
- name: Build CLI
run: |
cd frontend/local-client-cli
npm run build
- name: Publish to GitHub Packages
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd frontend/local-client-cli
# Update package.json to use scoped name for GitHub Packages
npm version --no-git-tag-version ${GITHUB_REF#refs/tags/}
npm publish

44
.github/workflows/publish-npm.yml vendored Normal file
View file

@ -0,0 +1,44 @@
name: Publish CLI
on:
push:
tags: ["*"]
pull_request:
branches: ["main"]
env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}-cli
jobs:
publish-npm:
runs-on: self-hosted
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Setup Node.js environment
uses: actions/setup-node@v4.2.0
with:
node-version: "22.x"
check-latest: true
registry-url: 'https://npm.pkg.github.com'
scope: '@schmelczer'
- name: Install dependencies
run: |
cd frontend
npm ci
npm run build
- name: Publish to GitHub Packages
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
cd frontend/local-client-cli
npm publish