@hedia/types 2.1.34-alpha.1 → 2.1.36-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.github/workflows/ci.yml +44 -0
- package/.github/workflows/on-open-pr-publish-alpha.yaml +105 -0
- package/.github/workflows/on-post-merge-publish-package.yaml +59 -0
- package/.github/workflows/on-push-commit-bump-and-publish-alpha.yaml +84 -0
- package/on-open-pr-bump-alpha-release.sh +8 -0
- package/on-push-commit-bump-alpha.sh +8 -0
- package/package.json +2 -1
- package/remove-alpha-tag.sh +19 -0
- package/.github/workflows/post-merge.yml +0 -60
- package/.github/workflows/publish-alpha.yaml +0 -54
- package/alpha-release.sh +0 -11
- package/pre-release.sh +0 -5
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
name: Node.js CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_run:
|
|
5
|
+
workflows: ["NPM - Version Bump & Publish Alpha", "NPM Bumper - Bump alpha version"]
|
|
6
|
+
types:
|
|
7
|
+
- completed
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
SSH_PRIVATE_KEY: ${{ secrets.HEDIA_BOT_PRIVATE_SSH_KEY }}
|
|
11
|
+
NPM_TOKEN: ${{ secrets.HEDIA_BOT_NPM_TOKEN }}
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
build:
|
|
15
|
+
if: ${{ github.event.workflow_run.conclusion == 'success' }}
|
|
16
|
+
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
|
|
19
|
+
strategy:
|
|
20
|
+
matrix:
|
|
21
|
+
node-version: [14.15]
|
|
22
|
+
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v2
|
|
25
|
+
|
|
26
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
27
|
+
uses: actions/setup-node@v2
|
|
28
|
+
with:
|
|
29
|
+
node-version: ${{ matrix.node-version }}
|
|
30
|
+
|
|
31
|
+
- name: Register ssh keys
|
|
32
|
+
uses: webfactory/ssh-agent@v0.5.3
|
|
33
|
+
with:
|
|
34
|
+
ssh-private-key: |
|
|
35
|
+
${{ env.SSH_PRIVATE_KEY }}
|
|
36
|
+
|
|
37
|
+
- name: Register NPM access token
|
|
38
|
+
run: npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
|
|
39
|
+
env:
|
|
40
|
+
NPM_TOKEN: ${{ env.NPM_TOKEN }}
|
|
41
|
+
|
|
42
|
+
- run: npm ci
|
|
43
|
+
env:
|
|
44
|
+
CI: true
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
name: NPM - Version Bump & Publish Alpha
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
types: [opened]
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
SSH_PRIVATE_KEY: ${{ secrets.HEDIA_BOT_PRIVATE_SSH_KEY }}
|
|
11
|
+
NPM_TOKEN: ${{ secrets.HEDIA_BOT_NPM_TOKEN }}
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
on-open-pr-publish-alpha:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
|
|
17
|
+
strategy:
|
|
18
|
+
matrix:
|
|
19
|
+
node-version: [14.15]
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v2
|
|
23
|
+
with:
|
|
24
|
+
ref: ${{ github.event.pull_request.head.ref }}
|
|
25
|
+
|
|
26
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
27
|
+
uses: actions/setup-node@v2
|
|
28
|
+
with:
|
|
29
|
+
node-version: ${{ matrix.node-version }}
|
|
30
|
+
|
|
31
|
+
- name: Register ssh keys
|
|
32
|
+
uses: webfactory/ssh-agent@v0.5.3
|
|
33
|
+
with:
|
|
34
|
+
ssh-private-key: |
|
|
35
|
+
${{ env.SSH_PRIVATE_KEY }}
|
|
36
|
+
|
|
37
|
+
- name: Register NPM access token
|
|
38
|
+
run: npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
|
|
39
|
+
env:
|
|
40
|
+
NPM_TOKEN: ${{ env.NPM_TOKEN }}
|
|
41
|
+
|
|
42
|
+
- name: Validate PR labels
|
|
43
|
+
uses: docker://agilepathway/pull-request-label-checker:v1.0.102
|
|
44
|
+
with:
|
|
45
|
+
one_of: major,minor,patch
|
|
46
|
+
repo_token: ${{ secrets.GITHUB_TOKEN }}
|
|
47
|
+
|
|
48
|
+
- name: Set identity
|
|
49
|
+
run: |
|
|
50
|
+
git config --global user.email "ci@hedia.co"
|
|
51
|
+
git config --global user.name "Hedia CI Bot"
|
|
52
|
+
|
|
53
|
+
- name: Amend [major] to Latest Commit
|
|
54
|
+
if: "contains(github.event.pull_request.labels.*.name, 'Major')"
|
|
55
|
+
run: |
|
|
56
|
+
npm version premajor --preid alpha
|
|
57
|
+
|
|
58
|
+
- name: Amend [minor] to Latest Commit
|
|
59
|
+
if: "!contains(github.event.pull_request.labels.*.name, 'Major') && contains(github.event.pull_request.labels.*.name, 'Minor')"
|
|
60
|
+
run: |
|
|
61
|
+
npm version preminor --preid alpha
|
|
62
|
+
|
|
63
|
+
- name: Amend [patch] to Latest Commit
|
|
64
|
+
if: "!contains(github.event.pull_request.labels.*.name, 'Major') && !contains(github.event.pull_request.labels.*.name, 'Minor')"
|
|
65
|
+
run: |
|
|
66
|
+
npm version prepatch --preid alpha
|
|
67
|
+
|
|
68
|
+
- name: Bump alpha version
|
|
69
|
+
run: |
|
|
70
|
+
chmod +x ./on-open-pr-bump-alpha-release.sh && ./on-open-pr-bump-alpha-release.sh
|
|
71
|
+
|
|
72
|
+
- name: Publish alpha version
|
|
73
|
+
id: publish-alpha
|
|
74
|
+
uses: JS-DevTools/npm-publish@v1
|
|
75
|
+
with:
|
|
76
|
+
token: ${{ env.NPM_TOKEN }}
|
|
77
|
+
tag: alpha
|
|
78
|
+
|
|
79
|
+
- name: Check if version exists
|
|
80
|
+
if: steps.publish-alpha.outputs.type == 'none'
|
|
81
|
+
run: |
|
|
82
|
+
echo "Package JSON version is already published, please bump the version!"
|
|
83
|
+
exit 1
|
|
84
|
+
|
|
85
|
+
- name: Remove alpha tag
|
|
86
|
+
run: |
|
|
87
|
+
chmod +x ./remove-alpha-tag.sh && ./remove-alpha-tag.sh
|
|
88
|
+
git push
|
|
89
|
+
|
|
90
|
+
- name: Remove old comment from PR
|
|
91
|
+
if: steps.publish-alpha.outputs.type != 'none'
|
|
92
|
+
uses: izhangzhihao/delete-comment@master
|
|
93
|
+
with:
|
|
94
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
95
|
+
delete_user_name: github-actions[bot]
|
|
96
|
+
issue_number: ${{ github.event.number }} # remove comments from the current PR
|
|
97
|
+
|
|
98
|
+
- name: Write comment on PR
|
|
99
|
+
if: steps.publish-alpha.outputs.type != 'none'
|
|
100
|
+
uses: peter-evans/create-or-update-comment@v1
|
|
101
|
+
with:
|
|
102
|
+
issue-number: ${{ github.event.number }}
|
|
103
|
+
body: |
|
|
104
|
+
🎉 Successfully released alpha version 🎉
|
|
105
|
+
✅ ${{ steps.publish-alpha.outputs.version }}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
name: NPM Publish Bot - Publish package
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
types: [closed]
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
SSH_PRIVATE_KEY: ${{ secrets.HEDIA_BOT_PRIVATE_SSH_KEY }}
|
|
11
|
+
NPM_TOKEN: ${{ secrets.HEDIA_BOT_NPM_TOKEN }}
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
on-post-merge-publish-package:
|
|
15
|
+
if: github.event.pull_request.merged == true
|
|
16
|
+
|
|
17
|
+
runs-on: ubuntu-latest
|
|
18
|
+
|
|
19
|
+
strategy:
|
|
20
|
+
matrix:
|
|
21
|
+
node-version: [14.15]
|
|
22
|
+
|
|
23
|
+
steps:
|
|
24
|
+
- uses: actions/checkout@v2
|
|
25
|
+
- uses: actions/setup-node@v2
|
|
26
|
+
with:
|
|
27
|
+
node-version: ${{ matrix.node-version }}
|
|
28
|
+
|
|
29
|
+
- name: Register NPM access token
|
|
30
|
+
run: npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
|
|
31
|
+
|
|
32
|
+
- name: Publish package
|
|
33
|
+
id: publish-package
|
|
34
|
+
uses: JS-DevTools/npm-publish@v1
|
|
35
|
+
with:
|
|
36
|
+
token: ${{ env.NPM_TOKEN }}
|
|
37
|
+
|
|
38
|
+
- name: Check if version exists
|
|
39
|
+
if: steps.publish-package.outputs.type == 'none'
|
|
40
|
+
run: |
|
|
41
|
+
echo "Package JSON version is already published, please bump the version!"
|
|
42
|
+
exit 1
|
|
43
|
+
|
|
44
|
+
- name: Remove old comment from PR
|
|
45
|
+
if: steps.publish-package.outputs.type != 'none'
|
|
46
|
+
uses: izhangzhihao/delete-comment@master
|
|
47
|
+
with:
|
|
48
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
49
|
+
delete_user_name: github-actions[bot]
|
|
50
|
+
issue_number: ${{ github.event.number }} # remove comments from the current PR
|
|
51
|
+
|
|
52
|
+
- name: Write comment on PR
|
|
53
|
+
if: steps.publish-package.outputs.type != 'none'
|
|
54
|
+
uses: peter-evans/create-or-update-comment@v1
|
|
55
|
+
with:
|
|
56
|
+
issue-number: ${{ github.event.number }}
|
|
57
|
+
body: |
|
|
58
|
+
🎉 Successfully released package 🎉
|
|
59
|
+
✅ ${{ steps.publish-package.outputs.version }}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
name: NPM Bumper - Bump alpha version
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
branches:
|
|
6
|
+
- master
|
|
7
|
+
types: [synchronize]
|
|
8
|
+
|
|
9
|
+
env:
|
|
10
|
+
SSH_PRIVATE_KEY: ${{ secrets.HEDIA_BOT_PRIVATE_SSH_KEY }}
|
|
11
|
+
NPM_TOKEN: ${{ secrets.HEDIA_BOT_NPM_TOKEN }}
|
|
12
|
+
|
|
13
|
+
jobs:
|
|
14
|
+
on-push-commit-bump-and-publish-alpha:
|
|
15
|
+
runs-on: ubuntu-latest
|
|
16
|
+
|
|
17
|
+
strategy:
|
|
18
|
+
matrix:
|
|
19
|
+
node-version: [14.15]
|
|
20
|
+
|
|
21
|
+
steps:
|
|
22
|
+
- uses: actions/checkout@v2
|
|
23
|
+
with:
|
|
24
|
+
ref: ${{ github.event.pull_request.head.ref }}
|
|
25
|
+
|
|
26
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
27
|
+
uses: actions/setup-node@v2
|
|
28
|
+
with:
|
|
29
|
+
node-version: ${{ matrix.node-version }}
|
|
30
|
+
|
|
31
|
+
- name: Register ssh keys
|
|
32
|
+
uses: webfactory/ssh-agent@v0.5.3
|
|
33
|
+
with:
|
|
34
|
+
ssh-private-key: |
|
|
35
|
+
${{ env.SSH_PRIVATE_KEY }}
|
|
36
|
+
|
|
37
|
+
- name: Register NPM access token
|
|
38
|
+
run: npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
|
|
39
|
+
env:
|
|
40
|
+
NPM_TOKEN: ${{ env.NPM_TOKEN }}
|
|
41
|
+
|
|
42
|
+
- name: Set identity
|
|
43
|
+
run: |
|
|
44
|
+
git config --global user.email "ci@hedia.co"
|
|
45
|
+
git config --global user.name "Hedia CI Bot"
|
|
46
|
+
|
|
47
|
+
- name: Bump alpha version
|
|
48
|
+
run: |
|
|
49
|
+
chmod +x ./on-push-commit-bump-alpha.sh && ./on-push-commit-bump-alpha.sh
|
|
50
|
+
|
|
51
|
+
- name: Publish alpha version
|
|
52
|
+
id: publish-alpha
|
|
53
|
+
uses: JS-DevTools/npm-publish@v1
|
|
54
|
+
with:
|
|
55
|
+
token: ${{ env.NPM_TOKEN }}
|
|
56
|
+
tag: alpha
|
|
57
|
+
|
|
58
|
+
- name: Check if version exists
|
|
59
|
+
if: steps.publish-alpha.outputs.type == 'none'
|
|
60
|
+
run: |
|
|
61
|
+
echo "Package JSON version is already published, please bump the version!"
|
|
62
|
+
exit 1
|
|
63
|
+
|
|
64
|
+
- name: Remove alpha tag
|
|
65
|
+
run: |
|
|
66
|
+
chmod +x ./remove-alpha-tag.sh && ./remove-alpha-tag.sh
|
|
67
|
+
git push
|
|
68
|
+
|
|
69
|
+
- name: Remove old comment from PR
|
|
70
|
+
if: steps.publish-alpha.outputs.type != 'none'
|
|
71
|
+
uses: izhangzhihao/delete-comment@master
|
|
72
|
+
with:
|
|
73
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
74
|
+
delete_user_name: github-actions[bot]
|
|
75
|
+
issue_number: ${{ github.event.number }} # remove comments from the current PR
|
|
76
|
+
|
|
77
|
+
- name: Write comment on PR
|
|
78
|
+
if: steps.publish-alpha.outputs.type != 'none'
|
|
79
|
+
uses: peter-evans/create-or-update-comment@v1
|
|
80
|
+
with:
|
|
81
|
+
issue-number: ${{ github.event.number }}
|
|
82
|
+
body: |
|
|
83
|
+
🎉 Successfully released alpha version 🎉
|
|
84
|
+
✅ ${{ steps.publish-alpha.outputs.version }}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
alphaNumber="$(sed -n 's/\("version": "[0-9]\+\.[0-9]\+\.[0-9]\+\-alpha\.\)\([0-9]\+\)\("\)\(,\)/\2/p' package.json)"
|
|
2
|
+
bumpedAlphaNumber="$((alphaNumber+1))"
|
|
3
|
+
|
|
4
|
+
alphaVersion="$(sed -nE 's/^\s*"alphaVersionCounter": "(.*?)",$/\1/p' package.json)"
|
|
5
|
+
bumpedAlphaVersion="$((alphaVersion+1))"
|
|
6
|
+
|
|
7
|
+
sed -i 's/\("alphaVersionCounter": "\)\([0-9]\+\)\("\)/\1'0'\3/' package.json
|
|
8
|
+
sed -i 's/\("version": "\)\([0-9]\+\.[0-9]\+\.[0-9]\+\)\("\)/\1\2\-alpha.'0'\3/' package.json
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
alphaNumber="$(sed -n 's/\("version": "[0-9]\+\.[0-9]\+\.[0-9]\+\-alpha\.\)\([0-9]\+\)\("\)\(,\)/\2/p' package.json)"
|
|
2
|
+
bumpedAlphaNumber="$((alphaNumber+1))"
|
|
3
|
+
|
|
4
|
+
alphaVersion="$(sed -nE 's/^\s*"alphaVersionCounter": "(.*?)",$/\1/p' package.json)"
|
|
5
|
+
bumpedAlphaVersion="$((alphaVersion+1))"
|
|
6
|
+
|
|
7
|
+
sed -i 's/\("version": "\)\([0-9]\+\.[0-9]\+\.[0-9]\+\)\("\)/\1\2\-alpha.'$bumpedAlphaVersion'\3/' package.json
|
|
8
|
+
sed -i 's/\("alphaVersionCounter": "\)\([0-9]\+\)\("\)/\1'$bumpedAlphaVersion'\3/' package.json
|
package/package.json
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
versionNumber=$(sed -nE 's/^\s*"version": "([0-9].[0-9].[0-9]).*?",$/\1/p' package.json)
|
|
2
|
+
alphaNumber="$(sed -n 's/\("version": "[0-9]\+\.[0-9]\+\.[0-9]\+\-alpha\.\)\([0-9]\+\)\("\)\(,\)/\2/p' package.json)"
|
|
3
|
+
alphaVersion="$(sed -nE 's/^\s*"alphaVersionCounter": "(.*?)",$/\1/p' package.json)"
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
if [ "$alphaNumber" != "" ];
|
|
7
|
+
then
|
|
8
|
+
sed -i 's/\("version": "[0-9]\+\.[0-9]\+\.[0-9]\+\)\(-alpha\.\)\([0-9]\+\)\("\)/\1\4/' package.json
|
|
9
|
+
fi
|
|
10
|
+
|
|
11
|
+
git add package.json
|
|
12
|
+
|
|
13
|
+
if [ "$alphaVersion" = "" ] || [ $alphaVersion = "0" ];
|
|
14
|
+
then
|
|
15
|
+
git commit --amend -m "bump ${versionNumber}-alpha.${alphaVersion}"
|
|
16
|
+
else
|
|
17
|
+
git commit -m "bump ${versionNumber}-alpha.${alphaVersion}"
|
|
18
|
+
fi
|
|
19
|
+
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
name: Post-merge - Publish & Update package version
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
pull_request:
|
|
5
|
-
branches:
|
|
6
|
-
- master
|
|
7
|
-
types: [closed]
|
|
8
|
-
|
|
9
|
-
env:
|
|
10
|
-
SSH_PRIVATE_KEY: ${{ secrets.HEDIA_BOT_PRIVATE_SSH_KEY }}
|
|
11
|
-
NPM_TOKEN: ${{ secrets.HEDIA_BOT_NPM_TOKEN }}
|
|
12
|
-
|
|
13
|
-
jobs:
|
|
14
|
-
publish-package-push-master:
|
|
15
|
-
if: github.event.pull_request.merged == true
|
|
16
|
-
|
|
17
|
-
runs-on: ubuntu-latest
|
|
18
|
-
|
|
19
|
-
strategy:
|
|
20
|
-
matrix:
|
|
21
|
-
node-version: [14.15]
|
|
22
|
-
|
|
23
|
-
steps:
|
|
24
|
-
- uses: actions/checkout@v2
|
|
25
|
-
|
|
26
|
-
- name: Use Node.js ${{ matrix.node-version }}
|
|
27
|
-
uses: actions/setup-node@v2
|
|
28
|
-
with:
|
|
29
|
-
node-version: ${{ matrix.node-version }}
|
|
30
|
-
|
|
31
|
-
- name: Register ssh keys
|
|
32
|
-
uses: webfactory/ssh-agent@v0.5.3
|
|
33
|
-
with:
|
|
34
|
-
ssh-private-key: ${{ env.SSH_PRIVATE_KEY }}
|
|
35
|
-
|
|
36
|
-
- name: Register NPM access token
|
|
37
|
-
run: npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
|
|
38
|
-
|
|
39
|
-
- name: Removing alpha tag from package json
|
|
40
|
-
run: chmod +x ./pre-release.sh && ./pre-release.sh
|
|
41
|
-
|
|
42
|
-
- name: Installing dependencies
|
|
43
|
-
run: npm ci
|
|
44
|
-
|
|
45
|
-
- id: publish
|
|
46
|
-
uses: JS-DevTools/npm-publish@v1
|
|
47
|
-
with:
|
|
48
|
-
token: ${{ env.NPM_TOKEN }}
|
|
49
|
-
|
|
50
|
-
- if: steps.publish.outputs.type == 'none'
|
|
51
|
-
run: |
|
|
52
|
-
echo "Failed to publish on npm, version already exists"
|
|
53
|
-
exit 1
|
|
54
|
-
|
|
55
|
-
- name: Commit & Push changes
|
|
56
|
-
uses: actions-js/push@master
|
|
57
|
-
with:
|
|
58
|
-
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
59
|
-
branch: 'master'
|
|
60
|
-
message: 'Post-publish master package version update'
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
name: NPM Alpha Publish Bot
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
pull_request:
|
|
5
|
-
|
|
6
|
-
env:
|
|
7
|
-
SSH_PRIVATE_KEY: ${{ secrets.HEDIA_BOT_PRIVATE_SSH_KEY }}
|
|
8
|
-
NPM_TOKEN: ${{ secrets.HEDIA_BOT_NPM_TOKEN }}
|
|
9
|
-
|
|
10
|
-
jobs:
|
|
11
|
-
publish-alpha-npm-package:
|
|
12
|
-
runs-on: ubuntu-latest
|
|
13
|
-
steps:
|
|
14
|
-
- uses: actions/checkout@v2
|
|
15
|
-
- uses: actions/setup-node@v2
|
|
16
|
-
with:
|
|
17
|
-
node-version: ${{ matrix.node-version }}
|
|
18
|
-
|
|
19
|
-
- name: Register ssh keys
|
|
20
|
-
uses: webfactory/ssh-agent@v0.5.3
|
|
21
|
-
with:
|
|
22
|
-
ssh-private-key: ${{ env.SSH_PRIVATE_KEY }}
|
|
23
|
-
|
|
24
|
-
- name: Register NPM access token
|
|
25
|
-
run: npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
|
|
26
|
-
|
|
27
|
-
- name: Installing dependencies
|
|
28
|
-
run: npm ci
|
|
29
|
-
|
|
30
|
-
- id: publish-alpha
|
|
31
|
-
uses: JS-DevTools/npm-publish@v1
|
|
32
|
-
with:
|
|
33
|
-
token: ${{ env.NPM_TOKEN }}
|
|
34
|
-
tag: alpha
|
|
35
|
-
|
|
36
|
-
- if: steps.publish-alpha.outputs.type == 'none'
|
|
37
|
-
run: |
|
|
38
|
-
echo "Package JSON version is already published, please bump the version!"
|
|
39
|
-
exit 1
|
|
40
|
-
|
|
41
|
-
- if: steps.publish-alpha.outputs.type != 'none'
|
|
42
|
-
uses: izhangzhihao/delete-comment@master
|
|
43
|
-
with:
|
|
44
|
-
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
45
|
-
delete_user_name: github-actions[bot]
|
|
46
|
-
issue_number: ${{ github.event.number }} # remove comments from the current PR
|
|
47
|
-
|
|
48
|
-
- if: steps.publish-alpha.outputs.type != 'none'
|
|
49
|
-
uses: peter-evans/create-or-update-comment@v1
|
|
50
|
-
with:
|
|
51
|
-
issue-number: ${{ github.event.pull_request.number }}
|
|
52
|
-
body: |
|
|
53
|
-
🎉 Successfully released alpha version 🎉
|
|
54
|
-
✅ ${{ steps.publish-alpha.outputs.version }}
|
package/alpha-release.sh
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
alphaNumber="$(sed -n 's/\("version": "[0-9]\+\.[0-9]\+\.[0-9]\+\-alpha\.\)\([0-9]\+\)\("\)\(,\)/\2/p' package.json)"
|
|
2
|
-
bumped="$((alphaNumber+1))"
|
|
3
|
-
if [ "$alphaNumber" = "" ];
|
|
4
|
-
then
|
|
5
|
-
sed -i 's/\("version": "\)\([0-9]\+\.[0-9]\+\.[0-9]\+\)\("\)/\1\2\-alpha.1\3/' package.json
|
|
6
|
-
else
|
|
7
|
-
echo $bumped
|
|
8
|
-
sed -i 's/\("version": "[0-9]\+\.[0-9]\+\.[0-9]\+\-alpha\.\)\([0-9]\+\)\("\)/\1'$bumped'\3/' package.json
|
|
9
|
-
fi
|
|
10
|
-
|
|
11
|
-
git commit package.json -m "bump alpha release to ${bumped}"
|
package/pre-release.sh
DELETED