Skip to content

Commit

Permalink
feat: update workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
Redouane64 committed Feb 8, 2024
1 parent 699f387 commit 39da774
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
22 changes: 3 additions & 19 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,16 @@
name: Publish Package to NPM
name: Build & Test Package

on:
push:
tags:
- v*
branches: [develop]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Create Release And Publish To NPM
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
tag: ${{ github.ref_name }}
run: |
gh release create "$tag" \
--repo="$GITHUB_REPOSITORY" \
--title="${GITHUB_REPOSITORY#*/} ${tag#v}" \
--prerelease
--latest
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.TOPPASS_NPM_TOKEN }}
- run: npm run build
20 changes: 20 additions & 0 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Publish Package to NPM

on:
push:
branches: [develop]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: '18.x'
registry-url: 'https://registry.npmjs.org'
- run: npm ci
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.TOPPASS_NPM_TOKEN }}

0 comments on commit 39da774

Please sign in to comment.