4
4
types : [closed]
5
5
branches : [master]
6
6
workflow_dispatch :
7
-
7
+ inputs :
8
+ dry_run :
9
+ description : Don't actually do the work, just describe it
10
+ default : true
11
+ type : boolean
12
+ new_version :
13
+ description : Set the version to a specific value
14
+ required : false
15
+ type : string
8
16
jobs :
9
17
bumpversion :
10
18
runs-on : ubuntu-latest
@@ -31,33 +39,30 @@ jobs:
31
39
- name : Generate the changelog and get the release hint
32
40
id : generate-changelog
33
41
run : |
34
- INFO=$(generate-changelog --output all)
35
- RELEASE_KIND=$(echo "$INFO" | jq -r '.release_hint')
36
- NOTES=$(echo "$INFO" | jq -r '.notes')
37
- NOTES="${NOTES//'%'/'%25'}"
38
- NOTES="${NOTES//$'\\n'/'%0A'}"
39
- NOTES="${NOTES//$'\n'/'%0A'}"
40
- NOTES="${NOTES//$'\r'/'%0D'}"
41
-
42
+ RELEASE_KIND=$(generate-changelog --output release-hint)
42
43
echo "::notice::Suggested release type is: ${RELEASE_KIND}"
43
44
echo "RELEASE_KIND=$RELEASE_KIND" >> $GITHUB_ENV
44
45
echo "release-kind=$RELEASE_KIND" >> $GITHUB_OUTPUT
45
46
46
- echo "NOTES=$NOTES" >> $GITHUB_ENV
47
- echo "notes=$NOTES" >> $GITHUB_OUTPUT
48
- echo $NOTES >> release-notes.md
49
-
50
- - name : Archive production artifacts
51
- uses : actions/upload-artifact@v3
52
- with :
53
- name : release-notes.md
54
- path : release-notes.md
55
-
56
- - name : Bump Version
47
+ - name : Bump Version auto
48
+ if : ${{ github.event_name != "workflow_dispatch" }}
57
49
shell : bash
58
50
run : |
59
51
if [[ $RELEASE_KIND != "no-release" ]]; then
60
52
bump-my-version -v "$RELEASE_KIND"
61
53
git push
62
54
git push --tags
63
55
fi
56
+
57
+ - name : Bump Version manual
58
+ if : ${{ github.event_name == "workflow_dispatch" }}
59
+ shell : bash
60
+ env :
61
+ BUMPVERSION_DRY_RUN : ${{ inputs.dry_run }}
62
+ BUMPVERSION_NEW_VERSION : ${{ inputs.tags }}
63
+ run : |
64
+ bump-my-version -v "$RELEASE_KIND"
65
+ if [[ BUMPVERSION_DRY_RUN == "false" ]]; then
66
+ git push
67
+ git push --tags
68
+ fi
0 commit comments