1
1
name : " Create new release"
2
2
3
- on : workflow_dispatch
3
+ on :
4
+ workflow_dispatch :
5
+ inputs :
6
+ version :
7
+ description : " Select the version increment"
8
+ required : true
9
+ type : choice
10
+ options :
11
+ - major
12
+ - minor
13
+ - patch
14
+ - premajor
15
+ - preminor
16
+ - prepatch
17
+ - prerelease
4
18
5
19
jobs :
6
20
create-new-release :
@@ -21,12 +35,45 @@ jobs:
21
35
- name : Setup env
22
36
run : echo "FONTAWESOME_NPM_AUTH_TOKEN=${{ secrets.FONTAWESOME_NPM_AUTH_TOKEN }}" > .env
23
37
24
- - name : Install dependencies
25
- run : yarn install
38
+ - name : Bump version in package.json
39
+ run : yarn version ${{ github.event.inputs.version }}
40
+
41
+ - name : Extract version from package.json
42
+ id : extract_version
43
+ run : |
44
+ version=$(grep '"version"' package.json | sed -E 's/.*"version": "([^"]+)".*/\1/')
45
+ echo "Extracted version: $version"
46
+ echo "::set-output name=version::$version"
47
+
48
+ - name : Create version bump branch
49
+ run : git checkout -b release/v${{ steps.extract_version.outputs.version }}
26
50
27
51
- name : Initialize mandatory git config
28
52
uses : fregante/setup-git-user@v2
29
53
54
+ - name : Commit manifest files
55
+ id : make-commit
56
+ run : |
57
+ git add package.json
58
+ git commit --message "Update package.json v${{ steps.extract_version.outputs.version }}"
59
+
60
+ echo "::set-output name=commit::$(git rev-parse HEAD)"
61
+
62
+ - name : Publish release branch
63
+ run : git push origin release/v${{ steps.extract_version.outputs.version }}
64
+
65
+ - name : Merge version update into main branch
66
+ uses :
thomaseizinger/[email protected]
67
+ env :
68
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
69
+ with :
70
+ head : release/v${{ steps.extract_version.outputs.version }}
71
+ base : main
72
+ title : " Merge release/v${{ steps.extract_version.outputs.version }} into main branch"
73
+
74
+ - name : Install dependencies
75
+ run : yarn install
76
+
30
77
# Build assets
31
78
- run : yarn build
32
79
- run : npm pack
0 commit comments