Skip to content

Commit 7d80a03

Browse files
authored
Merge pull request pubnub#213 from pubnub/ci/add-workflows-demo
Demo code initial commit
2 parents 20a8e64 + 3c8476d commit 7d80a03

File tree

9 files changed

+2451
-0
lines changed

9 files changed

+2451
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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 && 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: github-actions
20+
token: ${{ secrets.GH_TOKEN }}
21+
path: ".github/.release/actions"
22+
- name: Run changelogs actions
23+
uses: "./.github/.release/actions/actions/commands"
24+
with:
25+
token: ${{ secrets.GH_TOKEN }}
26+
listener: client-engineering-bot
27+
publisher-name: Serhii Mamontov
28+
publisher-email: [email protected]

.github/workflows/release.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Automated project release
2+
3+
on:
4+
pull_request:
5+
branches: [ master ]
6+
types: [ closed ]
7+
8+
jobs:
9+
check-release:
10+
name: Check release required
11+
runs-on: ubuntu-latest
12+
# Uncomment this to run job only for merge (not PR close).
13+
# if: ${{ github.event.pull_request.merged }}
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: github-actions
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: github-actions
45+
token: ${{ secrets.GH_TOKEN }}
46+
path: ".github/.release/actions"
47+
- name: Run release actions
48+
# Intentional fail, because credentials not specified.
49+
uses: "./.github/.release/actions/actions/services/npm"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
console.log('>>>> Hello from JS')
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+
echo "Hello from bash $(date)!"
5+
echo "Hello from bash $(date)!" > "./generated.txt"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"project-1": {
3+
"path": "project1",
4+
"name": "Monorepo demo"
5+
}
6+
}
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
{
2+
"README.md": [
3+
{
4+
"pattern": "sdk\/javascript\/pubnub\\.((\\d+\\.?){2,})(.min)?\\.js$",
5+
"cleared": true
6+
}
7+
],
8+
"src/core/components/config.js": [
9+
{
10+
"pattern": "^\\s{2,}return '((\\d+\\.?){2,})';$",
11+
"cleared": false
12+
}
13+
],
14+
".pubnub.yml": [
15+
{
16+
"pattern": "^version: \"(.+)\"$",
17+
"cleared": false
18+
}
19+
],
20+
"package.json": [
21+
{
22+
"pattern": "^\\s{2,}\"version\": \"(.+)\",$",
23+
"cleared": true
24+
}
25+
]
26+
}

0 commit comments

Comments
 (0)