ci: use ubuntu-24.04 + oven/bun:1 + REGISTRY_TOKEN (match the repo's runners)
The workflow used runs-on: ubuntu-latest, which no Gitea runner is labeled with, so nothing ran. Mirror the main repo's sdk-publish.yml: ubuntu-24.04 runner, the oven/bun:1 container (install git+CA certs for checkout), and auth via the shared REGISTRY_TOKEN secret written to ~/.npmrc (covers @punktfunk + @unom). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
+36
-18
@@ -1,24 +1,33 @@
|
|||||||
# CI for @punktfunk/plugin-rom-manager (Gitea Actions). Installs resolve `@punktfunk/*` and `@unom/*`
|
# CI for @punktfunk/plugin-rom-manager (Gitea Actions). Mirrors the main repo's sdk-publish.yml:
|
||||||
# (the SPA's design system) from the Gitea npm registry via the bunfig scope maps; `effect` comes from
|
# ubuntu-24.04 runner + the oven/bun:1 container, auth via the shared REGISTRY_TOKEN secret.
|
||||||
# npm. The GITEA_NPM_TOKEN secret authenticates registry reads. Publish runs on a `v*` tag.
|
# Installs resolve @punktfunk/* + @unom/* (the SPA's design system) from the Gitea registry via the
|
||||||
|
# bunfig scope maps; `effect` comes from npm. Publish runs on a `v*` tag.
|
||||||
name: CI
|
name: CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [main]
|
branches: [main]
|
||||||
tags: ["v*"]
|
tags: ['v*']
|
||||||
pull_request:
|
pull_request:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-24.04
|
||||||
|
container:
|
||||||
|
image: oven/bun:1
|
||||||
|
timeout-minutes: 15
|
||||||
steps:
|
steps:
|
||||||
|
# oven/bun's slim base ships neither git nor a CA bundle — actions/checkout's HTTPS fetch needs both.
|
||||||
|
- name: Install git + CA certs
|
||||||
|
run: apt-get update && apt-get install -y --no-install-recommends ca-certificates git nodejs
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: oven-sh/setup-bun@v2
|
|
||||||
with:
|
|
||||||
bun-version: latest
|
|
||||||
- name: Registry auth
|
- name: Registry auth
|
||||||
run: echo "//git.unom.io/api/packages/unom/npm/:_authToken=${{ secrets.GITEA_NPM_TOKEN }}" > ~/.npmrc
|
env:
|
||||||
|
TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
run: |
|
||||||
|
test -n "$TOKEN" || { echo "REGISTRY_TOKEN secret is empty"; exit 1; }
|
||||||
|
printf '//git.unom.io/api/packages/unom/npm/:_authToken=%s\n' "$TOKEN" > "$HOME/.npmrc"
|
||||||
- name: Install
|
- name: Install
|
||||||
run: bun install --frozen-lockfile
|
run: bun install --frozen-lockfile
|
||||||
- name: Lint & format
|
- name: Lint & format
|
||||||
@@ -39,17 +48,26 @@ jobs:
|
|||||||
publish:
|
publish:
|
||||||
needs: build
|
needs: build
|
||||||
if: startsWith(github.ref, 'refs/tags/v')
|
if: startsWith(github.ref, 'refs/tags/v')
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-24.04
|
||||||
|
container:
|
||||||
|
image: oven/bun:1
|
||||||
|
timeout-minutes: 15
|
||||||
steps:
|
steps:
|
||||||
|
- name: Install git + CA certs
|
||||||
|
run: apt-get update && apt-get install -y --no-install-recommends ca-certificates git nodejs
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
- uses: oven-sh/setup-bun@v2
|
|
||||||
with:
|
|
||||||
bun-version: latest
|
|
||||||
- name: Registry auth
|
- name: Registry auth
|
||||||
run: echo "//git.unom.io/api/packages/unom/npm/:_authToken=${{ secrets.GITEA_NPM_TOKEN }}" > ~/.npmrc
|
env:
|
||||||
|
TOKEN: ${{ secrets.REGISTRY_TOKEN }}
|
||||||
|
run: |
|
||||||
|
test -n "$TOKEN" || { echo "REGISTRY_TOKEN secret is empty"; exit 1; }
|
||||||
|
printf '//git.unom.io/api/packages/unom/npm/:_authToken=%s\n' "$TOKEN" > "$HOME/.npmrc"
|
||||||
- name: Install
|
- name: Install
|
||||||
run: bun install --frozen-lockfile
|
run: bun install --frozen-lockfile
|
||||||
- name: Build (backend + SPA)
|
- name: Tag matches package version
|
||||||
run: bun run build:all
|
run: |
|
||||||
- name: Publish to the Gitea npm registry
|
TAG="${GITHUB_REF_NAME#v}"
|
||||||
run: npm publish --registry https://git.unom.io/api/packages/unom/npm/
|
PKG="$(node -p "require('./package.json').version")"
|
||||||
|
test "$TAG" = "$PKG" || { echo "tag $GITHUB_REF_NAME != package version $PKG"; exit 1; }
|
||||||
|
- name: Publish (prepublishOnly builds backend + SPA)
|
||||||
|
run: bun publish
|
||||||
|
|||||||
Reference in New Issue
Block a user