Skip to content

Commit

Permalink
Feat/npm publish (#5)
Browse files Browse the repository at this point in the history
* add publish step for npm

* update publishing to use yarn and only on merge to main
  • Loading branch information
JuliusKoronciCH authored Apr 4, 2024
1 parent 34031bf commit f219c4e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
12 changes: 11 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
branches: [main, master]

jobs:
ci-checks:
ci-checks-and-publish:
timeout-minutes: 60
runs-on: ubuntu-latest

Expand All @@ -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
Expand Down Expand Up @@ -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 }}
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down

0 comments on commit f219c4e

Please sign in to comment.