Skip to content

Commit a7404b4

Browse files
feat(semantic-release): configure pre release
configure #311-prerelease-deployment branch to be published on channel pr311
1 parent b4a56ce commit a7404b4

File tree

3 files changed

+56
-24
lines changed

3 files changed

+56
-24
lines changed

.github/workflows/main.yml

Lines changed: 45 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,28 +27,51 @@ jobs:
2727
npm run docs:build
2828
env:
2929
CI: true
30-
# release for master branch
31-
release:
32-
runs-on: ubuntu-latest
33-
if: ${{ github.ref == 'master' }}
34-
needs: build
30+
# publish to latest if on master branch
31+
- name: release master
32+
if: ${{ github.ref == 'master' }}
33+
run:
34+
echo "release because we are on master branch"
35+
npm run report-coverage
36+
npm run docs:deploy
37+
npx semantic-release
38+
env:
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
3541

36-
steps:
37-
- name: Echo
38-
run:
39-
echo "release because we are on master branch"
42+
# publish pre-release if on PR branch
43+
- name: release PR version
44+
if: ${{ startsWith(github.ref, 'refs/pull/') }}
45+
run: |
46+
echo "pre-release because we are on a pull request"
47+
npm run-report coverage
48+
npx semantic-release --dry-run
49+
env:
50+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
51+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
4052

41-
# release for PR branch
42-
releasePr:
43-
runs-on: ubuntu-latest
44-
if: ${{ startsWith(github.ref, 'refs/pull/') }}
45-
needs: build
53+
# release for master branch
54+
# release:
55+
# runs-on: ubuntu-latest
56+
# if: ${{ github.ref == 'master' }}
57+
# needs: build
58+
#
59+
# steps:
60+
# - name: Echo
61+
# run:
62+
# echo "release because we are on master branch"
4663

47-
steps:
48-
- name: Echo
49-
run:
50-
echo "pre-release because we are on a pull request"
51-
- name: Publish
52-
run: |
53-
npm run-report coverage
54-
npx semantic-release
64+
# release for PR branch
65+
# releasePr:
66+
# runs-on: ubuntu-latest
67+
# if: ${{ startsWith(github.ref, 'refs/pull/') }}
68+
# needs: build
69+
#
70+
# steps:
71+
# - name: Echo
72+
# run:
73+
# echo "pre-release because we are on a pull request"
74+
# - name: Publish
75+
# run: |
76+
# npm run-report coverage
77+
# npx semantic-release

.releaserc.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"branches": [
3+
{
4+
"name": "master"
5+
},
6+
{
7+
"name": "#311-prerelease-deployment",
8+
"channel": "pr311"
9+
}
10+
]
11+
}

.releaserc.yml

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)