Skip to content

Commit

Permalink
feat(gh-actions): add workflows & semantic release conventions (#59)
Browse files Browse the repository at this point in the history
Signed-off-by: AmitKumarDas <[email protected]>
  • Loading branch information
Amit Kumar Das authored May 23, 2020
1 parent 68b7e16 commit 8782eef
Show file tree
Hide file tree
Showing 6 changed files with 111 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
## Pull Request template
Please, go through these steps before you submit a PR.

1. This repository follows semantic versioning convention, therefore each PR title/commit message must follow convention: `<type>(<scope>): [#issue_number] - <subject>`.
`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.
Most common types are:
* `feat` - for new features
* `fix` - for bug fixes or improvements
* `chore` - changes not related to code



IMPORTANT: Please review the [CONTRIBUTING.md](../CONTRIBUTING.md) file for detailed contributing guidelines.

**PLEASE REMOVE THIS TEMPLATE BEFORE SUBMITTING**
2 changes: 2 additions & 0 deletions .github/semantic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
titleAndCommits: true
allowMergeCommits: true
22 changes: 22 additions & 0 deletions .github/workflows/release-docker.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
---
name: Release docker image
on:
push:
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
jobs:
release-docker:
name: Release docker image
runs-on: ubuntu-18.04
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Deploy docker image
uses: docker/build-push-action@v1
with:
username: ${{ secrets.DNAME }}
password: ${{ secrets.DPASS }}
repository: dope
registry: mayadataio
tag_with_ref: true
add_git_labels: true
39 changes: 39 additions & 0 deletions .github/workflows/test-release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
---
name: Test and Release (if on master)
on: [push, pull_request]
jobs:
tests:
runs-on: ubuntu-18.04
strategy:
matrix:
test: ['test']
name: ${{ matrix.test }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: setup env
run: |
echo "::set-env name=GOPATH::$(go env GOPATH)"
echo "::add-path::$(go env GOPATH)/bin"
- name: Setup go
uses: actions/setup-go@v1
with:
go-version: 1.13.5
- run: make ${{ matrix.test }}
release:
name: Release
runs-on: ubuntu-18.04
needs: ['tests']
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 12
- name: Install dependencies
run: npm install ci
- name: Release
env:
GH_TOKEN: ${{ secrets.PAT }}
run: npx semantic-release
25 changes: 25 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# How to Contribute

We'd love to accept your patches and contributions to this project. There are just a few small guidelines you need to follow.

## Contributor License Agreement

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.

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.

## Code Reviews

All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Consult
[GitHub Help](https://help.github.com/articles/about-pull-requests/) for more information on using pull requests.

## Commit messages

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
`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.

Please be aware that new release will be triggered for:
* `feat` - minor release
* `perf/fix` - patch release

where minor/patch as in semantic versioning definition.
8 changes: 8 additions & 0 deletions release.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
"branches": ["master"],
"plugins": [
'@semantic-release/commit-analyzer',
'@semantic-release/release-notes-generator',
'@semantic-release/github',
]
}

0 comments on commit 8782eef

Please sign in to comment.