From f219c4eec722748244b797570392d3b9d7b33175 Mon Sep 17 00:00:00 2001 From: JuliusKoronciCH <165957874+JuliusKoronciCH@users.noreply.github.com> Date: Thu, 4 Apr 2024 08:20:38 +0200 Subject: [PATCH] Feat/npm publish (#5) * add publish step for npm * update publishing to use yarn and only on merge to main --- .github/workflows/ci.yml | 12 +++++++++++- package.json | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 69a2aae..a7d688a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ on: branches: [main, master] jobs: - ci-checks: + ci-checks-and-publish: timeout-minutes: 60 runs-on: ubuntu-latest @@ -18,9 +18,11 @@ jobs: uses: actions/setup-node@v3 with: node-version: 20 + registry-url: https://registry.npmjs.org/ - name: Install Dependencies run: corepack enable + if: ${{ !steps.cache.outputs.cache-hit }} - name: Cache Dependencies (Yarn Berry) uses: actions/cache@v3 @@ -57,3 +59,11 @@ jobs: name: playwright-report path: playwright-report/ retention-days: 30 + + - name: Publish to npm (on merge to main) + if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }} + run: | + yarn version prerelease --preid=beta -m "Release beta %s" + yarn publish --tag beta + env: + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} diff --git a/package.json b/package.json index c4ea04e..9513f74 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "dantian", "private": true, - "version": "1.0.0", + "version": "0.0.1", "type": "module", "main": "./dist/dantian.cjs", "module": "./dist/dantian.js",