Skip to content

Commit

Permalink
feat: add release automation (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
derberg committed Mar 25, 2020
1 parent 4b76f65 commit e3ac9af
Show file tree
Hide file tree
Showing 7 changed files with 6,790 additions and 0 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/automerge-release-pr-bump.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Automerge release bump PR

on:
pull_request:
types:
- labeled
- unlabeled
- synchronize
- opened
- edited
- ready_for_review
- reopened
- unlocked
pull_request_review:
types:
- submitted
check_suite:
types:
- completed
status: {}

jobs:

autoapprove:
runs-on: ubuntu-latest
steps:
- name: Autoapproving
uses: hmarr/auto-approve-action@v2.0.0
if: github.actor == 'asyncapi-bot'
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"

automerge:
needs: [autoapprove]
runs-on: ubuntu-latest
steps:
- name: Automerging
uses: pascalgn/automerge-action@v0.7.5
if: github.actor == 'asyncapi-bot'
env:
GITHUB_TOKEN: "${{ secrets.GH_TOKEN }}"
GITHUB_LOGIN: asyncapi-bot
MERGE_LABELS: ""
MERGE_METHOD: "squash"
MERGE_COMMIT_MESSAGE: "pull-request-title"
MERGE_RETRIES: "10"
MERGE_RETRY_SLEEP: "10000"
49 changes: 49 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Release

on:
push:
branches:
- master

jobs:
release:
name: 'Release NPM, GitHub'
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v1
with:
node-version: 13
- name: Install dependencies
run: npm ci
- name: Run tests
run: npm test
- name: Get version from package.json before release step
id: initversion
run: echo "::set-output name=version::$(npm run get-version --silent)"
- name: Release to NPM and GitHub
id: release
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
GIT_AUTHOR_NAME: asyncapi-bot
GIT_AUTHOR_EMAIL: info@asyncapi.io
GIT_COMMITTER_NAME: asyncapi-bot
GIT_COMMITTER_EMAIL: info@asyncapi.io
run: npm run release
- name: Get version from package.json after release step
id: extractver
run: echo "::set-output name=version::$(npm run get-version --silent)"
- name: Create Pull Request with updated package files
if: steps.initversion.outputs.version != steps.extractver.outputs.version
uses: peter-evans/create-pull-request@v2.4.4
with:
token: ${{ secrets.GH_TOKEN }}
commit-message: 'chore(release): ${{ steps.extractver.outputs.version }}'
committer: asyncapi-bot <info@asyncapi.io>
author: asyncapi-bot <info@asyncapi.io>
title: 'chore(release): ${{ steps.extractver.outputs.version }}'
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 }})'
branch: version-bump/${{ steps.extractver.outputs.version }}
27 changes: 27 additions & 0 deletions .github/workflows/stale-issues-prs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Manage stale issues and PRs

on:
schedule:
- cron: "0 0 * * *"

jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v1.1.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: |
This issue has been automatically marked as stale because it has not had recent activity :sleeping:
It will be closed in 30 days if no further activity occurs. To unstale this issue, add a comment with detailed explanation.
Thank you for your contributions :heart:
stale-pr-message: |
This pull request has been automatically marked as stale because it has not had recent activity :sleeping:
It will be closed in 30 days if no further activity occurs. To unstale this pull request, add a comment with detailed explanation.
Thank you for your contributions :heart:
days-before-stale: 60
days-before-close: 30
stale-issue-label: stale
stale-pr-label: stale
exempt-issue-label: keep-open
exempt-pr-label: keep-open
23 changes: 23 additions & 0 deletions .github/workflows/welcome-first-time-contrib.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Welcome first time contributors

on:
pull_request:
types:
- opened
issues:
types:
- opened

jobs:
welcome:
runs-on: ubuntu-latest
steps:
- uses: actions/first-interaction@v1.0.0
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
issue-message: |
Welcome to AsyncAPI. Thanks a lot for reporting your first issue.
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).
pr-message: |
Welcome to AsyncAPI. Thanks a lot for creating your first pull request.
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).
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.DS_Store
node_modules

0 comments on commit e3ac9af

Please sign in to comment.