From a907ccb7d1d07e3ced56ac80706937d0bcd77bf4 Mon Sep 17 00:00:00 2001
From: Eric Liu <ericyl.us@gmail.com>
Date: Tue, 14 May 2024 21:19:10 -0700
Subject: [PATCH] ci: add github pages, publish workflows

---
 .github/workflows/ci.yml             |   2 ++
 .github/workflows/github-pages.yml   |  24 ++++++++++++++++++++++++
 .github/workflows/publish-to-npm.yml |  22 ++++++++++++++++++++++
 bun.lockb                            | Bin 69662 -> 59120 bytes
 package.json                         |   8 +++-----
 5 files changed, 51 insertions(+), 5 deletions(-)
 create mode 100644 .github/workflows/github-pages.yml
 create mode 100644 .github/workflows/publish-to-npm.yml

diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index dd4a086..2cd008c 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -9,6 +9,8 @@ jobs:
     steps:
       - uses: actions/checkout@v4
       - uses: oven-sh/setup-bun@v1
+        with:
+          bun-version: 1.1.8
 
       - name: Install dependencies
         run: bun install
diff --git a/.github/workflows/github-pages.yml b/.github/workflows/github-pages.yml
new file mode 100644
index 0000000..3f60123
--- /dev/null
+++ b/.github/workflows/github-pages.yml
@@ -0,0 +1,24 @@
+on:
+  push:
+    branches: [master]
+
+jobs:
+  deploy:
+    runs-on: ubuntu-latest
+    steps:
+      - uses: actions/checkout@v4
+      - uses: oven-sh/setup-bun@v1
+        with:
+          bun-version: 1.1.8
+
+      - name: Install dependencies
+        run: bun install
+
+      - name: Build app
+        run: bun run build
+
+      - name: Deploy to GitHub Pages
+        uses: peaceiris/actions-gh-pages@v4
+        with:
+          github_token: ${{ secrets.GITHUB_TOKEN }}
+          publish_dir: dist
\ No newline at end of file
diff --git a/.github/workflows/publish-to-npm.yml b/.github/workflows/publish-to-npm.yml
new file mode 100644
index 0000000..3dab4cf
--- /dev/null
+++ b/.github/workflows/publish-to-npm.yml
@@ -0,0 +1,22 @@
+on:
+  push:
+    tags:
+      - "v*"
+
+jobs:
+  build:
+    runs-on: ubuntu-latest
+    permissions:
+      contents: read
+      id-token: write
+    steps:
+      - uses: actions/checkout@v4
+      - uses: actions/setup-node@v4
+        with:
+          node-version: "20.x"
+          registry-url: "https://registry.npmjs.org"
+
+      - name: Publish package
+        env:
+          NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
+        run: npm publish --provenance --access public
diff --git a/bun.lockb b/bun.lockb
index 55ac0e3dce1dfa998bd8c0493e86e5956b41162e..aeb5f228e50b920c9c0abf9a0c95e80467570bfc 100755
GIT binary patch
delta 3136
zcmeH}U2GIp7=~xsr9x>16j@_!HbA?jC0*H4SVPgSP!v>ZD=G?#R9cFW3rQP7yjddw
zyBehRK&@aZq-f9-wXVw4ilrJwRHS!W8lv715;bYO^1{F8ogR}RK`u>9`X<l3^L^hr
zbI#1po-^HtLStvL+he8MN`9}-9zC^lbob)gKk82oJ=I+Ay|A;bKmBUo$oIdM?A>_5
z@%2i_+DKOKfxaCVLz$I1KZIP@G^DFDb$KVFFXo3**)$SY!wi@Nv%rNgNb(RAKo%5&
zbR}222*_uH6m*SQ<Ty+G0w?}}#nz*K)^X%&SZecSHt)MRkqoDF`Er|;YnpKz%hkIQ
zbUTYc3cB)(L7o69=(=8&pS{#I?k$dUuV3QiUtJBWZC$Q`lA!0j0;Hh3=6qF2>MF9e
ze(h3M?|VRAXX`;%z8*B{8e5m^HrCo$uKGhZ4!ZiUbDWf;2{eG7Un59CSHmWdZwBc~
zu6E6!i97*P(5Dc$f?mUC7~daw7lAtN21%~?S?g`MB-b51rvL?g67gP8zjl!1iaS94
z3`p|n(6f|-8XN&hu9+XT-ixb#400d?lH4_WmWS(g+2cx~%em_Pes$b+wGVB4SvUE&
zM&jyq!nTsD*T*)N>t;U%wfhWQv$`hC!*rZ4bU<?TI&J++T#~ET*P!|tkmSmr1?7i9
z3i@Q???CktkmQQb@l;1^ruhF;<@G*^|9H7s<_}t=86dePS8P3sOL9$aV!7cVX!+4Y
znpkcomK$D!|J8EiW@XN==viborI(tzyims5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-    "predeploy": "rollup -c",
-    "deploy": "gh-pages -d dist",
-    "test": "svelte-check --workspace test"
+    "dev": "bun --bun rollup -cw",
+    "build": "bun --bun rollup -c",
+    "test": "bun --bun svelte-check --workspace test"
   },
   "devDependencies": {
-    "gh-pages": "^4.0.0",
     "svelte": "^4.2.17",
     "svelte-check": "^3.7.1",
     "svelte-readme": "^3.6.3"