docs: add installation instructions for Forgejo registry and update package.json for publishing
This commit is contained in:
parent
0a86eb1dd9
commit
9d1721bc3a
3 changed files with 51 additions and 0 deletions
36
.forgejo/workflows/publish-forgejo-npm.yml
Normal file
36
.forgejo/workflows/publish-forgejo-npm.yml
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
name: Publish to Forgejo npm Registry
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- "v*"
|
||||
workflow_dispatch:
|
||||
|
||||
jobs:
|
||||
publish:
|
||||
runs-on: native
|
||||
env:
|
||||
NODE_AUTH_TOKEN: ${{ secrets.FORGEJO_NPM_TOKEN }}
|
||||
REGISTRY_URL: https://git.mizuki.guru/api/packages/imnyang/npm/
|
||||
SCOPE: imnyang
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: https://code.forgejo.org/actions/checkout@v4
|
||||
|
||||
- name: Configure npm auth for Forgejo registry
|
||||
run: |
|
||||
REGISTRY_HOST="${REGISTRY_URL#https://}"
|
||||
REGISTRY_HOST="${REGISTRY_HOST#http://}"
|
||||
{
|
||||
echo "@${SCOPE}:registry=${REGISTRY_URL}"
|
||||
echo "//${REGISTRY_HOST}:_authToken=${NODE_AUTH_TOKEN}"
|
||||
echo "always-auth=true"
|
||||
} > "$HOME/.npmrc"
|
||||
|
||||
- name: Install, build, and publish in Nix shell
|
||||
run: |
|
||||
nix shell nixpkgs#nodejs_24 nixpkgs#pnpm -c sh -lc '
|
||||
pnpm install --frozen-lockfile
|
||||
pnpm build
|
||||
pnpm publish --no-git-checks --registry "$REGISTRY_URL"
|
||||
'
|
||||
Loading…
Add table
Add a link
Reference in a new issue