-
-
Notifications
You must be signed in to change notification settings - Fork 15
52 lines (44 loc) · 1.52 KB
/
manual-build.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
45
46
47
48
49
50
51
52
name: Manual Version Bump and Release
on:
workflow_dispatch:
inputs:
versionType:
description: 'Version type (major, minor, patch)'
required: true
default: 'patch'
jobs:
bump-version-and-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Node.js
uses: actions/setup-node@v4
with:
cache: 'npm'
- name: Install dependencies
run: npm install
- name: Configure Git
run: |
git config user.name "github-actions"
git config user.email "[email protected]"
- name: Bump version and create tag
run: |
git config user.name "github-actions"
git config user.email "[email protected]"
VERSION=$(npm version ${{ github.event.inputs.versionType }})
echo "new_version=$VERSION" >> $GITHUB_ENV
- name: Create new branch for version bump
run: |
VERSION_BUMP_BRANCH="version-bump-${{ github.event.inputs.versionType }}-$(date +%s)"
git checkout -b $VERSION_BUMP_BRANCH
git push origin $VERSION_BUMP_BRANCH
- name: Create Pull Request
uses: peter-evans/create-pull-request@v6
with:
branch: ${{ env.VERSION_BUMP_BRANCH }}
title: "Bump version to ${{ env.new_version }}"
body: "This is an automated pull request to update the version."
token: ${{ secrets.G_TOKEN }}
delete-branch: true