Skip to content

Commit 7ed8c70

Browse files
derbergKarolina Zydek
and
Karolina Zydek
authored
feat: introduce automated releasing to GitHub (#16)
Co-Authored-By: Karolina Zydek <[email protected]>
1 parent 601921e commit 7ed8c70

File tree

5 files changed

+100
-31
lines changed

5 files changed

+100
-31
lines changed

.github/workflows/.releaserc

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
branches:
3+
- master
4+
plugins:
5+
- - "@semantic-release/commit-analyzer"
6+
- preset: conventionalcommits
7+
- - "@semantic-release/release-notes-generator"
8+
- preset: conventionalcommits
9+
- - "@semantic-release/github"
10+
- assets:
11+
- path: asyncapi-converter.darwin.amd64
12+
label: Binary - Darwin AMD64
13+
- path: asyncapi-converter.linux.amd64
14+
label: Binary - Linux AMD64
15+
- path: asyncapi-converter.windows.amd64.exe
16+
label: Binary - Windows AMD64

.github/workflows/release.yml

Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
test:
10+
name: 'Testing'
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
go:
15+
- '1.14'
16+
- '1.13'
17+
- '1.12'
18+
steps:
19+
- name: Checkout repo
20+
uses: actions/checkout@v2
21+
- name: Setup Go
22+
uses: actions/[email protected]
23+
with:
24+
go-version: '${{ matrix.go }}'
25+
- name: Invoking go test
26+
run: go test ./...
27+
28+
release:
29+
name: 'Release to GitHub'
30+
runs-on: ubuntu-latest
31+
needs:
32+
- test
33+
steps:
34+
- name: Checkout repo
35+
uses: actions/checkout@v2
36+
- name: Setup Go
37+
uses: actions/[email protected]
38+
with:
39+
go-version: '1.14'
40+
- name: Invoking go vet and binaries generation
41+
run: |
42+
go vet ./...
43+
GOOS=darwin GOARCH=amd64 go build -o=.github/workflows/asyncapi-converter.darwin.amd64 ./cmd/api-converter/main.go
44+
GOOS=linux GOARCH=amd64 go build -o=.github/workflows/asyncapi-converter.linux.amd64 ./cmd/api-converter/main.go
45+
GOOS=windows GOARCH=amd64 go build -o=.github/workflows/asyncapi-converter.windows.amd64.exe ./cmd/api-converter/main.go
46+
- name: Setup Node.js
47+
uses: actions/setup-node@v1
48+
with:
49+
node-version: 13
50+
- name: Add plugin for conventional commits
51+
run: npm install conventional-changelog-conventionalcommits
52+
working-directory: ./.github/workflows
53+
- name: Release to GitHub
54+
working-directory: ./.github/workflows
55+
env:
56+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
57+
GIT_AUTHOR_NAME: asyncapi-bot
58+
GIT_AUTHOR_EMAIL: [email protected]
59+
GIT_COMMITTER_NAME: asyncapi-bot
60+
GIT_COMMITTER_EMAIL: [email protected]
61+
run: npx semantic-release

.travis.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

CONTRIBUTING.md

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,33 @@ Learn the rules to follow when you contribute code or content to this project.
66

77
## Contributing process
88

9-
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:
9+
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:
1010

1111
1. Fork this repository.
12-
2. Make your changes. Do not forgot about:
12+
1. Make your changes. Do not forgot about:
1313
- [Naming and architecture convention](./DEVELOPMENT.md#naming--architecture-convention)
1414
- [Project structure](./development-guide.md/#project-structure)
1515
- Tests
1616
- Updating relevant documents if you add, remove, update props, configuration, or themes
17-
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/).
18-
4. Rebase your changes to the latest `master` branch.
19-
5. Create a pull request.
17+
1. Create a PR.
2018

2119
> **NOTE:** When you add content to the `converter-go` repository, follow the [guidelines](https://github.com/kyma-project/community/tree/master/guidelines/content-guidelines) from the `kyma-project` organization.
2220
23-
Pull requests are very welcome. However, if you want to add a new feature, use GitHub issues to discuss your ideas first.
21+
PRs are very welcome. However, if you want to add a new feature, use GitHub issues to discuss your ideas first.
22+
23+
## Conventional commits
24+
25+
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/).
26+
27+
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:
28+
29+
- `fix: ` prefix in the title indicates that a PR is a bug fix and the PATCH release must be triggered.
30+
- `feat: ` prefix in the title indicates that a PR is a feature and the MINOR release must be triggered.
31+
- `docs: ` prefix in the title indicates that a PR is only related to the documentation and there is no need to trigger a release.
32+
- `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.
33+
- `test: ` prefix in the title indicates that a PR is only related to tests and there is no need to trigger a release.
34+
- `refactor: ` prefix in the title indicates that a PR is only related to refactoring and there is no need to trigger a release.
35+
36+
For a MAJOR release, just add `!` to the prefix, like `fix!: ` or `refactor!: `.
37+
38+
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).

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ To install the AsyncAPI Converter package, run:
1818
go get github.com/asyncapi/converter-go/...
1919
```
2020

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

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

0 commit comments

Comments
 (0)