Skip to content

Commit f30f55c

Browse files
committed
ci(release-workflow): update release workflow
1 parent 10a8e1f commit f30f55c

File tree

3 files changed

+44
-46
lines changed

3 files changed

+44
-46
lines changed

.github/workflows/release.yml

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: Publish
33
on:
44
push:
55
branches:
6-
- "+([1-9])?(.{+([1-9]),x}).x"
6+
- "[12].[0-9x]+.[0-9x]+"
77
- main
88
- next
99
- alpha
@@ -19,30 +19,32 @@ jobs:
1919
uses: actions/setup-node@v2
2020
with:
2121
node-version: 12
22-
- id: yarn-cache-dir
22+
- id: vars
2323
name: Find Yarn's cache folder
24-
run: echo "::set-output name=path::$(yarn config get cacheFolder)"
24+
run: |
25+
echo "::set-output name=path::$(yarn config get cacheFolder)"
26+
echo "::set-output name=commithash::$(git rev-parse --short HEAD)"
2527
- name: Cache node modules
2628
uses: actions/cache@v2
2729
id: yarn-cache
28-
env:
29-
cache-name: cache-node-modules
3030
with:
31-
path: ${{ steps.yarn-cache-dir.outputs.path }}
32-
key: ${{ runner.os }}-yarn-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
31+
path: ${{ steps.vars.outputs.path }}
32+
key: ${{ runner.os }}-yarn-${{ steps.vars.outputs.commithash }}-${{ hashFiles('**/yarn.lock') }}
3333
restore-keys: |
34-
${{ runner.os }}-yarn-${{ env.cache-name }}-
35-
${{ runner.os }}-yarn-
36-
${{ runner.os }}-
34+
${{ runner.os }}-yarn-${{ steps.vars.outputs.commithash }}-
3735
- name: Install dependencies
3836
# if: ${{ !steps.yarn-cache.outputs.cache-hit }}
3937
env:
4038
CI: true
4139
run: |
4240
yarn install
4341
yarn ci
44-
- name: Build All Packages
42+
- name: Build
4543
run: yarn run build
44+
- name: Test
45+
env:
46+
CI: true
47+
run: yarn run test --coverage
4648

4749
publish:
4850
needs: tests
@@ -53,21 +55,19 @@ jobs:
5355
- uses: actions/setup-node@v2
5456
with:
5557
node-version: 12
56-
- id: yarn-cache-dir
58+
- id: vars
5759
name: Find Yarn's cache folder
58-
run: echo "::set-output name=path::$(yarn config get cacheFolder)"
60+
run: |
61+
echo "::set-output name=path::$(yarn config get cacheFolder)"
62+
echo "::set-output name=commithash::$(git rev-parse --short HEAD)"
5963
- name: Cache node modules
6064
uses: actions/cache@v2
6165
id: yarn-cache
62-
env:
63-
cache-name: cache-node-modules
6466
with:
65-
path: ${{ steps.yarn-cache-dir.outputs.path }}
66-
key: ${{ runner.os }}-yarn-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
67+
path: ${{ steps.vars.outputs.path }}
68+
key: ${{ runner.os }}-yarn-${{ steps.vars.outputs.commithash }}-${{ hashFiles('**/yarn.lock') }}
6769
restore-keys: |
68-
${{ runner.os }}-yarn-${{ env.cache-name }}-
69-
${{ runner.os }}-yarn-
70-
${{ runner.os }}-
70+
${{ runner.os }}-yarn-${{ steps.vars.outputs.commithash }}-
7171
- name: Install dependencies
7272
# if: ${{ !steps.yarn-cache.outputs.cache-hit }}
7373
env:
@@ -81,4 +81,4 @@ jobs:
8181
GH_TOKEN: ${{ secrets.GH_TOKEN }}
8282
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
8383
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
84-
run: npx semantic-release
84+
run: yarn semantic-release

.github/workflows/test.release.yml

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,30 +12,32 @@ jobs:
1212
uses: actions/setup-node@v2
1313
with:
1414
node-version: 12
15-
- id: yarn-cache-dir
15+
- id: vars
1616
name: Find Yarn's cache folder
17-
run: echo "::set-output name=path::$(yarn config get cacheFolder)"
17+
run: |
18+
echo "::set-output name=path::$(yarn config get cacheFolder)"
19+
echo "::set-output name=commithash::$(git rev-parse --short HEAD)"
1820
- name: Cache node modules
1921
uses: actions/cache@v2
2022
id: yarn-cache
21-
env:
22-
cache-name: cache-node-modules
2323
with:
24-
path: ${{ steps.yarn-cache-dir.outputs.path }}
25-
key: ${{ runner.os }}-yarn-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
24+
path: ${{ steps.vars.outputs.path }}
25+
key: ${{ runner.os }}-yarn-${{ steps.vars.outputs.commithash }}-${{ hashFiles('**/yarn.lock') }}
2626
restore-keys: |
27-
${{ runner.os }}-yarn-${{ env.cache-name }}-
28-
${{ runner.os }}-yarn-
29-
${{ runner.os }}-
27+
${{ runner.os }}-yarn-${{ steps.vars.outputs.commithash }}-
3028
- name: Install dependencies
3129
# if: ${{ !steps.yarn-cache.outputs.cache-hit }}
3230
env:
3331
CI: true
3432
run: |
3533
yarn install
3634
yarn ci
37-
- name: Build All Packages
35+
- name: Build
3836
run: yarn run build
37+
- name: Test
38+
env:
39+
CI: true
40+
run: yarn run test --coverage
3941

4042
test_publish:
4143
needs: tests
@@ -45,21 +47,19 @@ jobs:
4547
- uses: actions/setup-node@v2
4648
with:
4749
node-version: 12
48-
- id: yarn-cache-dir
50+
- id: vars
4951
name: Find Yarn's cache folder
50-
run: echo "::set-output name=path::$(yarn config get cacheFolder)"
52+
run: |
53+
echo "::set-output name=path::$(yarn config get cacheFolder)"
54+
echo "::set-output name=commithash::$(git rev-parse --short HEAD)"
5155
- name: Cache node modules
5256
uses: actions/cache@v2
5357
id: yarn-cache
54-
env:
55-
cache-name: cache-node-modules
5658
with:
57-
path: ${{ steps.yarn-cache-dir.outputs.path }}
58-
key: ${{ runner.os }}-yarn-${{ env.cache-name }}-${{ hashFiles('**/yarn.lock') }}
59+
path: ${{ steps.vars.outputs.path }}
60+
key: ${{ runner.os }}-yarn-${{ steps.vars.outputs.commithash }}-${{ hashFiles('**/yarn.lock') }}
5961
restore-keys: |
60-
${{ runner.os }}-yarn-${{ env.cache-name }}-
61-
${{ runner.os }}-yarn-
62-
${{ runner.os }}-
62+
${{ runner.os }}-yarn-${{ steps.vars.outputs.commithash }}-
6363
- name: Install dependencies
6464
# if: ${{ !steps.yarn-cache.outputs.cache-hit }}
6565
env:
@@ -75,4 +75,4 @@ jobs:
7575
NPM_TOKEN: "${{ secrets.NPM_TOKEN }}"
7676
run: |
7777
echo "//npm.pkg.github.com/:_authToken=$GITHUB_TOKEN" > /home/runner/work/_temp/.npmrc
78-
npx semantic-release --dry-run --debug -b $GITHUB_HEAD_REF
78+
yarn run semantic-release --dry-run --debug -b $GITHUB_HEAD_REF

.releaserc.yaml

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
branch: main
2+
repositoryUrl: "https://github.com/ri7nz/rescript-chakra.git"
23
branches:
3-
- "+([1-9])?(.{+([1-9]),x}).x"
4+
- "+([0-9])?(.{+([0-9]),x}).x"
45
- main
5-
- next
6-
- name: alpha
7-
prerelease: true
8-
- name: beta
6+
- name: next
97
prerelease: true
108
ci: false
119
dryRun: false

0 commit comments

Comments
 (0)