-
Notifications
You must be signed in to change notification settings - Fork 121
82 lines (71 loc) · 2.06 KB
/
bump.yml
File metadata and controls
82 lines (71 loc) · 2.06 KB
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
name: Bump
on:
workflow_dispatch:
inputs:
mode:
description: "How to apply the bump"
type: choice
options:
- pr
- push
default: pr
release:
description: "bumpp release type"
type: choice
options:
- major
- minor
- patch
- next
- conventional
- pre-patch
- pre-minor
- pre-major
- as-is
default: next
permissions:
contents: write
pull-requests: write
jobs:
bump:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
with:
fetch-depth: 0
- uses: pnpm/action-setup@v5
with:
version: 10
- uses: actions/setup-node@v6
with:
node-version: lts/*
cache: pnpm
- name: Install dependencies
run: pnpm install
- name: Configure git user
run: |
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
- name: Ensure main branch for push mode
if: inputs.mode == 'push'
run: |
BRANCH=$(git rev-parse --abbrev-ref HEAD)
if [ "$BRANCH" != "main" ]; then
echo "Push mode must run on main (current: $BRANCH)."
exit 1
fi
- name: Bump versions (push)
if: inputs.mode == 'push'
run: npm run bump -- --release ${{ inputs.release }} --yes
- name: Bump versions (pr)
if: inputs.mode == 'pr'
run: npm run bump -- --release ${{ inputs.release }} --no-commit --no-tag --no-push --yes
- name: Create pull request
if: inputs.mode == 'pr'
uses: peter-evans/create-pull-request@v8
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: "chore: release (${{ inputs.release }}) #${{ github.run_id }}"
title: "chore: release (${{ inputs.release }})"
branch: "release/${{ inputs.release }}-${{ github.run_id }}"
base: main