From 3d675e49a86bb5ff458ea69101672ddadf2616bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luc=C3=A0s?= <86352901+LucasVbr@users.noreply.github.com> Date: Thu, 8 May 2025 01:30:48 +0200 Subject: [PATCH] feat: Add Github Action to publish package to NPM --- .github/workflows/publish.yaml | 28 ++++++++++++++++++++++++++++ .github/workflows/release.yaml | 19 +++++++++++++++++++ 2 files changed, 47 insertions(+) create mode 100644 .github/workflows/publish.yaml create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..86f9fc7 --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,28 @@ +name: Publish to npm + +on: + push: + tags: + - "v*.*.*" + +jobs: + publish: + runs-on: ubuntu-latest + + steps: + - name: Checkout repo + uses: actions/checkout@v4 + + - name: Install Bun + uses: oven-sh/setup-bun@v1 + + - name: Install dependencies + run: bun install + + - name: Build with Bun + run: bun run build + + - name: Publish to npm + run: npm publish --access public + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..39f31fd --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,19 @@ +name: GitHub Release + +on: + push: + tags: + - 'v*.*.*' + +jobs: + release: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Generate release notes + uses: softprops/action-gh-release@v1 + with: + generate_release_notes: true