Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

release-please-example

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

release-please-example

  • 0.1.0
  • unpublished
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-85.71%
Maintainers
1
Weekly downloads
 
Created
Source

release-please-example

Added github/workflow/release-please.yml

  • Use git commit --allow-empty -m "chore: release 0.0.3" -m "Release-As: 0.0.3" && ggp

This creates a PR and email.

  • Merge the PR

This will email you a release note and publish a new release.

Not able to run GitHub action to publish npm package

Add NPM_TOKEN with automation

GitHub: Not to Environments create it to Secrets Actions

release-please

This will publish NPM when you merge a PR.

on:
  push:
    branches:
      - main
      
name: release-please
jobs:
  release-please:
    runs-on: ubuntu-latest
    steps:
      - uses: google-github-actions/release-please-action@v3
        id: release
        with:
          release-type: node
          package-name: release-please-action
      - name: Checkout Repo
        uses: actions/checkout@v3
        if: ${{ steps.release.outputs.release_created }}
      - name: Setupt Node.js 16.x 
        uses: actions/setup-node@v3
        with:
          node-version: 16
        if: ${{ steps.release.outputs.release_created }}
      - name: Install Dependencies 
        run: npm install
        if: ${{ steps.release.outputs.release_created }}
      - name: Creating .npmrc
        run: |
          cat << EOF > "$HOME/.npmrc"
            //registry.npmjs.org/:_authToken=$NPM_TOKEN
          EOF
        env:
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
        if: ${{ steps.release.outputs.release_created }}
      - name: Create a package and Publish to npm 
        run: npm run package
        if: ${{ steps.release.outputs.release_created }}
      - name: Change dir
        run: cd package
        if: ${{ steps.release.outputs.release_created }}
      - name: Run npm publish
        run: npm publish
        env:
          NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
        if: ${{ steps.release.outputs.release_created }}

add npm-publish.yml

# 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://help.github.com/actions/language-and-framework-guides/publishing-nodejs-packages

name: NPM 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: npm ci

  publish-npm:
    needs: build
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v3
      - uses: actions/setup-node@v3
        with:
          node-version: 16
          registry-url: https://registry.npmjs.org/
      - run: npm install
      - run: npm run package
        env:
          NPM_TOKEN: ${{secrets.NPM_TOKEN}}

Add NPM_TOKEN to release-please-example repo

FAQs

Package last updated on 19 Sep 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc