-
Notifications
You must be signed in to change notification settings - Fork 341
44 lines (44 loc) · 1.39 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
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@v3
- 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 HEAD
gh pr create --title "Bump version to $(git describe --tags)" --body "Approve me 🤖"
gh pr merge --auto --squash
env:
GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }}
release:
if: github.event.pull_request.merged && startsWith(github.head_ref, 'bump/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- run: >
gh release create --target ${{
github.event.pull_request.merge_commit_sha }} {--title=CML\
,}"$(basename "$GITHUB_HEAD_REF")" --generate-notes --draft
env:
GITHUB_TOKEN: ${{ secrets.ADMIN_GITHUB_TOKEN }}
package:
needs: release
secrets: inherit
uses: ./.github/workflows/test-deploy.yml
with:
release: true