1
1
name : Master CI
2
2
3
3
on :
4
- workflow_dispatch :
5
- # push:
6
- # branches: [ master ]
4
+ push :
5
+ branches : [ master ]
7
6
8
7
jobs :
9
- publish_central :
8
+ prepare_release :
10
9
runs-on : ubuntu-latest
11
10
12
11
steps :
13
12
- uses : actions/checkout@v2
13
+
14
+ - name : Configure Git
15
+ run : |
16
+ git config --global user.email "[email protected] "
17
+ git config --global user.name "GitHub Actions"
18
+
19
+ - name : Un-SNAP root
20
+ run : mvn -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false
21
+
22
+ - name : Un-SNAP demo
23
+ run : mvn -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false
24
+ working-directory : vaadin-date-range-picker-demo
25
+
26
+ - name : Un-SNAP
27
+ run : mvn -B versions:set -DremoveSnapshot -DgenerateBackupPoms=false
28
+ working-directory : vaadin-date-range-picker
29
+
30
+ - name : Get version
31
+ id : version
32
+ run : |
33
+ echo "::set-output name=release::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)"
34
+ working-directory : vaadin-date-range-picker
35
+
36
+ - name : Commit and Push
37
+ run : |
38
+ git add -A
39
+ git commit -m "Release ${{ steps.version.outputs.release }}"
40
+ git push origin
41
+ git tag v${{ steps.version.outputs.release }}
42
+ git push origin --tags
43
+
44
+ - name : Create Release
45
+ id : create_release
46
+ uses : actions/create-release@v1
47
+ env :
48
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
49
+ with :
50
+ tag_name : v${{ steps.version.outputs.release }}
51
+ release_name : v${{ steps.version.outputs.release }}
52
+ body : |
53
+ ## Installation
54
+ Add the following lines to your pom:
55
+ ```XML
56
+ <dependency>
57
+ <groupId>com.xdev-software</groupId>
58
+ <artifactId>vaadin-date-range-picker</artifactId>
59
+ <version>${{ steps.version.outputs.release }}</version>
60
+ </dependency>
61
+ ```
62
+ draft : false
63
+ prerelease : false
14
64
65
+ - name : Save Release Asset Upload URL to File
66
+ shell : bash
67
+ run : |
68
+ echo '${{ steps.create_release.outputs.upload_url }}' > release_asset_upload_url.txt
69
+
70
+ - name : Upload Release Asset Upload URL
71
+ uses : actions/upload-artifact@v2
72
+ with :
73
+ name : release_asset_upload_url
74
+ path : release_asset_upload_url.txt
75
+
76
+ publish_central : # Publish the code to central
77
+ runs-on : ubuntu-latest
78
+ needs : [prepare_release]
79
+ steps :
80
+ - uses : actions/checkout@v2
81
+
82
+ - name : Init Git and pull
83
+ run : |
84
+ git config --global user.email "[email protected] "
85
+ git config --global user.name "GitHub Actions"
86
+ git pull
87
+
15
88
- name : Set up JDK 1.8 Apache Maven Central
16
89
uses : actions/setup-java@v1
17
90
with : # running setup-java again overwrites the settings.xml
@@ -30,19 +103,25 @@ jobs:
30
103
MAVEN_GPG_PASSPHRASE : ${{ secrets.MAVEN_GPG_PASSPHRASE }}
31
104
working-directory : vaadin-date-range-picker
32
105
33
- build_directory :
106
+ build_directory : # Build a ZIP that can be uploaded to Vaadin Directory
34
107
runs-on : ubuntu-latest
35
-
108
+ needs : [prepare_release]
36
109
steps :
37
110
- uses : actions/checkout@v2
38
111
112
+ - name : Init Git and pull
113
+ run : |
114
+ git config --global user.email "[email protected] "
115
+ git config --global user.name "GitHub Actions"
116
+ git pull
117
+
39
118
- name : Set up JDK 1.8
40
119
uses : actions/setup-java@v1
41
120
with :
42
121
java-version : 1.8
43
122
44
123
- name : Build for Vaadin Directory
45
- run : mvn install -Pdirectory
124
+ run : mvn -B install -Pdirectory
46
125
working-directory : vaadin-date-range-picker
47
126
48
127
- name : Upload asset
@@ -51,3 +130,67 @@ jobs:
51
130
name : vaadin-directory-files
52
131
path : vaadin-date-range-picker/target/vaadin-date-range-picker-*.zip
53
132
if-no-files-found : error
133
+
134
+ - name : Download Release Asset Upload URL
135
+ uses : actions/download-artifact@v1
136
+ with :
137
+ name : release_asset_upload_url
138
+ path : temp_artf/release_asset_upload_url
139
+
140
+ - name : Fake steps.create_release.outputs.upload_url from predecessor
141
+ id : create_release
142
+ run : echo "::set-output name=upload_url::$(cat temp_artf/release_asset_upload_url/release_asset_upload_url.txt)"
143
+
144
+ - name : Get version
145
+ id : version
146
+ run : |
147
+ echo "::set-output name=release::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)"
148
+ working-directory : vaadin-date-range-picker
149
+
150
+ - name : Upload Release Asset
151
+ uses : actions/upload-release-asset@v1
152
+ env :
153
+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
154
+ with :
155
+ upload_url : ${{ steps.create_release.outputs.upload_url }}
156
+ asset_path : vaadin-date-range-picker/target/vaadin-date-range-picker-${{ steps.version.outputs.release }}.zip
157
+ asset_name : vaadin-date-range-picker-${{ steps.version.outputs.release }}.zip
158
+ asset_content_type : application/zip
159
+
160
+ after_release :
161
+ runs-on : ubuntu-latest
162
+ needs : [publish_central, build_directory]
163
+ steps :
164
+ - uses : actions/checkout@v2
165
+
166
+ - name : Init Git and pull
167
+ run : |
168
+ git config --global user.email "[email protected] "
169
+ git config --global user.name "GitHub Actions"
170
+ git pull
171
+
172
+ - name : Inc Version and SNAP root
173
+ run : mvn -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true
174
+
175
+ - name : Inc Version and SNAP demo
176
+ run : mvn -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true
177
+ working-directory : vaadin-date-range-picker-demo
178
+
179
+ - name : Inc Version and SNAP
180
+ run : mvn -B build-helper:parse-version versions:set -DnewVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion} -DgenerateBackupPoms=false -DnextSnapshot=true
181
+ working-directory : vaadin-date-range-picker
182
+
183
+ - name : Git Commit and Push
184
+ run : |
185
+ git add -A
186
+ git commit -m "Preparing for next development iteration"
187
+ git push origin
188
+
189
+ - name : pull-request
190
+ uses : repo-sync/pull-request@v2
191
+ with :
192
+ github_token : ${{ secrets.GITHUB_TOKEN }}
193
+ destination_branch : " develop"
194
+ pr_title : " Sync back"
195
+ pr_body : " An automated PR to sync changes back"
196
+
0 commit comments