Skip to content

Commit

Permalink
Publish package to NPM (#2)
Browse files Browse the repository at this point in the history
* Update CI workflow

* Skip CI in Windows

* Add workflow for publishing package

* Update package name
  • Loading branch information
lilac authored Apr 1, 2024
1 parent 02d891a commit 560c4d9
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 3 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/npm-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# This workflow will run tests using node and then publish a package to NPM/GitHub Packages when a release is created
# For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages

# Reference: https://github.com/actions/setup-node/blob/main/docs/advanced-usage.md#publish-to-npmjs-and-gpr-with-yarn

name: Node.js Package

on:
release:
types: [created]
workflow_dispatch:

jobs:
publish:
runs-on: macos-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
- run: yarn install --frozen-lockfile
- run: yarn build
- run: yarn publish --access public
env:
NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
# publish to Github Registry
# - uses: actions/setup-node@v4
# with:
# registry-url: 'https://npm.pkg.github.com'
# - run: yarn publish
# env:
# NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
9 changes: 7 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@ jobs:
os: [macos-latest] # skip windows-latest (fails lint) and ubuntu-latest (fails test)

steps:
- uses: actions/checkout@v2
- run: yarn install
- uses: actions/checkout@v4
- name: Use Node.js
uses: actions/setup-node@v4
with:
node-version: 18.x
cache: 'npm'
- run: yarn install --frozen-lockfile
- run: yarn lint
- run: yarn test
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "menubar",
"name": "@rabrain/menubar",
"version": "9.4.1",
"author": "Max Ogden",
"bugs": {
Expand Down

0 comments on commit 560c4d9

Please sign in to comment.