Skip to content

Commit 18f7f3f

Browse files
authored
feat: add configuration for automated releases (#6)
1 parent 4145ace commit 18f7f3f

File tree

7 files changed

+7916
-1138
lines changed

7 files changed

+7916
-1138
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Automerge release bump PR
2+
3+
on:
4+
pull_request:
5+
types:
6+
- labeled
7+
- unlabeled
8+
- synchronize
9+
- opened
10+
- edited
11+
- ready_for_review
12+
- reopened
13+
- unlocked
14+
pull_request_review:
15+
types:
16+
- submitted
17+
check_suite:
18+
types:
19+
- completed
20+
status: {}
21+
22+
jobs:
23+
24+
autoapprove:
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Autoapproving
28+
uses: hmarr/[email protected]
29+
if: github.actor == 'asyncapi-bot'
30+
with:
31+
github-token: "${{ secrets.GITHUB_TOKEN }}"
32+
33+
automerge:
34+
needs: [autoapprove]
35+
runs-on: ubuntu-latest
36+
steps:
37+
- name: Automerging
38+
uses: pascalgn/[email protected]
39+
if: github.actor == 'asyncapi-bot'
40+
env:
41+
GITHUB_TOKEN: "${{ secrets.GH_TOKEN }}"
42+
GITHUB_LOGIN: asyncapi-bot
43+
MERGE_LABELS: ""
44+
MERGE_METHOD: "squash"
45+
MERGE_COMMIT_MESSAGE: "pull-request-title"
46+
MERGE_RETRIES: "10"
47+
MERGE_RETRY_SLEEP: "10000"

.github/workflows/release.yml

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
8+
jobs:
9+
release:
10+
name: 'Release NPM, GitHub, Docker'
11+
runs-on: ubuntu-latest
12+
steps:
13+
- name: Checkout repo
14+
uses: actions/checkout@v2
15+
- name: Setup Node.js
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: 13
19+
- name: Install dependencies
20+
run: npm ci
21+
- name: Run tests
22+
run: npm test
23+
- name: Get version from package.json before release step
24+
id: initversion
25+
run: echo "::set-output name=version::$(npm run get-version --silent)"
26+
- name: Release to NPM and GitHub
27+
id: release
28+
env:
29+
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
30+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
31+
GIT_AUTHOR_NAME: asyncapi-bot
32+
GIT_AUTHOR_EMAIL: [email protected]
33+
GIT_COMMITTER_NAME: asyncapi-bot
34+
GIT_COMMITTER_EMAIL: [email protected]
35+
run: npm run release
36+
- name: Get version from package.json after release step
37+
id: extractver
38+
run: echo "::set-output name=version::$(npm run get-version --silent)"
39+
- name: Create Pull Request with updated package files
40+
if: steps.initversion.outputs.version != steps.extractver.outputs.version
41+
uses: peter-evans/[email protected]
42+
with:
43+
token: ${{ secrets.GH_TOKEN }}
44+
commit-message: 'chore(release): ${{ steps.extractver.outputs.version }}'
45+
committer: asyncapi-bot <[email protected]>
46+
author: asyncapi-bot <[email protected]>
47+
title: 'chore(release): ${{ steps.extractver.outputs.version }}'
48+
body: 'Version bump in package.json and package-lock.json for release [${{ steps.extractver.outputs.version }}](https://github.com/${{github.repository}}/releases/tag/v${{ steps.extractver.outputs.version }})'
49+
branch: version-bump/${{ steps.extractver.outputs.version }}

.npmrc.template

-1
This file was deleted.

.travis.yml

-8
This file was deleted.

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ This package provides all the versions of the AsyncAPI schema.
77
## Installation
88

99
```bash
10-
npm install asyncapi
10+
npm install @asyncapi/specs
1111
```
1212

1313
## Usage

0 commit comments

Comments
 (0)