Skip to content

Commit 8782eef

Browse files
author
Amit Kumar Das
authored
feat(gh-actions): add workflows & semantic release conventions (#59)
Signed-off-by: AmitKumarDas <[email protected]>
1 parent 68b7e16 commit 8782eef

File tree

6 files changed

+111
-0
lines changed

6 files changed

+111
-0
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
## Pull Request template
2+
Please, go through these steps before you submit a PR.
3+
4+
1. This repository follows semantic versioning convention, therefore each PR title/commit message must follow convention: `<type>(<scope>): [#issue_number] - <subject>`.
5+
`type` is defining if release will be triggering after merging submitted changes, details in [CONTRIBUTING.md](../CONTRIBUTING.md). `#issue_number` is optional, when commit resolves any github issue.
6+
Most common types are:
7+
* `feat` - for new features
8+
* `fix` - for bug fixes or improvements
9+
* `chore` - changes not related to code
10+
11+
12+
13+
IMPORTANT: Please review the [CONTRIBUTING.md](../CONTRIBUTING.md) file for detailed contributing guidelines.
14+
15+
**PLEASE REMOVE THIS TEMPLATE BEFORE SUBMITTING**

.github/semantic.yml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
titleAndCommits: true
2+
allowMergeCommits: true

.github/workflows/release-docker.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Release docker image
3+
on:
4+
push:
5+
tags:
6+
- 'v[0-9]+.[0-9]+.[0-9]+'
7+
jobs:
8+
release-docker:
9+
name: Release docker image
10+
runs-on: ubuntu-18.04
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
- name: Deploy docker image
15+
uses: docker/build-push-action@v1
16+
with:
17+
username: ${{ secrets.DNAME }}
18+
password: ${{ secrets.DPASS }}
19+
repository: dope
20+
registry: mayadataio
21+
tag_with_ref: true
22+
add_git_labels: true

.github/workflows/test-release.yaml

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
name: Test and Release (if on master)
3+
on: [push, pull_request]
4+
jobs:
5+
tests:
6+
runs-on: ubuntu-18.04
7+
strategy:
8+
matrix:
9+
test: ['test']
10+
name: ${{ matrix.test }}
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
- name: setup env
15+
run: |
16+
echo "::set-env name=GOPATH::$(go env GOPATH)"
17+
echo "::add-path::$(go env GOPATH)/bin"
18+
- name: Setup go
19+
uses: actions/setup-go@v1
20+
with:
21+
go-version: 1.13.5
22+
- run: make ${{ matrix.test }}
23+
release:
24+
name: Release
25+
runs-on: ubuntu-18.04
26+
needs: ['tests']
27+
steps:
28+
- name: Checkout
29+
uses: actions/checkout@v1
30+
- name: Setup Node.js
31+
uses: actions/setup-node@v1
32+
with:
33+
node-version: 12
34+
- name: Install dependencies
35+
run: npm install ci
36+
- name: Release
37+
env:
38+
GH_TOKEN: ${{ secrets.PAT }}
39+
run: npx semantic-release

CONTRIBUTING.md

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# How to Contribute
2+
3+
We'd love to accept your patches and contributions to this project. There are just a few small guidelines you need to follow.
4+
5+
## Contributor License Agreement
6+
7+
Contributions to this project must be accompanied by a Contributor License Agreement. You (or your employer) retain the copyright to your contribution; this simply gives us permission to use and redistribute your contributions as part of the project. Head over to <https://cla.developers.google.com/> to see your current agreements on file or to sign a new one.
8+
9+
You generally only need to submit a CLA once, so if you've already submitted one (even if it was for a different project), you probably don't need to do it again.
10+
11+
## Code Reviews
12+
13+
All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Consult
14+
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more information on using pull requests.
15+
16+
## Commit messages
17+
18+
This repository uses [semantic versioning](https://semver.org/), therefore every commit and PR must follow naming convention. We require commit header to be in form `<type>(<scope>): [#issue_number] - <subject>`, where `type`, `scope` and
19+
`subject` as defined in [angular commit message convention](https://github.com/angular/angular.js/blob/master/DEVELOPERS.md#type). `#issue_number` is optional, if commit resolves any gihub issue.
20+
21+
Please be aware that new release will be triggered for:
22+
* `feat` - minor release
23+
* `perf/fix` - patch release
24+
25+
where minor/patch as in semantic versioning definition.

release.config.js

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
module.exports = {
2+
"branches": ["master"],
3+
"plugins": [
4+
'@semantic-release/commit-analyzer',
5+
'@semantic-release/release-notes-generator',
6+
'@semantic-release/github',
7+
]
8+
}

0 commit comments

Comments
 (0)