Skip to content
Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 

Repository files navigation

semrel-release

Release npm package to github and npm registry

Usage

This action was created to tackle Yarn2 mono-repos where individual workspace releases are required. It releases npm packages to github and npm registry based on provided semantic version, tag, and change log.

Use semrel-analyze to obtain these input values based on Conventional Commits.

Example

name: ci-cd

on: [push]

jobs:
  cd:
    runs-on: ubuntu-latest
    strategy:
      max-parallel: 1 # to avoid git conflicts
      matrix:
        workspace:
          - lib1
          - lib2
          - service

    steps:
      - uses: actions/checkout@v3
        with:
          fetch-depth: 0

      - name: install node 16
        uses: actions/setup-node@v3
        with:
          node-version: 16.x

      - name: analyze ${{ matrix.workspace }}
        id: analyze
        uses: rotorsoft/semrel-analyze@v1
        with:
          package: "@rotorsoft/${{ matrix.workspace }}"
          directory: "workspace/${{ matrix.workspace }}"

      - name: release ${{ matrix.workspace }}
        uses: rotorsoft/semrel-release@v1
        with:
          github-token: "${{ secrets.GITHUB_TOKEN }}"
          npm-registry: "registry.npmjs.org"
          npm-token: "${{ secrets.NPM_TOKEN }}"
          npm-access: "public"
          user: "rotorsoft"
          email: "rotorsoft@outlook.com"
          package: "@rotorsoft/${{ matrix.workspace }}"
          directory: "workspace/${{ matrix.workspace }}"
          tag: "${{ steps.analyze.outputs.next-tag }}"
          version: "${{ steps.analyze.outputs.next-version }}"
          change-log: "${{ steps.analyze.outputs.change-log }}"

Change Log

  • v2: adding GITHUB_REF when pulling and pushing changes
  • v3.0.0: adding pnpm support

Tagging releases

git tag -a v1.1.0 -m "Release v1.1.0"
git push origin v1.1.0

About

Release npm package to github and npm registry

Resources

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors