Skip to content

Commit

Permalink
Use artifacts instead of caching during release publishing
Browse files Browse the repository at this point in the history
  • Loading branch information
NicholasEllul committed Jan 15, 2025
1 parent aaf5357 commit e0ef270
Showing 1 changed file with 13 additions and 30 deletions.
43 changes: 13 additions & 30 deletions .github/workflows/publish-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
required: true
PUBLISH_DOCS_TOKEN:
required: true

jobs:
publish-release:
permissions:
Expand All @@ -25,22 +24,20 @@ jobs:
node-version-file: '.nvmrc'
- name: Install Yarn
run: corepack enable
- name: Restore Yarn cache
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- uses: MetaMask/action-publish-release@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/cache@v3
- run: yarn --immutable
- run: yarn build
- name: Upload build artifacts
uses: actions/upload-artifact@v4
with:
name: publish-release-artifacts-${{ github.sha }}
retention-days: 4
include-hidden-files: true
path: |
./dist
./node_modules/.yarn-state.yml
key: ${{ github.sha }}
- run: yarn --immutable
- run: yarn build
publish-npm-dry-run:
needs: publish-release
Expand All @@ -55,17 +52,10 @@ jobs:
node-version-file: '.nvmrc'
- name: Install Yarn
run: corepack enable
- name: Restore Yarn cache
uses: actions/setup-node@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- uses: actions/cache@v3
- name: Restore build artifacts
uses: actions/download-artifact@v4
with:
path: |
./dist
./node_modules/.yarn-state.yml
key: ${{ github.sha }}
name: publish-release-artifacts-${{ github.sha }}
- name: Dry Run Publish
# omit npm-token token to perform dry run publish
uses: MetaMask/action-npm-publish@v4
Expand All @@ -89,17 +79,10 @@ jobs:
node-version-file: '.nvmrc'
- name: Install Yarn
run: corepack enable
- name: Restore Yarn cache
uses: actions/setup-node@v4
- name: Restore build artifacts
uses: actions/download-artifact@v4
with:
node-version-file: '.nvmrc'
cache: 'yarn'
- uses: actions/cache@v3
with:
path: |
./dist
./node_modules/.yarn-state.yml
key: ${{ github.sha }}
name: publish-release-artifacts-${{ github.sha }}
- name: Publish
uses: MetaMask/action-npm-publish@v2
with:
Expand Down

0 comments on commit e0ef270

Please sign in to comment.