Skip to content

Commit b9b5526

Browse files
committed
build: rework PR and Release workflows
1 parent 871817d commit b9b5526

File tree

2 files changed

+11
-31
lines changed

2 files changed

+11
-31
lines changed

.github/workflows/pull-request.yml

+5-15
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,9 @@ jobs:
1414
- name: Set up Node
1515
uses: actions/[email protected]
1616
with:
17-
check-latest: true
18-
- name: Get yarn cache directory path
19-
id: yarn-cache-dir-path
20-
run: echo "::set-output name=dir::$(yarn cache dir)"
21-
- name: Cache dependencies and build outputs
22-
uses: actions/cache@v2
23-
id: yarn-cache
24-
with:
25-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
26-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
27-
restore-keys: |
28-
${{ runner.os }}-yarn-
29-
- name: Check dependencies
30-
run: yarn --frozen-lockfile --check-files
31-
- name: Run tests
17+
node-version: "lts/*"
18+
cache: "yarn"
19+
- name: Install dependencies
20+
run: yarn
21+
- name: Test
3222
run: yarn test

.github/workflows/release.yml

+6-16
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,14 @@ jobs:
1919
- name: Set up Node
2020
uses: actions/[email protected]
2121
with:
22-
check-latest: true
23-
- name: Get yarn cache directory path
24-
id: yarn-cache-dir-path
25-
run: echo "::set-output name=dir::$(yarn cache dir)"
26-
- name: Cache dependencies and build outputs
27-
uses: actions/cache@v2
28-
id: yarn-cache
29-
with:
30-
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
31-
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
32-
restore-keys: |
33-
${{ runner.os }}-yarn-
34-
- name: Check dependencies
35-
run: yarn --frozen-lockfile --check-files
36-
- name: Run tests
22+
node-version: "lts/*"
23+
cache: "yarn"
24+
- name: Install dependencies
25+
run: yarn
26+
- name: Test
3727
run: yarn test
3828
- name: Release
3929
env:
4030
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4131
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
42-
run: npx semantic-release
32+
run: yarn dlx semantic-release

0 commit comments

Comments
 (0)