From 9489ecaabbf9a4726f67deb0095914d624e9d462 Mon Sep 17 00:00:00 2001 From: Kevin Titor <0x142857@gmail.com> Date: Thu, 4 Jun 2020 17:04:37 +0800 Subject: [PATCH] build: tweak release action --- .github/workflows/release.yml | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 2e38930a..2aa4dcef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -12,24 +12,20 @@ jobs: with: # alias support: https://github.com/actions/setup-node/issues/26 node-version: '12' - - name: Cache NPM dependencies - uses: actions/cache@v1 + - name: Get yarn cache directory path + id: yarn-cache-dir-path + run: echo "::set-output name=dir::$(yarn cache dir)" + - uses: actions/cache@v2 + id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`) with: - path: node_modules - key: ${{ runner.OS }}-npm-cache-${{ matrix.os }} + path: ${{ steps.yarn-cache-dir-path.outputs.dir }} + key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }} restore-keys: | - ${{ runner.OS }}-npm-cache-${{ matrix.os }} + ${{ runner.os }}-yarn- - name: Install Dependencies - run: | - npm install -g yarn - yarn --frozen-lockfile --non-interactive - - uses: actions/checkout@v2 + run: yarn - name: Semantic Release - uses: cycjimmy/semantic-release-action@v2 - with: - extra_plugins: | - @semantic-release/git - @semantic-release/changelog@3.0.0 + run: npx semantic-release env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} NPM_TOKEN: ${{ secrets.NPM_TOKEN }}