18
18
19
19
env :
20
20
MODULE_ID : cbvalidation
21
+ SNAPSHOT : ${{ inputs.snapshot || false }}
21
22
22
23
jobs :
23
24
# #########################################################################################
@@ -36,75 +37,75 @@ jobs:
36
37
distribution : " temurin"
37
38
java-version : " 11"
38
39
39
- # - name: Setup CommandBox
40
- # uses: Ortus-Solutions/[email protected]
41
- # with:
42
- # forgeboxAPIKey: ${{ secrets.FORGEBOX_TOKEN }}
43
-
44
- # - name: Setup Environment Variables For Build Process
45
- # id: current_version
46
- # run: |
47
- # echo "VERSION=`cat box.json | jq '.version' -r`" >> $GITHUB_ENV
48
-
49
- # # master or snapshot
50
- # echo "Github Ref is $GITHUB_REF"
51
- # echo "BRANCH=master" >> $GITHUB_ENV
52
- # if [ $GITHUB_REF == 'refs/heads/development' ]
53
- # then
54
- # echo "BRANCH=development" >> $GITHUB_ENV
55
- # fi
56
-
57
- # - name: Update changelog [unreleased] with latest version
58
- # uses: thomaseizinger/[email protected]
59
- # if: ${{ !inputs.snapshot }}
60
- # with:
61
- # changelogPath: ./changelog.md
62
- # tag: v${{ env.VERSION }}
63
-
64
- # - name: Build ${{ env.MODULE_ID }}
65
- # run: |
66
- # box install commandbox-docbox
67
- # box task run taskfile=build/Build target=run :version=${{ env.VERSION }} :projectName=${{ env.MODULE_ID }} :buildID=${{ github.run_number }} :branch=${{ env.BRANCH }}
68
-
69
- # - name: Commit Changelog To Master
70
-
71
- # if: ${{ !inputs.snapshot }}
72
- # with:
73
- # author_name: Github Actions
74
-
75
- # message: 'Finalized changelog for v${{ env.VERSION }}'
76
- # add: changelog.md
77
-
78
- # - name: Tag Version
79
- # uses: rickstaa/[email protected]
80
- # if: ${{ !inputs.snapshot }}
81
- # with:
82
- # tag: "v${{ env.VERSION }}"
83
- # force_push_tag: true
84
- # message: "Latest Release v${{ env.VERSION }}"
85
-
86
- # - name: Upload Build Artifacts
87
- # if: success()
88
- # uses: actions/upload-artifact@v3
89
- # with:
90
- # name: ${{ env.MODULE_ID }}
91
- # path: |
92
- # .artifacts/**/*
93
- # changelog.md
94
-
95
- # - name: Publish To ForgeBox
96
- # run: |
97
- # cd .tmp/${{ env.MODULE_ID }} && box forgebox publish --force
98
-
99
- # - name: Create Github Release
100
-
101
- # continue-on-error: true
102
- # if: ${{ !inputs.snapshot }}
103
- # with:
104
- # title: ${{ env.VERSION }}
105
- # changelog: changelog.md
106
- # token: ${{ secrets.GITHUB_TOKEN }}
107
- # ref: refs/tags/v${{ env.VERSION }}
40
+ - name : Setup CommandBox
41
+ uses :
Ortus-Solutions/[email protected]
42
+ with :
43
+ forgeboxAPIKey : ${{ secrets.FORGEBOX_TOKEN }}
44
+
45
+ - name : Setup Environment Variables For Build Process
46
+ id : current_version
47
+ run : |
48
+ echo "VERSION=`cat box.json | jq '.version' -r`" >> $GITHUB_ENV
49
+
50
+ # master or snapshot
51
+ echo "Github Ref is $GITHUB_REF"
52
+ echo "BRANCH=master" >> $GITHUB_ENV
53
+ if [ $GITHUB_REF == 'refs/heads/development' ]
54
+ then
55
+ echo "BRANCH=development" >> $GITHUB_ENV
56
+ fi
57
+
58
+ - name : Update changelog [unreleased] with latest version
59
+ uses :
thomaseizinger/[email protected]
60
+ if : ${{ !env.SNAPSHOT }}
61
+ with :
62
+ changelogPath : ./changelog.md
63
+ tag : v${{ env.VERSION }}
64
+
65
+ - name : Build ${{ env.MODULE_ID }}
66
+ run : |
67
+ box install commandbox-docbox
68
+ box task run taskfile=build/Build target=run :version=${{ env.VERSION }} :projectName=${{ env.MODULE_ID }} :buildID=${{ github.run_number }} :branch=${{ env.BRANCH }}
69
+
70
+ - name : Commit Changelog To Master
71
+
72
+ if : ${{ !env.SNAPSHOT }}
73
+ with :
74
+ author_name : Github Actions
75
+
76
+ message : ' Finalized changelog for v${{ env.VERSION }}'
77
+ add : changelog.md
78
+
79
+ - name : Tag Version
80
+
81
+ if : ${{ !env.SNAPSHOT }}
82
+ with :
83
+ tag : " v${{ env.VERSION }}"
84
+ force_push_tag : true
85
+ message : " Latest Release v${{ env.VERSION }}"
86
+
87
+ - name : Upload Build Artifacts
88
+ if : success()
89
+ uses : actions/upload-artifact@v3
90
+ with :
91
+ name : ${{ env.MODULE_ID }}
92
+ path : |
93
+ .artifacts/**/*
94
+ changelog.md
95
+
96
+ - name : Publish To ForgeBox
97
+ run : |
98
+ cd .tmp/${{ env.MODULE_ID }} && box forgebox publish --force
99
+
100
+ - name : Create Github Release
101
+
102
+ continue-on-error : true
103
+ if : ${{ !env.SNAPSHOT }}
104
+ with :
105
+ title : ${{ env.VERSION }}
106
+ changelog : changelog.md
107
+ token : ${{ secrets.GITHUB_TOKEN }}
108
+ ref : refs/tags/v${{ env.VERSION }}
108
109
109
110
# #########################################################################################
110
111
# Prep Next Release
@@ -120,29 +121,29 @@ jobs:
120
121
with :
121
122
ref : development
122
123
123
- # - name: Download build artifacts
124
- # uses: actions/download-artifact@v2
125
- # with:
126
- # name: ${{ env.MODULE_ID }}
127
- # path: .tmp
128
-
129
- # # Copy the changelog to the development branch
130
- # - name: Copy Changelog
131
- # run: |
132
- # cp .tmp/changelog.md changelog.md
133
-
134
- # # Bump to next version
135
- # - name: Bump Version
136
- # run: |
137
- # box bump --minor --!TagVersion
138
-
139
- # # Commit it back to development
140
- # - name: Commit Version Bump
141
-
142
- # with:
143
- # author_name: Github Actions
144
-
145
- # message: 'Version bump'
146
- # add: |
147
- # box.json
148
- # changelog.md
124
+ - name : Download build artifacts
125
+ uses : actions/download-artifact@v2
126
+ with :
127
+ name : ${{ env.MODULE_ID }}
128
+ path : .tmp
129
+
130
+ # Copy the changelog to the development branch
131
+ - name : Copy Changelog
132
+ run : |
133
+ cp .tmp/changelog.md changelog.md
134
+
135
+ # Bump to next version
136
+ - name : Bump Version
137
+ run : |
138
+ box bump --minor --!TagVersion
139
+
140
+ # Commit it back to development
141
+ - name : Commit Version Bump
142
+
143
+ with :
144
+ author_name : Github Actions
145
+
146
+ message : ' Version bump'
147
+ add : |
148
+ box.json
149
+ changelog.md
0 commit comments