mirror of
https://github.com/versia-pub/api.git
synced 2025-12-06 00:18:19 +01:00
feat(build): 👷 Add automatic CI build and deploy to NPM
This commit is contained in:
parent
bf8898acee
commit
8f9bb6c9c6
31
.github/workflows/publish.yml
vendored
Normal file
31
.github/workflows/publish.yml
vendored
Normal file
|
|
@ -0,0 +1,31 @@
|
||||||
|
name: Build & Publish NPM Package
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
branches: [main]
|
||||||
|
tags: ["v*.*.*"]
|
||||||
|
|
||||||
|
# Allows you to run this workflow manually from the Actions tab
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
# Build job
|
||||||
|
build:
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- uses: oven-sh/setup-bun@v1
|
||||||
|
|
||||||
|
- name: Create bunfig.toml with NPM token (GitHub Secrets)
|
||||||
|
run: echo "[install]\nregistry = { url = \"https://registry.npmjs.org/\", token = "${{ secrets.NPM_TOKEN }}" }" > bunfig.toml
|
||||||
|
|
||||||
|
- name: Install dependencies
|
||||||
|
run: bun Install
|
||||||
|
|
||||||
|
- name: Build
|
||||||
|
run: bun run build
|
||||||
|
|
||||||
|
- name: Publish to NPM
|
||||||
|
run: bunx @morlay/bunpublish --provenance
|
||||||
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -128,3 +128,7 @@ dist
|
||||||
.yarn/build-state.yml
|
.yarn/build-state.yml
|
||||||
.yarn/install-state.gz
|
.yarn/install-state.gz
|
||||||
.pnp.*
|
.pnp.*
|
||||||
|
|
||||||
|
|
||||||
|
bunfig.toml
|
||||||
|
*.bak
|
||||||
2
.vscode/settings.json
vendored
2
.vscode/settings.json
vendored
|
|
@ -1,3 +1,3 @@
|
||||||
{
|
{
|
||||||
"conventionalCommits.scopes": ["docs"]
|
"conventionalCommits.scopes": ["docs", "build"]
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -40,7 +40,8 @@
|
||||||
"exports": {
|
"exports": {
|
||||||
".": {
|
".": {
|
||||||
"import": "./dist/index.js",
|
"import": "./dist/index.js",
|
||||||
"default": "./dist/index.js"
|
"default": "./dist/index.js",
|
||||||
|
"types": "./dist/index.d.ts"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue