Skip to content

Commit 41e765b

Browse files
authored
feat: add release automation (#1)
1 parent 48b3129 commit 41e765b

7 files changed

+6790
-0
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'
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 }}
+27
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Manage stale issues and PRs
2+
3+
on:
4+
schedule:
5+
- cron: "0 0 * * *"
6+
7+
jobs:
8+
stale:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/[email protected]
12+
with:
13+
repo-token: ${{ secrets.GITHUB_TOKEN }}
14+
stale-issue-message: |
15+
This issue has been automatically marked as stale because it has not had recent activity :sleeping:
16+
It will be closed in 30 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation.
17+
Thank you for your contributions :heart:
18+
stale-pr-message: |
19+
This pull request has been automatically marked as stale because it has not had recent activity :sleeping:
20+
It will be closed in 30 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation.
21+
Thank you for your contributions :heart:
22+
days-before-stale: 60
23+
days-before-close: 30
24+
stale-issue-label: stale
25+
stale-pr-label: stale
26+
exempt-issue-label: keep-open
27+
exempt-pr-label: keep-open
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Welcome first time contributors
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
issues:
8+
types:
9+
- opened
10+
11+
jobs:
12+
welcome:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/[email protected]
16+
with:
17+
repo-token: ${{ secrets.GITHUB_TOKEN }}
18+
issue-message: |
19+
Welcome to AsyncAPI. Thanks a lot for reporting your first issue.
20+
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out [this issue](https://github.com/asyncapi/asyncapi/issues/115).
21+
pr-message: |
22+
Welcome to AsyncAPI. Thanks a lot for creating your first pull request.
23+
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out [this issue](https://github.com/asyncapi/asyncapi/issues/115).

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
.DS_Store
2+
node_modules

0 commit comments

Comments
 (0)