Skip to content

Commit

Permalink
feat: add npm publish pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
msobiecki committed Jul 17, 2023
1 parent e2888ca commit e65b4c2
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 22 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Run publish

# Controls when the action will run.
on:
# Triggers the workflow on push event but only for the master branch
push:
branches: [master]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
publish:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# The type of node version that the job will run on
strategy:
matrix:
node-version: [18.x]

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

# Use node
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v1
with:
node-version: ${{ matrix.node-version }}

# Run version bump step
- name: Run version bump
uses: phips28/gh-action-bump-version@v10.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Get tag step
- name: Get tag
id: tag
uses: WyriHaximus/github-action-get-previous-tag@v1
with:
fallback: 1.0.0 # Optional fallback tag to use when no tag can be found
# Run release step
- name: Run release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: ${{ steps.tag.outputs.tag }}
prerelease: false
# Run install step
- run: npm ci

# Run publish step
- name: Run publish
uses: JS-DevTools/npm-publish@v1
with:
registry: https://npm.pkg.github.com/
token: ${{ secrets.GITHUB_TOKEN }}
22 changes: 1 addition & 21 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"eslint": "^8.44.0",
"eslint-config-airbnb": "^19.0.4",
"eslint-config-airbnb-typescript": "^17.0.0",
"eslint-config-next": "^13.4.9",
"eslint-config-next": "^13.4.8",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-compat": "^4.1.4",
"eslint-plugin-eslint-comments": "^3.2.0",
Expand Down

0 comments on commit e65b4c2

Please sign in to comment.