From 44a7fd72e88508c46c84d2debf1ff646f4648ca7 Mon Sep 17 00:00:00 2001
From: Marcus Schiesser <mail@marcusschiesser.de>
Date: Fri, 26 Apr 2024 14:09:25 +0800
Subject: [PATCH] ci: publish github release on tag pushes (#771)

---
 .github/workflows/publish_github.yml | 37 ++++++++++++++++++++++++++++
 packages/core/.gitignore             |  3 ++-
 2 files changed, 39 insertions(+), 1 deletion(-)
 create mode 100644 .github/workflows/publish_github.yml

diff --git a/.github/workflows/publish_github.yml b/.github/workflows/publish_github.yml
new file mode 100644
index 000000000..86972fb70
--- /dev/null
+++ b/.github/workflows/publish_github.yml
@@ -0,0 +1,37 @@
+name: Publish to GitHub Releases
+
+on:
+  push:
+    tags:
+      - "llamaindex@*"
+
+jobs:
+  build-and-publish:
+    runs-on: ubuntu-latest
+    steps:
+      - name: Checkout Repo
+        uses: actions/checkout@v4
+
+      - uses: pnpm/action-setup@v3
+
+      - name: Setup Node.js
+        uses: actions/setup-node@v4
+        with:
+          node-version-file: ".nvmrc"
+          cache: "pnpm"
+
+      - name: Install dependencies
+        run: pnpm install
+
+      - name: Build tarball
+        run: |
+          pnpm pack
+        working-directory: packages/core
+
+      - name: Create release
+        uses: ncipollo/release-action@v1
+        with:
+          artifacts: "packages/core/llamaindex-*.tgz"
+          name: Release ${{ github.ref }}
+          bodyFile: "packages/core/CHANGELOG.md"
+          token: ${{ secrets.GITHUB_TOKEN }}
diff --git a/packages/core/.gitignore b/packages/core/.gitignore
index 485ee85c2..8c7df6be2 100644
--- a/packages/core/.gitignore
+++ b/packages/core/.gitignore
@@ -1,3 +1,4 @@
 .turbo
 /README.md
-LICENSE
\ No newline at end of file
+LICENSE
+*.tgz
\ No newline at end of file
-- 
GitLab