Skip to content
This repository was archived by the owner on Jan 5, 2023. It is now read-only.

Commit 3945eef

Browse files
author
Charlie
authored
chore(release): automate build process with gh actions (#34)
* chore(release): add gh actions workflow and automated semantic versioning automated semanatic versioning includes commitlint and pre-commit hooks * chore(release): update yarn.lock * chore(release): only push image if new release on main branch * chore(release): use blockstack-devops gh token * chore(release): update workflow
1 parent 331bfa1 commit 3945eef

File tree

3 files changed

+1072
-7
lines changed

3 files changed

+1072
-7
lines changed

.github/workflows/app.co-api.yml

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
name: app.co-api
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
tags-ignore:
8+
- '**'
9+
paths-ignore:
10+
- '**/CHANGELOG.md'
11+
pull_request:
12+
13+
jobs:
14+
build-publish:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
with:
19+
token: ${{ secrets.GH_TOKEN }}
20+
21+
- name: Notify slack start
22+
if: success()
23+
id: slack
24+
env:
25+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
26+
uses: voxmedia/github-action-slack-notify-build@v1.1.2
27+
with:
28+
channel: devops-notify
29+
status: STARTING
30+
color: warning
31+
32+
- name: Semantic Release
33+
uses: cycjimmy/semantic-release-action@v2.5.0
34+
id: semantic
35+
env:
36+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
37+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
38+
SEMANTIC_RELEASE_PACKAGE: ${{ github.workflow }}
39+
with:
40+
extra_plugins: |
41+
@semantic-release/changelog
42+
@semantic-release/git
43+
semantic-release-slack-bot
44+
45+
- name: Build/Tag/Push Image
46+
uses: docker/build-push-action@v1
47+
with:
48+
repository: blockstack/${{ github.workflow }}
49+
username: ${{ secrets.QUAY_USERNAME }}
50+
password: ${{ secrets.QUAY_PASSWORD }}
51+
registry: quay.io
52+
tags: ${{ steps.semantic.outputs.new_release_version }}
53+
tag_with_ref: true
54+
add_git_labels: true
55+
# Only push if there's a new release on main branch, or if building a non-main branch
56+
push: ${{ github.ref != 'refs/heads/master' || steps.semantic.outputs.new_release_version != '' }}
57+
58+
- name: Notify slack success
59+
if: success()
60+
env:
61+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
62+
uses: voxmedia/github-action-slack-notify-build@v1.1.2
63+
with:
64+
message_id: ${{ steps.slack.outputs.message_id }}
65+
channel: devops-notify
66+
status: SUCCESS
67+
color: good
68+
69+
- name: Notify slack fail
70+
if: failure()
71+
env:
72+
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
73+
uses: voxmedia/github-action-slack-notify-build@v1.1.2
74+
with:
75+
message_id: ${{ steps.slack.outputs.message_id }}
76+
channel: devops-notify
77+
status: FAILED
78+
color: danger

package.json

Lines changed: 33 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44
"version": "1.0.0",
55
"author": "The Blockstack Team",
66
"bugs": {
7-
"url": "https://github.com/blockstackpbc/app.co/issues"
7+
"url": "https://github.com/blockstack/app.co-api/issues"
88
},
99
"dependencies": {
1010
"@babel/polyfill": "7.0.0-beta.44",
1111
"@babel/register": "7.0.0-beta.44",
12+
"@commitlint/cli": "^9.1.1",
13+
"@commitlint/config-conventional": "^9.1.1",
1214
"@google-cloud/storage": "^1.7.0",
1315
"@promster/express": "^3.2.0",
1416
"@promster/server": "^3.2.0",
@@ -71,21 +73,22 @@
7173
"eslint-plugin-prettier": "^2.6.0",
7274
"eslint-plugin-react": "^7.7.0",
7375
"eslint-scope": "^3.7.1",
76+
"husky": "^4.2.5",
7477
"jest": "^22.4.3",
7578
"prettier": "^1.12.1",
7679
"regenerator-runtime": "^0.11.1",
7780
"request": "^2.85.0",
7881
"sepia": "^2.0.2"
7982
},
80-
"homepage": "https://github.com/blockstackpbc/app.co#readme",
83+
"homepage": "https://github.com/blockstack/app.co-api#readme",
8184
"keywords": [
8285
"dapps"
8386
],
8487
"license": "ISC",
8588
"main": "index.js",
8689
"repository": {
8790
"type": "git",
88-
"url": "git+ssh://git@github.com/blockstackpbc/app.co.git"
91+
"url": "git+ssh://git@github.com/blockstack/app.co-api.git"
8992
},
9093
"scripts": {
9194
"db:create": "sequelize db:create",
@@ -118,5 +121,32 @@
118121
},
119122
"engines": {
120123
"node": "^10.15"
124+
},
125+
"commitlint": {
126+
"extends": [
127+
"@commitlint/config-conventional"
128+
]
129+
},
130+
"husky": {
131+
"hooks": {
132+
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
133+
}
134+
},
135+
"release": {
136+
"plugins": [
137+
"@semantic-release/commit-analyzer",
138+
"@semantic-release/release-notes-generator",
139+
"@semantic-release/github",
140+
"@semantic-release/changelog",
141+
"@semantic-release/git",
142+
[
143+
"semantic-release-slack-bot",
144+
{
145+
"notifyOnSuccess": true,
146+
"notifyOnFail": true,
147+
"markdownReleaseNotes": true
148+
}
149+
]
150+
]
121151
}
122152
}

0 commit comments

Comments
 (0)