Skip to content

Commit

Permalink
add deploy action
Browse files Browse the repository at this point in the history
Create npm-publish-github-packages.yml

add deploy action

fix action
  • Loading branch information
Martin PELCAT committed Aug 2, 2023
1 parent f8d2e97 commit 9dd16b3
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 2 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/deploy_npm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Publish Package to npmjs

on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
# Setup .npmrc file to publish to npm
- uses: actions/setup-node@v3
with:
node-version: '16.x'
registry-url: 'https://registry.npmjs.org'
- run: yarn install
- run: yarn build
- run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
36 changes: 36 additions & 0 deletions .github/workflows/npm-publish-github-packages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# This workflow will run tests using node and then publish a package to GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

name: Node.js Package

on:
release:
types: [created]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
- run: yarn install
- run: yarn build

publish-gpr:
needs: build
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 16
registry-url: https://npm.pkg.github.com/
- run: yarn install
- run: yarn build
env:
NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}}
3 changes: 1 addition & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ steps.get_version.outputs.version }} # Use the version from package.json as the tag_name
release_name: Release ${{ steps.get_version.outputs.version }} # Use the version from package.json as the release_name
body: This is the release body. # Add release notes or any description here
release_name: ${{ steps.get_version.outputs.version }} # Use the version from package.json as the release_name
draft: false
prerelease: false

0 comments on commit 9dd16b3

Please sign in to comment.