No description
- TypeScript 99.8%
- CSS 0.2%
|
All checks were successful
Build and Publish / publish (push) Successful in 12s
Reviewed-on: #6 |
||
|---|---|---|
| .forgejo/workflows | ||
| scripts | ||
| src | ||
| tests | ||
| .gitignore | ||
| .npmrc | ||
| CHANGELOG.md | ||
| package-lock.json | ||
| package.json | ||
| README.md | ||
| tsconfig.build.json | ||
| tsconfig.json | ||
Introduction
<INTRO TEXT>
Table of Contents
Quick Start
<QUICK START INSTRUCTIONS>
Documentation
<DOCUMENTATION>
DevOps
npm install
npm update
npm run clean
npm run build
npm run tests
npm run dev
git fetch upstream
git fetch origin
git fetch . upstream/main:origin/main
git fetch . origin/main:main
git push origin main
git merge --ff-only main
git push
Change Management
- Create a new branch for the change.
- Make the changes and commit.
- Bump the version in
package.json. - Add an entry for the new version in
CHANGELOG.md. - Pull-request the branch.
- Ensure package artifacts are current.
- Publish.
Registry
.npmrc:
@vode-app:registry=https://git.chimps.quest/api/packages/vode-app/npm/
//git.chimps.quest/api/packages/vode-app/npm/:_authToken=${VODE_APP_REGISTRY_AUTH_TOKEN}
or bunfig.toml:
[install.scopes]
"vode-app" = { url = "https://git.chimps.quest/api/packages/vode-app/npm/", token = "$VODE_APP_REGISTRY_AUTH_TOKEN" }
# git.chimps.quest/api/packages/vode-app/npm/
export VODE_APP_REGISTRY_AUTH_TOKEN=<AUTH_TOKEN>
# or
$env:VODE_APP_REGISTRY_AUTH_TOKEN = "<AUTH_TOKEN>"
npm publish
CI/CD Workflows
Build and Publish
⚠️ .npmrc configuring the package registry and its authentication token is required for the workflow to work.
| Parameter | Type | Description |
|---|---|---|
RUNNER_LABEL |
Variable | The label of the runner to use for the workflow. |
ACCESS_TOKEN |
Secret | The authentication token for the package registry. |
.github/workflows/build-publish.yml:
name: Build and Publish
on:
push:
branches:
- main
jobs:
publish:
runs-on: ${{ vars.RUNNER_LABEL }}
steps:
- uses: actions/checkout@v4
- name: Install
env:
VODE_APP_REGISTRY_AUTH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: npm ci
- name: Build
run: npm run build
- name: Test
run: npm run tests
- name: Publish
env:
VODE_APP_REGISTRY_AUTH_TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: |
PKG_NAME=$(node -p "require('./package.json').name")
PKG_VERSION=$(node -p "require('./package.json').version")
NPM_TAG="latest"
if echo "$PKG_VERSION" | grep -q -- '-'; then
NPM_TAG="next"
fi
if npm view "$PKG_NAME@$PKG_VERSION" version >/dev/null 2>&1; then
echo "$PKG_NAME@$PKG_VERSION already published, skipping."
else
npm publish --tag "$NPM_TAG"
fi