@hedia/types 2.1.34 → 2.1.36-alpha.1

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.
@@ -0,0 +1,24 @@
1
+ name: Node.js CI
2
+
3
+ on:
4
+ pull_request:
5
+
6
+ jobs:
7
+ build:
8
+ runs-on: ubuntu-latest
9
+
10
+ strategy:
11
+ matrix:
12
+ node-version: [14.15]
13
+
14
+ steps:
15
+ - uses: actions/checkout@v2
16
+
17
+ - name: Use Node.js ${{ matrix.node-version }}
18
+ uses: actions/setup-node@v2
19
+ with:
20
+ node-version: ${{ matrix.node-version }}
21
+
22
+ - run: npm ci
23
+ env:
24
+ CI: true
@@ -0,0 +1,96 @@
1
+ name: On open PR - Version Bump & Publish Alpha
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - master
7
+ types: [opened]
8
+
9
+ env:
10
+ NPM_TOKEN: ${{ secrets.HEDIA_BOT_NPM_TOKEN }}
11
+
12
+ jobs:
13
+ validate-pr-labels:
14
+ runs-on: ubuntu-latest
15
+
16
+ steps:
17
+ - name: Validate PR labels
18
+ uses: docker://agilepathway/pull-request-label-checker:v1.0.102
19
+ with:
20
+ one_of: major,minor,patch
21
+ repo_token: ${{ secrets.GITHUB_TOKEN }}
22
+
23
+ on-open-pr-publish-alpha:
24
+ needs: [validate-pr-labels]
25
+ runs-on: ubuntu-latest
26
+
27
+ strategy:
28
+ matrix:
29
+ node-version: [14.15]
30
+
31
+ steps:
32
+ - uses: actions/checkout@v2
33
+ with:
34
+ ref: ${{ github.event.pull_request.head.ref }}
35
+
36
+ - name: Use Node.js ${{ matrix.node-version }}
37
+ uses: actions/setup-node@v2
38
+ with:
39
+ node-version: ${{ matrix.node-version }}
40
+
41
+ - name: Set identity
42
+ run: |
43
+ git config --global user.email "ci@hedia.co"
44
+ git config --global user.name "Hedia CI Bot"
45
+
46
+ - name: Amend [major] to Latest Commit
47
+ if: "contains(github.event.pull_request.labels.*.name, 'Major')"
48
+ run: |
49
+ npm version premajor --preid alpha
50
+
51
+ - name: Amend [minor] to Latest Commit
52
+ if: "!contains(github.event.pull_request.labels.*.name, 'Major') && contains(github.event.pull_request.labels.*.name, 'Minor')"
53
+ run: |
54
+ npm version preminor --preid alpha
55
+
56
+ - name: Amend [patch] to Latest Commit
57
+ if: "!contains(github.event.pull_request.labels.*.name, 'Major') && !contains(github.event.pull_request.labels.*.name, 'Minor')"
58
+ run: |
59
+ npm version prepatch --preid alpha
60
+
61
+ - name: Bump alpha version
62
+ run: |
63
+ chmod +x ./on-open-pr-bump-alpha-release.sh && ./on-open-pr-bump-alpha-release.sh
64
+
65
+ - name: Publish alpha version
66
+ id: publish-alpha
67
+ uses: JS-DevTools/npm-publish@v1
68
+ with:
69
+ token: ${{ env.NPM_TOKEN }}
70
+ tag: alpha
71
+
72
+ - name: Check if version exists
73
+ if: steps.publish-alpha.outputs.type == 'none'
74
+ run: |
75
+ echo "Package JSON version is already published, please bump the version!"
76
+ exit 1
77
+
78
+ - name: Remove alpha tag
79
+ run: |
80
+ chmod +x ./remove-alpha-tag.sh && ./remove-alpha-tag.sh
81
+ git push
82
+
83
+ - name: Remove old comment from PR
84
+ uses: izhangzhihao/delete-comment@master
85
+ with:
86
+ github_token: ${{ secrets.GITHUB_TOKEN }}
87
+ delete_user_name: github-actions[bot]
88
+ issue_number: ${{ github.event.number }} # remove comments from the current PR
89
+
90
+ - name: Write comment on PR
91
+ uses: peter-evans/create-or-update-comment@v1
92
+ with:
93
+ issue-number: ${{ github.event.number }}
94
+ body: |
95
+ 🎉 Successfully released alpha version 🎉
96
+ ✅ ${{ steps.publish-alpha.outputs.version }}
@@ -0,0 +1,55 @@
1
+ name: On post-merge - Publish package
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - master
7
+ types: [closed]
8
+
9
+ env:
10
+ NPM_TOKEN: ${{ secrets.HEDIA_BOT_NPM_TOKEN }}
11
+
12
+ jobs:
13
+ on-post-merge-publish-package:
14
+ if: github.event.pull_request.merged == true
15
+
16
+ runs-on: ubuntu-latest
17
+
18
+ strategy:
19
+ matrix:
20
+ node-version: [14.15]
21
+
22
+ steps:
23
+ - uses: actions/checkout@v2
24
+ - uses: actions/setup-node@v2
25
+ with:
26
+ node-version: ${{ matrix.node-version }}
27
+
28
+ - name: Publish package
29
+ id: publish-package
30
+ uses: JS-DevTools/npm-publish@v1
31
+ with:
32
+ token: ${{ env.NPM_TOKEN }}
33
+
34
+ - name: Check if version exists
35
+ if: steps.publish-package.outputs.type == 'none'
36
+ run: |
37
+ echo "Package JSON version is already published, please bump the version!"
38
+ exit 1
39
+
40
+ - name: Remove old comment from PR
41
+ if: steps.publish-package.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
+ - name: Write comment on PR
49
+ if: steps.publish-package.outputs.type != 'none'
50
+ uses: peter-evans/create-or-update-comment@v1
51
+ with:
52
+ issue-number: ${{ github.event.number }}
53
+ body: |
54
+ 🎉 Successfully released package 🎉
55
+ ✅ ${{ steps.publish-package.outputs.version }}
@@ -0,0 +1,99 @@
1
+ name: On push - Bump & publish alpha version
2
+
3
+ on:
4
+ pull_request:
5
+ branches:
6
+ - master
7
+ types: [synchronize]
8
+
9
+ env:
10
+ NPM_TOKEN: ${{ secrets.HEDIA_BOT_NPM_TOKEN }}
11
+
12
+ jobs:
13
+ on-push-commit-bump-and-publish-alpha:
14
+ runs-on: ubuntu-latest
15
+
16
+ outputs:
17
+ type: ${{ steps.publish-alpha.outputs.type }}
18
+ version: ${{ steps.publish-alpha.outputs.version }}
19
+ skip: ${{ env.CI_SKIP }}
20
+
21
+ strategy:
22
+ matrix:
23
+ node-version: [14.15]
24
+
25
+ steps:
26
+ - uses: actions/checkout@v2
27
+ with:
28
+ ref: ${{ github.event.pull_request.head.ref }}
29
+ token: ${{ secrets.HEDIA_BOT_GITHUB_PAT }}
30
+
31
+ - uses: mstachniuk/ci-skip@v1
32
+ with:
33
+ commit-filter: "autobump"
34
+
35
+ - name: Use Node.js ${{ matrix.node-version }}
36
+ if: ${{ env.CI_SKIP == 'false' }}
37
+ uses: actions/setup-node@v2
38
+ with:
39
+ node-version: ${{ matrix.node-version }}
40
+
41
+ - name: Set identity
42
+ if: ${{ env.CI_SKIP == 'false' }}
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
+ if: ${{ env.CI_SKIP == 'false' }}
49
+ run: |
50
+ chmod +x ./on-push-commit-bump-alpha.sh && ./on-push-commit-bump-alpha.sh
51
+
52
+ - name: Publish alpha version
53
+ if: ${{ env.CI_SKIP == 'false' }}
54
+ id: publish-alpha
55
+ uses: JS-DevTools/npm-publish@v1
56
+ with:
57
+ token: ${{ env.NPM_TOKEN }}
58
+ tag: alpha
59
+
60
+ - name: Check if version exists
61
+ if: steps.publish-alpha.outputs.type == 'none'
62
+ run: |
63
+ echo "Package JSON version is already published, please bump the version!"
64
+ exit 1
65
+
66
+ - name: Remove alpha tag
67
+ if: ${{ env.CI_SKIP == 'false' }}
68
+ run: |
69
+ chmod +x ./remove-alpha-tag.sh && ./remove-alpha-tag.sh
70
+ git push
71
+
72
+ after-publish:
73
+ runs-on: ubuntu-latest
74
+ needs: [on-push-commit-bump-and-publish-alpha]
75
+ if: needs.on-push-commit-bump-and-publish-alpha.outputs.skip == 'false'
76
+
77
+ strategy:
78
+ matrix:
79
+ node-version: [14.15]
80
+
81
+ steps:
82
+ - uses: actions/checkout@v2
83
+ with:
84
+ ref: ${{ github.event.pull_request.head.ref }}
85
+
86
+ - name: Remove old comment from PR
87
+ uses: izhangzhihao/delete-comment@master
88
+ with:
89
+ github_token: ${{ secrets.GITHUB_TOKEN }}
90
+ delete_user_name: github-actions[bot]
91
+ issue_number: ${{ github.event.number }} # remove comments from the current PR
92
+
93
+ - name: Write comment on PR
94
+ uses: peter-evans/create-or-update-comment@v1
95
+ with:
96
+ issue-number: ${{ github.event.number }}
97
+ body: |
98
+ 🎉 Successfully released alpha version 🎉
99
+ ✅ ${{ needs.on-push-commit-bump-and-publish-alpha.outputs.version }}
@@ -4,6 +4,7 @@ on:
4
4
  pull_request:
5
5
  branches:
6
6
  - master
7
+ types: [opened, reopened, edited, synchronize]
7
8
 
8
9
  permissions:
9
10
  pull-requests: read
@@ -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
@@ -1,6 +1,7 @@
1
1
  {
2
2
  "name": "@hedia/types",
3
- "version": "2.1.34",
3
+ "version": "2.1.36-alpha.1",
4
+ "alphaVersionCounter": "1",
4
5
  "description": "Enums, interfaces, and other common types for use in Hedia's software.",
5
6
  "main": "dist/index.js",
6
7
  "repository": {
@@ -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 "autobump ${versionNumber}-alpha.${alphaVersion}"
16
+ else
17
+ git commit -m "autobump ${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
@@ -1,5 +0,0 @@
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
- fi