diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5b19acb..cc2aa72 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -19,19 +19,23 @@ jobs: uses: actions/setup-node@v2 with: node-version: 12 + - id: yarn-cache-dir + name: Find Yarn's cache folder + run: echo "::set-output name=path::$(yarn config get cacheFolder)" - name: Cache node modules uses: actions/cache@v2 + id: yarn-cache env: cache-name: cache-node-modules with: - # npm cache files are stored in `~/.npm` on Linux/macOS - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + path: ${{ steps.yarn-cache-dir.outputs.path }} + key: ${{ runner.os }}-yarn-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- + ${{ runner.os }}-yarn-${{ env.cache-name }}- + ${{ runner.os }}-yarn- ${{ runner.os }}- - name: Install dependencies + # if: ${{ !steps.yarn-cache.outputs.cache-hit }} env: CI: true run: | @@ -49,19 +53,24 @@ jobs: - uses: actions/setup-node@v2 with: node-version: 12 + - id: yarn-cache-dir + name: Find Yarn's cache folder + run: echo "::set-output name=path::$(yarn config get cacheFolder)" - name: Cache node modules uses: actions/cache@v2 + id: yarn-cache env: cache-name: cache-node-modules with: - # npm cache files are stored in `~/.npm` on Linux/macOS - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + path: ${{ steps.yarn-cache-dir.outputs.path }} + key: ${{ runner.os }}-yarn-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- + ${{ runner.os }}-yarn-${{ env.cache-name }}- + ${{ runner.os }}-yarn- ${{ runner.os }}- - - env: + - name: Install dependencies + # if: ${{ !steps.yarn-cache.outputs.cache-hit }} + env: CI: true run: | yarn install @@ -70,6 +79,6 @@ jobs: env: CI: true GH_TOKEN: ${{ secrets.GH_TOKEN }} - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }} run: npx semantic-release diff --git a/.github/workflows/test.release.yml b/.github/workflows/test.release.yml index 4420f0c..0bd2234 100644 --- a/.github/workflows/test.release.yml +++ b/.github/workflows/test.release.yml @@ -12,19 +12,23 @@ jobs: uses: actions/setup-node@v2 with: node-version: 12 + - id: yarn-cache-dir + name: Find Yarn's cache folder + run: echo "::set-output name=path::$(yarn config get cacheFolder)" - name: Cache node modules uses: actions/cache@v2 + id: yarn-cache env: cache-name: cache-node-modules with: - # npm cache files are stored in `~/.npm` on Linux/macOS - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + path: ${{ steps.yarn-cache-dir.outputs.path }} + key: ${{ runner.os }}-yarn-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- + ${{ runner.os }}-yarn-${{ env.cache-name }}- + ${{ runner.os }}-yarn- ${{ runner.os }}- - name: Install dependencies + # if: ${{ !steps.yarn-cache.outputs.cache-hit }} env: CI: true run: | @@ -41,19 +45,24 @@ jobs: - uses: actions/setup-node@v2 with: node-version: 12 + - id: yarn-cache-dir + name: Find Yarn's cache folder + run: echo "::set-output name=path::$(yarn config get cacheFolder)" - name: Cache node modules uses: actions/cache@v2 + id: yarn-cache env: cache-name: cache-node-modules with: - # npm cache files are stored in `~/.npm` on Linux/macOS - path: ~/.npm - key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} + path: ${{ steps.yarn-cache-dir.outputs.path }} + key: ${{ runner.os }}-yarn-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }} restore-keys: | - ${{ runner.os }}-build-${{ env.cache-name }}- - ${{ runner.os }}-build- + ${{ runner.os }}-yarn-${{ env.cache-name }}- + ${{ runner.os }}-yarn- ${{ runner.os }}- - - env: + - name: Install dependencies + # if: ${{ !steps.yarn-cache.outputs.cache-hit }} + env: CI: true run: | yarn install @@ -62,7 +71,7 @@ jobs: CI: true GH_TOKEN: "${{ secrets.GH_TOKEN }}" GITHUB_HEAD_REF: $GITHUB_HEAD_REF - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + GITHUB_TOKEN: "${{ secrets.GH_TOKEN }}" NPM_TOKEN: "${{ secrets.NPM_TOKEN }}" run: | echo "//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" > /home/runner/work/_temp/.npmrc