Skip to content

Commit

Permalink
Add npm publish (MetaMask#737)
Browse files Browse the repository at this point in the history
* add npm publish

* address lint

* move everything into `publish-release`

* update to use v1

* only cache and publish

* Update .github/workflows/publish-release.yml

* add npm publish

* address lint

* move everything into `publish-release`

* update to use v1

* only cache and publish

* version needs to be explicit

* exclude node_modules

* use cache@v3

* only cache ./dist

* use sha

* change environment to `npm-publish`
  • Loading branch information
rickycodes authored Apr 8, 2022
1 parent 731246a commit 91b8435
Showing 1 changed file with 29 additions and 1 deletion.
30 changes: 29 additions & 1 deletion .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
with:
# We check out the release pull request's base branch, which will be
# used as the base branch for all git operations.
ref: ${{ github.event.pull_request.base.ref }}
ref: ${{ github.event.pull_request.base.sha }}
- name: Get Node.js version
id: nvm
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)
Expand All @@ -27,3 +27,31 @@ jobs:
- uses: MetaMask/action-publish-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- run: |
yarn setup
yarn build
- uses: actions/cache@v3
id: restore-build
with:
path: ./dist
key: ${{ github.sha }}

publish-npm:
environment: npm-publish
runs-on: ubuntu-latest
needs: publish-release
steps:
- uses: actions/checkout@v2
with:
# We check out the release pull request's base branch, which will be
# used as the base branch for all git operations.
ref: ${{ github.event.pull_request.base.sha }}
- uses: actions/cache@v3
id: restore-build
with:
path: ./dist
key: ${{ github.sha }}
- name: Publish
uses: MetaMask/action-npm-publish@v1.0.0
with:
npm-token: ${{ secrets.NPM_TOKEN }}

0 comments on commit 91b8435

Please sign in to comment.