Skip to content

Commit

Permalink
update flow
Browse files Browse the repository at this point in the history
  • Loading branch information
jscodelover committed Nov 24, 2023
1 parent 70a67b8 commit 9b5545e
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 8 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/main.yml
@@ -0,0 +1,31 @@
name: Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }} # make sure 2 publish workflows are not happening on the same time

jobs:
release:
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout Repo
uses: actions/checkout@v4

# Setup .npmrc file to publish to GitHub Packages
- uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://npm.pkg.github.com'

- name: Install Dependencies
run: npm install --frozen-lockfile

- name: Check linting
run: npm run lint && npm run format

#- name: Testing
#run:
11 changes: 4 additions & 7 deletions .github/workflows/release.yml
@@ -1,11 +1,8 @@
name: Release

on:
push:
branches:
- main

concurrency: ${{ github.workflow }}-${{ github.ref }} # make sure 2 publish workflows are not happening on the same time
release:
types: [created]

jobs:
release:
Expand All @@ -19,7 +16,7 @@ jobs:
- uses: actions/setup-node@v3
with:
node-version: '20.x'
registry-url: 'https://npm.pkg.github.com'
registry-url: 'https://registry.npmjs.org'

- name: Install Dependencies
run: npm install --frozen-lockfile
Expand All @@ -30,4 +27,4 @@ jobs:
- name: Package Publishing
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
5 changes: 4 additions & 1 deletion package.json
Expand Up @@ -24,10 +24,13 @@
"types": "./dist/index.d.ts"
}
},
"publishConfig": {
"access": "public"
},
"scripts": {
"start": "npm run lint && npm run dev-tsc",
"build": "tsup",
"release": "npm run build && npm publish --access public",
"release": "npm run build && npm publish",
"dev-tsc": "tsup --watch",
"lint": "eslint ./src",
"format": "prettier ./src -c -w --ignore-path .gitignore",
Expand Down

0 comments on commit 9b5545e

Please sign in to comment.