diff --git a/.github/workflows/npm-publish.yml b/.github/workflows/npm-publish.yml new file mode 100644 index 0000000..90094e6 --- /dev/null +++ b/.github/workflows/npm-publish.yml @@ -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 }} diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index ed95f73..0e532c0 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -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 diff --git a/package.json b/package.json index ff6ea37..ff188c8 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "menubar", + "name": "@rabrain/menubar", "version": "9.4.1", "author": "Max Ogden", "bugs": {