Skip to content

Commit

Permalink
add publish workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjah committed Oct 25, 2024
1 parent 1b39e65 commit 5957783
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
40 changes: 40 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Publish npm package and documentation

on:
workflow_dispatch:
push:
tags:
- v*

jobs:
test:
uses: ./.github/workflows/build-lint-test.yml

publish-npm:
needs: test

runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
registry-url: https://registry.npmjs.org
cache: 'yarn'

- run: yarn --immutable --immutable-cache
- name: Restore snap build cache
uses: actions/cache@v3
with:
path: ./packages/snap/dist
key: snap-${{ runner.os }}-${{ github.sha }}
- run: yarn build
- name: Publish package on npm
working-directory: packages/snap
run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.npm_token }}
1 change: 0 additions & 1 deletion packages/snap/test/get-node-urls.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { expect } from '@jest/globals';
import { installSnap } from '@metamask/snaps-jest';
import { ListAccountsResponse } from 'src/handlers';

import { setNetwork } from './utils/setNetwork';

Expand Down
1 change: 0 additions & 1 deletion packages/snap/test/index.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { expect } from '@jest/globals';
import { installSnap } from '@metamask/snaps-jest';
import { panel, text } from '@metamask/snaps-sdk';

describe('onRpcRequest', () => {
it('throws an error if the requested method does not exist', async () => {
Expand Down

0 comments on commit 5957783

Please sign in to comment.