Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish package to NPM #2

Merged
merged 4 commits into from
Apr 1, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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