From a7d5401af7367b32b45d48188af50c54a4318aa9 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Fri, 14 Oct 2022 20:37:12 -0230 Subject: [PATCH 1/3] Use cached dependencies and immutable install during publish The `publish-release` action now uses the same installation method as the lint/build step. This should make the output more predictable, and there is a greater chance that it will match what passed the other CI checks. --- .github/workflows/publish-release.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 7bc0f4b66b..4d00fb4a36 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -35,10 +35,13 @@ jobs: - uses: MetaMask/action-publish-release@v2.0.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Install - run: | - yarn install - yarn build + - name: Cache yarn dependencies + uses: actions/cache@v2 + with: + path: ${{ steps.yarn-cache-dir.outputs.YARN_CACHE_DIR }} + key: yarn-cache-${{ runner.os }}-${{ steps.yarn-version.outputs.YARN_VERSION }}-${{ hashFiles('yarn.lock') }} + - run: yarn --immutable + - run: yarn build - uses: actions/cache@v3 id: restore-build with: From 6ebe9c50149dfc7e019aed7dcfb0016269fe4162 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 25 Oct 2022 10:33:31 -0230 Subject: [PATCH 2/3] Use v3 cache action --- .github/workflows/publish-release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index 4d00fb4a36..c3c1379a29 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -36,7 +36,7 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - name: Cache yarn dependencies - uses: actions/cache@v2 + uses: actions/cache@v3 with: path: ${{ steps.yarn-cache-dir.outputs.YARN_CACHE_DIR }} key: yarn-cache-${{ runner.os }}-${{ steps.yarn-version.outputs.YARN_VERSION }}-${{ hashFiles('yarn.lock') }} From a3235df62f902d535b2f42b57d614116e9adb195 Mon Sep 17 00:00:00 2001 From: Mark Stacey Date: Tue, 25 Oct 2022 11:39:04 -0230 Subject: [PATCH 3/3] Populate yarn version and cache directory before restoring from cache --- .github/workflows/publish-release.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/publish-release.yml b/.github/workflows/publish-release.yml index c3c1379a29..b092733cfc 100644 --- a/.github/workflows/publish-release.yml +++ b/.github/workflows/publish-release.yml @@ -35,6 +35,12 @@ jobs: - uses: MetaMask/action-publish-release@v2.0.0 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Get Yarn cache directory + run: echo "YARN_CACHE_DIR=$(yarn config get cacheFolder)" >> $GITHUB_OUTPUT + id: yarn-cache-dir + - name: Get Yarn version + run: echo "YARN_VERSION=$(yarn --version)" >> $GITHUB_OUTPUT + id: yarn-version - name: Cache yarn dependencies uses: actions/cache@v3 with: