From 1eb782af82fa057dcfb201eee9fd3304678eac8b Mon Sep 17 00:00:00 2001 From: Helio Machado <0x2b3bfa0+git@googlemail.com> Date: Sat, 26 Feb 2022 22:02:16 +0100 Subject: [PATCH] Simplify release process --- .github/workflows/release.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 000000000..5d30578fb --- /dev/null +++ b/.github/workflows/release.yml @@ -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 64868532+iterative-olivaw@users.noreply.github.com + 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 }}