@hedia/types 2.1.25 → 2.1.26-alpha.33
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.
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
name: Publish alpha
|
|
2
|
-
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
|
|
3
6
|
env:
|
|
4
7
|
SSH_PRIVATE_KEY: ${{ secrets.HEDIA_BOT_PRIVATE_SSH_KEY }}
|
|
5
8
|
NPM_TOKEN: ${{ secrets.HEDIA_BOT_NPM_TOKEN }}
|
|
@@ -9,12 +12,16 @@ jobs:
|
|
|
9
12
|
runs-on: ubuntu-latest
|
|
10
13
|
steps:
|
|
11
14
|
- uses: actions/checkout@v1
|
|
12
|
-
-
|
|
15
|
+
- name: Use Node.js ${{ matrix.node-version }}
|
|
16
|
+
uses: actions/setup-node@v1.4.4
|
|
13
17
|
with:
|
|
14
|
-
node-version:
|
|
15
|
-
-
|
|
16
|
-
|
|
17
|
-
- uses: JS-DevTools/npm-publish@v1
|
|
18
|
+
node-version: ${{ matrix.node-version }}
|
|
19
|
+
- id: publish-alpha
|
|
20
|
+
uses: JS-DevTools/npm-publish@v1
|
|
18
21
|
with:
|
|
19
22
|
token: ${{ env.NPM_TOKEN }}
|
|
20
23
|
tag: alpha
|
|
24
|
+
- if: steps.publish-alpha.outputs.type == 'none'
|
|
25
|
+
run: |
|
|
26
|
+
echo "Package JSON version is already published, please bump the version!"
|
|
27
|
+
exit 1
|
|
@@ -30,6 +30,8 @@ jobs:
|
|
|
30
30
|
ssh-private-key: ${{ env.SSH_PRIVATE_KEY }}
|
|
31
31
|
- name: Register NPM access token
|
|
32
32
|
run: npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
|
|
33
|
+
- name: Removing alpha tag from package json
|
|
34
|
+
run: chmod +x ./post-release.sh && ./post-release.sh
|
|
33
35
|
- id: publish
|
|
34
36
|
uses: JS-DevTools/npm-publish@v1
|
|
35
37
|
with:
|
|
@@ -30,6 +30,8 @@ jobs:
|
|
|
30
30
|
run: npm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN}"
|
|
31
31
|
env:
|
|
32
32
|
NPM_TOKEN: ${{ env.NPM_TOKEN }}
|
|
33
|
+
- name: Removing alpha tag from package json
|
|
34
|
+
run: chmod +x ./post-release.sh && ./post-release.sh
|
|
33
35
|
- id: publish
|
|
34
36
|
uses: JS-DevTools/npm-publish@v1
|
|
35
37
|
with:
|
package/package.json
CHANGED
package/post-release.sh
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
alphaNumber="$(sed -n 's/\("version": "[0-9]\+\.[0-9]\+\.[0-9]\+\-alpha\.\)\([0-9]\+\)\("\)\(,\)/\2/p' package.json)"
|
|
2
|
+
if [ "$alphaNumber" != "" ];
|
|
3
|
+
then
|
|
4
|
+
sed -i 's/\("version": "[0-9]\+\.[0-9]\+\.[0-9]\+\)\(-alpha\.\)\([0-9]\+\)\("\)/\1\4/' package.json
|
|
5
|
+
echo "Removing alpha bit!"
|
|
6
|
+
fi
|
package/pre-release.sh
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#alias bingo = "$OSTYPE" == "linux-gnu" ? "sed" : "sed"
|
|
2
|
+
alphaNumber="$(sed -n 's/\("version": "[0-9]\+\.[0-9]\+\.[0-9]\+\-alpha\.\)\([0-9]\+\)\("\)\(,\)/\2/p' package.json)"
|
|
3
|
+
bumped="$((alphaNumber+1))"
|
|
4
|
+
if [ "$alphaNumber" = "" ];
|
|
5
|
+
then
|
|
6
|
+
sed -i 's/\("version": "\)\([0-9]\+\.[0-9]\+\.[0-9]\+\)\("\)/\1\2\-alpha.1\3/' package.json
|
|
7
|
+
else
|
|
8
|
+
echo $bumped
|
|
9
|
+
sed -i 's/\("version": "[0-9]\+\.[0-9]\+\.[0-9]\+\-alpha\.\)\([0-9]\+\)\("\)/\1'$bumped'\3/' package.json
|
|
10
|
+
fi
|
|
11
|
+
|
|
12
|
+
git commit package.json -m "bump alpha release to ${bumped}"
|