Skip to content

Commit dab681c

Browse files
authored
Switch deployment to GitHub Actions (pubnub#220)
build: switch deployment to GitHub Actions Switch product deployment to GitHub Actions.
1 parent a132edd commit dab681c

File tree

182 files changed

+6100
-5672
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

182 files changed

+6100
-5672
lines changed

.github/CODEOWNERS

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
* @are @raipubnub @mohitpubnub @parfeon
2-
.travis/* @parfeon @are @raipubnub
3-
README.md @techwritermat
2+
.github/* @parfeon @are @raipubnub @mohitpubnub
3+
README.md @techwritermat @kazydek
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Commands processor
2+
3+
on:
4+
issue_comment:
5+
types: [created]
6+
7+
jobs:
8+
process:
9+
name: Process command
10+
if: ${{ github.event.issue.pull_request && endsWith(github.repository, '-private') != true && startsWith(github.event.comment.body, '@client-engineering-bot ') }}
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repository
14+
uses: actions/checkout@v2
15+
- name: Checkout release actions
16+
uses: actions/checkout@v2
17+
with:
18+
repository: pubnub/client-engineering-deployment-tools
19+
ref: v1
20+
token: ${{ secrets.GH_TOKEN }}
21+
path: .github/.release/actions
22+
- name: Process changelog entries
23+
uses: ./.github/.release/actions/actions/commands
24+
with:
25+
token: ${{ secrets.GH_TOKEN }}
26+
listener: client-engineering-bot
27+
jira-api-key: ${{ secrets.JIRA_API_KEY }}

.github/workflows/release.yml

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
name: Automated product release
2+
3+
on:
4+
pull_request:
5+
branches: [ master ]
6+
types: [ closed ]
7+
8+
9+
jobs:
10+
check-release:
11+
name: Check release required
12+
runs-on: ubuntu-latest
13+
if: ${{ github.event.pull_request.merged && endsWith(github.repository, '-private') != true }}
14+
outputs:
15+
release: ${{ steps.check.outputs.ready }}
16+
steps:
17+
- name: Checkout actions
18+
uses: actions/checkout@v2
19+
with:
20+
repository: pubnub/client-engineering-deployment-tools
21+
ref: v1
22+
token: ${{ secrets.GH_TOKEN }}
23+
path: .github/.release/actions
24+
- id: check
25+
name: Check pre-release completed
26+
uses: ./.github/.release/actions/actions/checks/release
27+
with:
28+
token: ${{ secrets.GH_TOKEN }}
29+
publish:
30+
name: Publish package
31+
runs-on: ubuntu-latest
32+
needs: check-release
33+
if: ${{ needs.check-release.outputs.release == 'true' }}
34+
steps:
35+
- name: Checkout repository
36+
uses: actions/checkout@v2
37+
with:
38+
# This should be the same as the one specified for on.pull_request.branches
39+
ref: master
40+
- name: Checkout actions
41+
uses: actions/checkout@v2
42+
with:
43+
repository: pubnub/client-engineering-deployment-tools
44+
ref: v1
45+
token: ${{ secrets.GH_TOKEN }}
46+
path: .github/.release/actions
47+
- name: Publish to S3
48+
uses: ./.github/.release/actions/actions/services/aws
49+
with:
50+
token: ${{ secrets.GH_TOKEN }}
51+
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
52+
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
53+
content-type: application/javascript
54+
content-encoding: gzip
55+
acl: public-read
56+
local-path: upload/gzip/*.js
57+
remote-path: pubnub/sdk/javascript
58+
- name: Publish to NPM
59+
uses: ./.github/.release/actions/actions/services/npm
60+
with:
61+
token: ${{ secrets.GH_TOKEN }}
62+
npm-token: ${{ secrets.NPM_TOKEN }}
63+
check-ownership: false
64+
- name: Create Release
65+
uses: ./.github/.release/actions/actions/services/github-release
66+
with:
67+
token: ${{ secrets.GH_TOKEN }}
68+
artifacts-folder: upload/normal/
69+
jira-api-key: ${{ secrets.JIRA_API_KEY }}
70+
last-service: true
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
# Check whether previous builds already generated artifacts or not.
5+
if ! [[ -d "$(pwd)/upload" ]]; then
6+
npm ci
7+
gulp compile
8+
fi
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
npm ci
5+
gulp compile
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
# Check whether previous builds already generated artifacts or not.
5+
if ! [[ -d "$(pwd)/upload" ]]; then
6+
npm ci
7+
gulp compile
8+
fi
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
".pubnub.yml": [
3+
{
4+
"pattern": "^version: \"(v?(\\d+\\.?){2,}([a-zA-Z0-9-]+(\\.?\\d+)?)?)\"$",
5+
"clearedPrefix": true,
6+
"clearedSuffix": false
7+
},
8+
{ "pattern": "\/refs\/tags\/(v?(\\d+\\.?){2,}([a-zA-Z0-9-]+(\\.?\\d+)?)?)\\.zip", "cleared": false },
9+
{ "pattern": "\/releases\/download\/(v?(\\d+\\.?){2,}([a-zA-Z0-9-]+(\\.?\\d+)?)?)\/", "cleared": false },
10+
{
11+
"pattern": "\/releases\/download\/.+\/pubnub\\.(v?(\\d+\\.?){2,}([a-zA-Z0-9-]+(\\.?\\d+)?)?)\\.js$",
12+
"clearedPrefix": true,
13+
"clearedSuffix": false
14+
}
15+
],
16+
"package.json": [
17+
{
18+
"pattern": "^\\s{2,}\"version\": \"(v?(\\d+\\.?){2,}([a-zA-Z0-9-]+(\\.?\\d+)?)?)\",$",
19+
"clearedPrefix": true,
20+
"clearedSuffix": false
21+
}
22+
],
23+
"src/core/components/config.js": [
24+
{
25+
"pattern": "^\\s{2,}return '(v?(\\.?\\d+){2,}([a-zA-Z0-9-]+(\\.?\\d+)?)?)';$",
26+
"clearedPrefix": true,
27+
"clearedSuffix": false
28+
}
29+
],
30+
"README.md": [
31+
{
32+
"pattern": "javascript/pubnub.(v?(\\.?\\d+){2,}([a-zA-Z0-9-]+(\\.?\\d+)?)?).js$",
33+
"clearedPrefix": true,
34+
"clearedSuffix": false
35+
},
36+
{
37+
"pattern": "javascript/pubnub.(v?(\\.?\\d+){2,}([a-zA-Z0-9-]+(\\.?\\d+)?)?).min.js$",
38+
"clearedPrefix": true,
39+
"clearedSuffix": false
40+
}
41+
]
42+
}

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,7 @@ coverage/
1212
*.iml
1313
dist/web/stats.json
1414
dist/titanium/stats.json
15+
16+
# GitHub Actions #
17+
##################
18+
.github/.release

.nycrc.yml

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

.travis.yml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,6 @@ addons:
1515

1616
stages:
1717
- name: "test"
18-
if: |
19-
type != pull_request
20-
- name: "code coverage"
21-
if: |
22-
type == pull_request
2318

2419
jobs:
2520
include:
@@ -33,10 +28,3 @@ jobs:
3328
- name: 'NodeJS 12'
3429
node_js: '12'
3530
script: gulp test
36-
- stage: "code coverage"
37-
name: 'Test & Code coverage'
38-
node_js: '12'
39-
script: gulp test
40-
after_success:
41-
- npm install codecov codacy-coverage
42-
- cat ./coverage/lcov.info | node_modules/.bin/codacy-coverage

0 commit comments

Comments
 (0)