Skip to content

Commit

Permalink
Merge pull request #24 from matrix-org/t3chguy-patch-1
Browse files Browse the repository at this point in the history
Automate releases
  • Loading branch information
t3chguy authored Jun 8, 2022
2 parents 564235b + 028832d commit 1f51ea9
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 10 deletions.
57 changes: 57 additions & 0 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Release Automation
on:
workflow_dispatch:
inputs:
version-bump:
description: The scale of the version bump required for semver compatibility
required: true
default: patch
type: choice
options:
- patch
- minor
- major
concurrency: release
jobs:
release:
name: "Release & Publish"
runs-on: ubuntu-latest
steps:
- name: 🧮 Checkout code
uses: actions/checkout@v3
with:
token: ${{ secrets.ELEMENT_BOT_TOKEN }}

- name: 🔧 Set up node environment
uses: actions/setup-node@v3
with:
cache: 'yarn'

- name: 🛠️ Setup
run: yarn install --pure-lockfile

- name: 👊 Bump version
run: |
yarn version --no-git-tag-version --${{ github.event.inputs.version-bump }}
git config --global user.name 'ElementRobot'
git config --global user.email '[email protected]'
git commit -am "{{ github.event.inputs.version-bump }} version bump"
git push
- name: 🚀 Publish to npm
id: npm-publish
uses: JS-DevTools/npm-publish@v1
with:
token: ${{ secrets.NPM_TOKEN }}
access: public

- name: 🧬 Create release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: v${{ steps.npm-publish.outputs.version }}
release_name: Release ${{ steps.npm-publish.outputs.version }}
body: ${{ steps.npm-publish.outputs.version }} Release
draft: false
prerelease: false
6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,9 @@ following depending on the configs you enable:
* eslint-plugin-react-hooks
* eslint-plugin-import
* typescript

## Releasing

Use "[Run workflow](https://github.com/matrix-org/eslint-plugin-matrix-org/actions/workflows/release.yaml)".
Refer to [SemVer](https://semver.org/) for versioning semantics.
This workflow will bump the version, publish NPM, and create a GitHub release.
10 changes: 0 additions & 10 deletions docs/releases.md

This file was deleted.

0 comments on commit 1f51ea9

Please sign in to comment.