Skip to content

Commit

Permalink
feat: introduce automated releasing to GitHub (#16)
Browse files Browse the repository at this point in the history
Co-Authored-By: Karolina Zydek <[email protected]>
  • Loading branch information
derberg and Karolina Zydek authored Mar 25, 2020
1 parent 601921e commit 7ed8c70
Show file tree
Hide file tree
Showing 5 changed files with 100 additions and 31 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/.releaserc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
branches:
- master
plugins:
- - "@semantic-release/commit-analyzer"
- preset: conventionalcommits
- - "@semantic-release/release-notes-generator"
- preset: conventionalcommits
- - "@semantic-release/github"
- assets:
- path: asyncapi-converter.darwin.amd64
label: Binary - Darwin AMD64
- path: asyncapi-converter.linux.amd64
label: Binary - Linux AMD64
- path: asyncapi-converter.windows.amd64.exe
label: Binary - Windows AMD64
61 changes: 61 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: Release

on:
push:
branches:
- master

jobs:
test:
name: 'Testing'
runs-on: ubuntu-latest
strategy:
matrix:
go:
- '1.14'
- '1.13'
- '1.12'
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Go
uses: actions/[email protected]
with:
go-version: '${{ matrix.go }}'
- name: Invoking go test
run: go test ./...

release:
name: 'Release to GitHub'
runs-on: ubuntu-latest
needs:
- test
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Go
uses: actions/[email protected]
with:
go-version: '1.14'
- name: Invoking go vet and binaries generation
run: |
go vet ./...
GOOS=darwin GOARCH=amd64 go build -o=.github/workflows/asyncapi-converter.darwin.amd64 ./cmd/api-converter/main.go
GOOS=linux GOARCH=amd64 go build -o=.github/workflows/asyncapi-converter.linux.amd64 ./cmd/api-converter/main.go
GOOS=windows GOARCH=amd64 go build -o=.github/workflows/asyncapi-converter.windows.amd64.exe ./cmd/api-converter/main.go
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 13
- name: Add plugin for conventional commits
run: npm install conventional-changelog-conventionalcommits
working-directory: ./.github/workflows
- name: Release to GitHub
working-directory: ./.github/workflows
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GIT_AUTHOR_NAME: asyncapi-bot
GIT_AUTHOR_EMAIL: [email protected]
GIT_COMMITTER_NAME: asyncapi-bot
GIT_COMMITTER_EMAIL: [email protected]
run: npx semantic-release
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

27 changes: 21 additions & 6 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,33 @@ Learn the rules to follow when you contribute code or content to this project.

## Contributing process

The contributing process in this project relies on the [GitHub flow](https://guides.github.com/introduction/flow/index.html). This means that you contribute through pull requests. When adding new code or content to this project, follow these rules:
The contributing process in this project relies on the [GitHub flow](https://guides.github.com/introduction/flow/index.html). This means that you contribute through pull requests (PRs). When adding new code or content to this project, follow these rules:

1. Fork this repository.
2. Make your changes. Do not forgot about:
1. Make your changes. Do not forgot about:
- [Naming and architecture convention](./DEVELOPMENT.md#naming--architecture-convention)
- [Project structure](./development-guide.md/#project-structure)
- Tests
- Updating relevant documents if you add, remove, update props, configuration, or themes
3. Squash your changes to a single commit. Write a concise commit message in the imperative mood, as described [here](https://chris.beams.io/posts/git-commit/).
4. Rebase your changes to the latest `master` branch.
5. Create a pull request.
1. Create a PR.

> **NOTE:** When you add content to the `converter-go` repository, follow the [guidelines](https:/kyma-project/community/tree/master/guidelines/content-guidelines) from the `kyma-project` organization.
Pull requests are very welcome. However, if you want to add a new feature, use GitHub issues to discuss your ideas first.
PRs are very welcome. However, if you want to add a new feature, use GitHub issues to discuss your ideas first.

## Conventional commits

This project follows the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary) specification. Releasing to GitHub and NPM is done with the support of [semantic-release](https://semantic-release.gitbook.io/semantic-release/).

A PR should have a title that follows the specification, otherwise, merging is blocked. If you are not familiar with the specification, simply ask maintainers to modify the PR. You can also use this cheatsheet:

- `fix: ` prefix in the title indicates that a PR is a bug fix and the PATCH release must be triggered.
- `feat: ` prefix in the title indicates that a PR is a feature and the MINOR release must be triggered.
- `docs: ` prefix in the title indicates that a PR is only related to the documentation and there is no need to trigger a release.
- `chore: ` prefix in the title indicates that a PR is only related to the project cleanup and there is no need to trigger a release.
- `test: ` prefix in the title indicates that a PR is only related to tests and there is no need to trigger a release.
- `refactor: ` prefix in the title indicates that a PR is only related to refactoring and there is no need to trigger a release.

For a MAJOR release, just add `!` to the prefix, like `fix!: ` or `refactor!: `.

A prefix that follows the specification is not enough though. Remember that the title must be clear, descriptive, and in the [imperative mood](https://chris.beams.io/posts/git-commit/#imperative).
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ To install the AsyncAPI Converter package, run:
go get github.com/asyncapi/converter-go/...
```

> **TIP:** You can also get binaries from the [latest GitHub release](https:/asyncapi/converter-go/releases/latest).
## Usage

You can use the AsyncAPI Converter in the terminal or as a package.
Expand Down

0 comments on commit 7ed8c70

Please sign in to comment.