Skip to content

Commit

Permalink
Simplify release process
Browse files Browse the repository at this point in the history
  • Loading branch information
0x2b3bfa0 authored Feb 26, 2022
1 parent d51a2dd commit 1eb782a
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Release
on:
workflow_dispatch:
inputs:
bump:
type: choice
required: true
description: Bump version number
options: [major, minor, patch]
default: patch
pull_request:
types: [closed]
jobs:
bump:
if: github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: |
git config --global user.name Olivaw[bot]
git config --global user.email [email protected]
git checkout -b bump/$(npm version ${{ github.event.inputs.bump }})
git push --set-upstream origin --follow-tags HEAD
gh pr create --title "Bump version to $(git describe --tags)" --fill
env:
GITHUB_TOKEN: ${{ github.token }}
release:
if: github.event.pull_request.merged && startsWith(github.head_ref, 'bump/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: gh release create --generate-notes --draft {--target=,--title=CML\ ,}$(basename ${{ github.head_ref }})
env:
GITHUB_TOKEN: ${{ github.token }}

0 comments on commit 1eb782a

Please sign in to comment.