diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..3531c63 --- /dev/null +++ b/.github/workflows/publish.yml @@ -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 diff --git a/.gitignore b/.gitignore index c6bba59..95ae53a 100644 --- a/.gitignore +++ b/.gitignore @@ -128,3 +128,7 @@ dist .yarn/build-state.yml .yarn/install-state.gz .pnp.* + + +bunfig.toml +*.bak \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 4b62e3e..ed6ed12 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,3 @@ { - "conventionalCommits.scopes": ["docs"] + "conventionalCommits.scopes": ["docs", "build"] } diff --git a/federation/package.json b/federation/package.json index 20664a8..9ccc748 100644 --- a/federation/package.json +++ b/federation/package.json @@ -40,7 +40,8 @@ "exports": { ".": { "import": "./dist/index.js", - "default": "./dist/index.js" + "default": "./dist/index.js", + "types": "./dist/index.d.ts" } }, "funding": {