Skip to content

Commit

Permalink
Add dry run publish just before actual publish (#842)
Browse files Browse the repository at this point in the history
  • Loading branch information
rickycodes committed May 27, 2022
1 parent db34740 commit 5f6bdba
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,28 @@ jobs:
path: ./dist
key: ${{ github.sha }}

publish-npm-dry-run:
runs-on: ubuntu-latest
needs: publish-release
steps:
- uses: actions/checkout@v2
with:
ref: ${{ github.sha }}
- uses: actions/cache@v3
id: restore-build
with:
path: ./dist
key: ${{ github.sha }}
# Set `ignore-scripts` to skip `prepublishOnly` because the release was built already in the previous job
- run: npm config set ignore-scripts true
- name: Dry Run Publish
# omit npm-token token to perform dry run publish
uses: MetaMask/action-npm-publish@v1.1.0

publish-npm:
environment: npm-publish
runs-on: ubuntu-latest
needs: publish-release
needs: publish-npm-dry-run
steps:
- uses: actions/checkout@v2
with:
Expand All @@ -50,6 +68,6 @@ jobs:
# Set `ignore-scripts` to skip `prepublishOnly` because the release was built already in the previous job
- run: npm config set ignore-scripts true
- name: Publish
uses: MetaMask/action-npm-publish@v1.0.0
uses: MetaMask/action-npm-publish@v1.1.0
with:
npm-token: ${{ secrets.NPM_TOKEN }}

0 comments on commit 5f6bdba

Please sign in to comment.