Skip to content
This repository was archived by the owner on Jan 10, 2024. It is now read-only.

Commit 56bc172

Browse files
committed
chore: added step to preview the release in a pull request for each push
1 parent 2c0542b commit 56bc172

File tree

4 files changed

+74
-37
lines changed

4 files changed

+74
-37
lines changed

.github/workflows/test-and-release.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Test and Release
2-
on: [ push ]
2+
on:
3+
push:
4+
pull_request:
5+
types: [ opened ]
36

47
jobs:
58
test-and-release:
@@ -36,10 +39,17 @@ jobs:
3639
if: |
3740
steps.cache-yarn-cache-dir.outputs.cache-hit != 'true' ||
3841
steps.cache-node-modules-dir.outputs.cache-hit != 'true'
42+
- name: Generate preview release comment on PR
43+
run: yarn semantic-release-github-pr
44+
env:
45+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
46+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3947
- name: Run tests
4048
run: yarn test
4149
- name: Release
50+
if: ${{ github.event_name == 'push' }}
4251
env:
4352
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4453
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4554
run: yarn semantic-release
55+

.releaserc.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ branches:
22
- main
33
- name: beta
44
prerelease: true
5+
baseBranch: main

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"mocha-junit-reporter": "^1.23.1",
3030
"nyc": "^15.0.0",
3131
"semantic-release": "^17.2.1",
32+
"semantic-release-github-pr": "^6.0.1",
3233
"sinon": "^8.0.4",
3334
"standardx": "^6.0.0"
3435
},

yarn.lock

Lines changed: 61 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1428,7 +1428,7 @@ debug@^2.2.0, debug@^2.6.9:
14281428
dependencies:
14291429
ms "2.0.0"
14301430

1431-
debuglog@*, debuglog@^1.0.1:
1431+
debuglog@^1.0.1:
14321432
version "1.0.1"
14331433
resolved "https://registry.yarnpkg.com/debuglog/-/debuglog-1.0.1.tgz#aa24ffb9ac3df9a2351837cfb2d279360cd78492"
14341434
integrity sha1-qiT/uaw9+aI1GDfPstJ5NgzXhJI=
@@ -1587,6 +1587,11 @@ dot-prop@^5.1.0:
15871587
dependencies:
15881588
is-obj "^2.0.0"
15891589

1590+
dotenv@^4.0.0:
1591+
version "4.0.0"
1592+
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-4.0.0.tgz#864ef1379aced55ce6f95debecdce179f7a0cd1d"
1593+
integrity sha1-hk7xN5rO1Vzm+V3r7NzhefegzR0=
1594+
15901595
dotenv@^5.0.1:
15911596
version "5.0.1"
15921597
resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-5.0.1.tgz#a5317459bd3d79ab88cff6e44057a6a3fbb1fcef"
@@ -1658,7 +1663,7 @@ enquirer@^2.3.5:
16581663
dependencies:
16591664
ansi-colors "^4.1.1"
16601665

1661-
env-ci@^5.0.0:
1666+
env-ci@^5.0.0, env-ci@^5.0.1:
16621667
version "5.0.2"
16631668
resolved "https://registry.yarnpkg.com/env-ci/-/env-ci-5.0.2.tgz#48b6687f8af8cdf5e31b8fcf2987553d085249d9"
16641669
integrity sha512-Xc41mKvjouTXD3Oy9AqySz1IeyvJvHZ20Twf5ZLYbNpPPIuCnL/qHCmNlD01LoNy0JTunw9HPYVptD19Ac7Mbw==
@@ -2370,6 +2375,19 @@ git-log-parser@^1.2.0:
23702375
through2 "~2.0.0"
23712376
traverse "~0.6.6"
23722377

2378+
github@^13.0.0:
2379+
version "13.1.1"
2380+
resolved "https://registry.yarnpkg.com/github/-/github-13.1.1.tgz#e4775be32c3a72e44d5cbec965dbeb8c0aac7c1f"
2381+
integrity sha512-BpItPaOCuvotnNUGXSSEDkB86eqQ7+k7j8/+lu5gbRmNnFPW/uQyFezH1fjy7XojieVNzD/+MgPhBngaw+Ocfw==
2382+
dependencies:
2383+
debug "^3.1.0"
2384+
dotenv "^4.0.0"
2385+
https-proxy-agent "^2.1.0"
2386+
is-stream "^1.1.0"
2387+
lodash "^4.17.4"
2388+
proxy-from-env "^1.0.0"
2389+
url-template "^2.0.8"
2390+
23732391
glob-parent@^5.0.0, glob-parent@^5.1.0, glob-parent@~5.1.0:
23742392
version "5.1.1"
23752393
resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.1.tgz#b6c1ef417c4e5663ea498f1c45afac6916bbc229"
@@ -2587,7 +2605,7 @@ http-signature@~1.2.0:
25872605
jsprim "^1.2.2"
25882606
sshpk "^1.7.0"
25892607

2590-
https-proxy-agent@^2.2.3:
2608+
https-proxy-agent@^2.1.0, https-proxy-agent@^2.2.3:
25912609
version "2.2.4"
25922610
resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz#4ee7a737abd92678a293d9b34a1af4d0d08c787b"
25932611
integrity sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==
@@ -2676,7 +2694,7 @@ import-lazy@^2.1.0:
26762694
resolved "https://registry.yarnpkg.com/import-lazy/-/import-lazy-2.1.0.tgz#05698e3d45c88e8d7e9d92cb0584e77f096f3e43"
26772695
integrity sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=
26782696

2679-
imurmurhash@*, imurmurhash@^0.1.4:
2697+
imurmurhash@^0.1.4:
26802698
version "0.1.4"
26812699
resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea"
26822700
integrity sha1-khi5srkoojixPcT7a21XbyMUU+o=
@@ -3393,11 +3411,6 @@ lockfile@^1.0.4:
33933411
dependencies:
33943412
signal-exit "^3.0.2"
33953413

3396-
lodash._baseindexof@*:
3397-
version "3.1.0"
3398-
resolved "https://registry.yarnpkg.com/lodash._baseindexof/-/lodash._baseindexof-3.1.0.tgz#fe52b53a1c6761e42618d654e4a25789ed61822c"
3399-
integrity sha1-/lK1OhxnYeQmGNZU5KJXie1hgiw=
3400-
34013414
lodash._baseuniq@~4.6.0:
34023415
version "4.6.0"
34033416
resolved "https://registry.yarnpkg.com/lodash._baseuniq/-/lodash._baseuniq-4.6.0.tgz#0ebb44e456814af7905c6212fa2c9b2d51b841e8"
@@ -3406,33 +3419,11 @@ lodash._baseuniq@~4.6.0:
34063419
lodash._createset "~4.0.0"
34073420
lodash._root "~3.0.0"
34083421

3409-
lodash._bindcallback@*:
3410-
version "3.0.1"
3411-
resolved "https://registry.yarnpkg.com/lodash._bindcallback/-/lodash._bindcallback-3.0.1.tgz#e531c27644cf8b57a99e17ed95b35c748789392e"
3412-
integrity sha1-5THCdkTPi1epnhftlbNcdIeJOS4=
3413-
3414-
lodash._cacheindexof@*:
3415-
version "3.0.2"
3416-
resolved "https://registry.yarnpkg.com/lodash._cacheindexof/-/lodash._cacheindexof-3.0.2.tgz#3dc69ac82498d2ee5e3ce56091bafd2adc7bde92"
3417-
integrity sha1-PcaayCSY0u5ePOVgkbr9Ktx73pI=
3418-
3419-
lodash._createcache@*:
3420-
version "3.1.2"
3421-
resolved "https://registry.yarnpkg.com/lodash._createcache/-/lodash._createcache-3.1.2.tgz#56d6a064017625e79ebca6b8018e17440bdcf093"
3422-
integrity sha1-VtagZAF2JeeevKa4AY4XRAvc8JM=
3423-
dependencies:
3424-
lodash._getnative "^3.0.0"
3425-
34263422
lodash._createset@~4.0.0:
34273423
version "4.0.3"
34283424
resolved "https://registry.yarnpkg.com/lodash._createset/-/lodash._createset-4.0.3.tgz#0f4659fbb09d75194fa9e2b88a6644d363c9fe26"
34293425
integrity sha1-D0ZZ+7CddRlPqeK4imZE02PJ/iY=
34303426

3431-
lodash._getnative@*, lodash._getnative@^3.0.0:
3432-
version "3.9.1"
3433-
resolved "https://registry.yarnpkg.com/lodash._getnative/-/lodash._getnative-3.9.1.tgz#570bc7dede46d61cdcde687d65d3eecbaa3aaff5"
3434-
integrity sha1-VwvH3t5G1hzc3mh9ZdPuy6o6r/U=
3435-
34363427
lodash._root@~3.0.0:
34373428
version "3.0.1"
34383429
resolved "https://registry.yarnpkg.com/lodash._root/-/lodash._root-3.0.1.tgz#fba1c4524c19ee9a5f8136b4609f017cf4ded692"
@@ -3478,11 +3469,6 @@ lodash.isstring@^4.0.1:
34783469
resolved "https://registry.yarnpkg.com/lodash.isstring/-/lodash.isstring-4.0.1.tgz#d527dfb5456eca7cc9bb95d5daeaf88ba54a5451"
34793470
integrity sha1-1SfftUVuynzJu5XV2ur4i6VKVFE=
34803471

3481-
lodash.restparam@*:
3482-
version "3.6.1"
3483-
resolved "https://registry.yarnpkg.com/lodash.restparam/-/lodash.restparam-3.6.1.tgz#936a4e309ef330a7645ed4145986c85ae5b20805"
3484-
integrity sha1-k2pOMJ7zMKdkXtQUWYbIWuWyCAU=
3485-
34863472
lodash.toarray@^4.4.0:
34873473
version "4.4.0"
34883474
resolved "https://registry.yarnpkg.com/lodash.toarray/-/lodash.toarray-4.4.0.tgz#24c4bfcd6b2fba38bfd0594db1179d8e9b656561"
@@ -4563,6 +4549,11 @@ parse-attributes@0.0.1:
45634549
resolved "https://registry.yarnpkg.com/parse-attributes/-/parse-attributes-0.0.1.tgz#a672c2995f1608f844eae59acea467507940cac4"
45644550
integrity sha1-pnLCmV8WCPhE6uWazqRnUHlAysQ=
45654551

4552+
parse-github-url@^1.0.2:
4553+
version "1.0.2"
4554+
resolved "https://registry.yarnpkg.com/parse-github-url/-/parse-github-url-1.0.2.tgz#242d3b65cbcdda14bb50439e3242acf6971db395"
4555+
integrity sha512-kgBf6avCbO3Cn6+RnzRGLkUsv4ZVqv/VfAYkRsyBcgkshNvVBkRn1FEZcW0Jb+npXQWm2vHPnnOqFteZxRRGNw==
4556+
45664557
parse-json@^2.2.0:
45674558
version "2.2.0"
45684559
resolved "https://registry.yarnpkg.com/parse-json/-/parse-json-2.2.0.tgz#f480f40434ef80741f8469099f8dea18f55a4dc9"
@@ -4779,6 +4770,11 @@ protoduck@^5.0.1:
47794770
dependencies:
47804771
genfun "^5.0.0"
47814772

4773+
proxy-from-env@^1.0.0:
4774+
version "1.1.0"
4775+
resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2"
4776+
integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==
4777+
47824778
prr@~1.0.1:
47834779
version "1.0.1"
47844780
resolved "https://registry.yarnpkg.com/prr/-/prr-1.0.1.tgz#d3fc114ba06995a45ec6893f484ceb1d78f5f476"
@@ -4858,6 +4854,11 @@ qw@~1.0.1:
48584854
resolved "https://registry.yarnpkg.com/qw/-/qw-1.0.1.tgz#efbfdc740f9ad054304426acb183412cc8b996d4"
48594855
integrity sha1-77/cdA+a0FQwRCassYNBLMi5ltQ=
48604856

4857+
ramda@^0.26.1:
4858+
version "0.26.1"
4859+
resolved "https://registry.yarnpkg.com/ramda/-/ramda-0.26.1.tgz#8d41351eb8111c55353617fc3bbffad8e4d35d06"
4860+
integrity sha512-hLWjpy7EnsDBb0p+Z3B7rPi3GDeRG5ZtiI33kJhTt+ORCd38AbAIjB/9zRIUoeTbE/AVX5ZkU7m6bznsvrf8eQ==
4861+
48614862
rc@^1.0.1, rc@^1.1.6, rc@^1.2.8:
48624863
version "1.2.8"
48634864
resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed"
@@ -5210,6 +5211,25 @@ sax@1.2.4:
52105211
resolved "https://registry.yarnpkg.com/sax/-/sax-1.2.4.tgz#2816234e2378bddc4e5354fab5caa895df7100d9"
52115212
integrity sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==
52125213

5214+
semantic-release-github-pr@^6.0.1:
5215+
version "6.0.1"
5216+
resolved "https://registry.yarnpkg.com/semantic-release-github-pr/-/semantic-release-github-pr-6.0.1.tgz#ed8113f6196867c85294f241fc538a8125a702d2"
5217+
integrity sha512-wmprb3Xle2nhD/ad07EfuGBhChJVr7ClhFFb6y2kMpnIiQSgMaIV/19gkGOgk7R+XBkTlqqoLiM8J8MD2YgB3g==
5218+
dependencies:
5219+
debug "^4.1.1"
5220+
env-ci "^5.0.1"
5221+
execa "^4.0.0"
5222+
github "^13.0.0"
5223+
parse-github-url "^1.0.2"
5224+
ramda "^0.26.1"
5225+
read-pkg "^5.2.0"
5226+
semantic-release-plugin-decorators "^3.0.0"
5227+
5228+
semantic-release-plugin-decorators@^3.0.0:
5229+
version "3.0.0"
5230+
resolved "https://registry.yarnpkg.com/semantic-release-plugin-decorators/-/semantic-release-plugin-decorators-3.0.0.tgz#b4cbe9cda7e9e2198caf8103cf56de9742d6f5e4"
5231+
integrity sha512-BIUUe9gUwH+N5k/fr9KEin/2cU80r62kLBPLS/o9Dl/TK3gNsu4CJgb7SAJyWvoothDRbWLZSgTS3Qz8UJuT/Q==
5232+
52135233
semantic-release@^17.2.1:
52145234
version "17.2.1"
52155235
resolved "https://registry.yarnpkg.com/semantic-release/-/semantic-release-17.2.1.tgz#739bad395219110cc30d1ef7029fa2e03e3b4b72"
@@ -6077,6 +6097,11 @@ url-parse-lax@^1.0.0:
60776097
dependencies:
60786098
prepend-http "^1.0.1"
60796099

6100+
url-template@^2.0.8:
6101+
version "2.0.8"
6102+
resolved "https://registry.yarnpkg.com/url-template/-/url-template-2.0.8.tgz#fc565a3cccbff7730c775f5641f9555791439f21"
6103+
integrity sha1-/FZaPMy/93MMd19WQflVV5FDnyE=
6104+
60806105
util-deprecate@^1.0.1, util-deprecate@~1.0.1:
60816106
version "1.0.2"
60826107
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"

0 commit comments

Comments
 (0)