17
17
# Keep it disabled once it's merged into main branch as we only
18
18
# want "schedule" to be the trigger.
19
19
# NOTE: remove `if` condition marked with `HACK` once merged.
20
- pull_request :
21
- branches : [ develop ]
22
- types : [ closed ]
23
- schedule :
24
- # every day at midnight
25
- - cron : " 0 0 * * *"
20
+ # pull_request:
21
+ # # Nightly must be run against "develop" branch only.
22
+ # branches: [ develop ]
23
+ # types: [ closed ]
24
+ # schedule:
25
+ # # every day at midnight
26
+ # - cron: "0 0 * * *"
26
27
27
28
env :
28
29
JDK_VERSION : 16
64
65
65
66
# Short name for branch in which action was triggered.
66
67
declare -r branch_name="${GITHUB_BASE_REF:-${GITHUB_REF#refs/heads/}}"
68
+ echo "Triggered for branch: ${branch_name}"
67
69
68
70
# Get SHA of last commit in that branch.
69
71
declare -r last_commit_sha="$(git rev-parse HEAD)"
84
86
# consider that whlie looking for artifacts (i.e. for upload).
85
87
declare -r version_prop=$(grep '^version\s*=.*' gradle.properties | awk '{print $3}')
86
88
87
-
88
89
# Remove "-" (if present) from version string.
89
90
declare -r lse_version=$(echo "${version_prop}" | awk '{gsub("-","", $0); print}')
90
91
echo "::set-output name=lse_version::${lse_version}"
@@ -109,12 +110,39 @@ jobs:
109
110
needs : git_check
110
111
if : needs.git_check.outputs.run_build == 'true'
111
112
steps :
112
- # https://github.com/marketplace/actions/checkout
113
- - name : " Checkout sources "
113
+ # https://github.com/z0al/dependent-issues
114
+ - name : ' Checkout branch: ${{ env.GITHUB_REF }} '
114
115
uses : actions/checkout@v2
115
116
with :
116
- # We want develop branch only.
117
117
ref : ' develop'
118
+
119
+ - name : ' Build Snap package'
120
+ # https://github.com/snapcore/action-build
121
+ uses : snapcore/action-build@v1
122
+ id : snapcraft
123
+
124
+ - name : ' Upload *.snap artifact.'
125
+ uses : actions/upload-artifact@v3
126
+ if : success()
127
+ with :
128
+ path : ${{ steps.snapcraft.outputs.snap }}
129
+ name : ${{ needs.git_check.outputs.base_name }}_amd64.snap
130
+
131
+ # - name: 'Pushing *.snap to snapcraft.io'
132
+ # # https://github.com/snapcore/action-publish
133
+ # uses: snapcore/action-publish@v1
134
+ # if: success()
135
+ # env:
136
+ # # Obtain Snapcraft.io store token:
137
+ # # $ snapcraft export-login --snaps=logisim-evolution --acls package_access,package_push,package_update,package_release token.txt
138
+ # # then open Github repository settings and add new secred named SNAPCRAFT_STORE_TOKEN with the value of token.txt
139
+ # SNAPCRAFT_STORE_CREDENTIALS: ${{ secrets.SNAPCRAFT_STORE_TOKEN }}
140
+ # with:
141
+ # snap: ${{ steps.snapcraft.outputs.snap }}
142
+ # release: edge
143
+
144
+ # ###########################################################################################
145
+
118
146
- name : Set up JDK ${{ env.JDK_VERSION }} ${{ env.JDK_DISTRO }}
119
147
uses : actions/setup-java@v2
120
148
with :
@@ -133,7 +161,7 @@ jobs:
133
161
134
162
# https://github.com/marketplace/actions/upload-a-build-artifact
135
163
- name : ' Upload binary JAR'
136
- uses : actions/upload-artifact@v2
164
+ uses : actions/upload-artifact@v3
137
165
if : success()
138
166
with :
139
167
path : build/libs/${{ needs.git_check.outputs.lse_name }}-${{ needs.git_check.outputs.lse_version }}-all.jar
@@ -150,7 +178,7 @@ jobs:
150
178
./gradlew createDeb -x checkstyleMain -x checkstyleTest
151
179
152
180
- name : ' Upload *.deb'
153
- uses : actions/upload-artifact@v2
181
+ uses : actions/upload-artifact@v3
154
182
if : success()
155
183
with :
156
184
path : build/dist/${{ needs.git_check.outputs.lse_name }}_${{ needs.git_check.outputs.lse_version }}-1_amd64.deb
@@ -168,7 +196,7 @@ jobs:
168
196
./gradlew createRpm -x checkstyleMain -x checkstyleTest
169
197
170
198
- name : ' Upload *.rpm'
171
- uses : actions/upload-artifact@v2
199
+ uses : actions/upload-artifact@v3
172
200
if : success()
173
201
with :
174
202
path : build/dist/${{ needs.git_check.outputs.lse_name }}-${{ needs.git_check.outputs.lse_version }}-1.x86_64.rpm
@@ -187,13 +215,13 @@ jobs:
187
215
./gradlew sourcesJar
188
216
189
217
- name : ' Upload sources JAR'
190
- uses : actions/upload-artifact@v2
218
+ uses : actions/upload-artifact@v3
191
219
if : success()
192
220
with :
193
221
path : build/libs/${{ needs.git_check.outputs.lse_name }}-${{ needs.git_check.outputs.lse_version }}-src.jar
194
222
name : ${{ needs.git_check.outputs.base_name }}-src.jar
195
223
196
- # ##################################
224
+ # ###############################################################################################
197
225
198
226
# Building for macOS.
199
227
build_macos :
@@ -208,8 +236,7 @@ jobs:
208
236
- name : " Checkout sources"
209
237
uses : actions/checkout@v2
210
238
with :
211
- # We want develop branch only.
212
- ref : ' develop'
239
+ ref : ${{ github.ref_name }}
213
240
- name : Set up JDK ${{ env.JDK_VERSION }} ${{ env.JDK_DISTRO }}
214
241
uses : actions/setup-java@v2
215
242
with :
@@ -225,7 +252,7 @@ jobs:
225
252
./gradlew createDmg -x checkstyleMain -x checkstyleTest
226
253
227
254
- name : ' Upload DMG'
228
- uses : actions/upload-artifact@v2
255
+ uses : actions/upload-artifact@v3
229
256
if : success()
230
257
with :
231
258
path : build/dist/${{ needs.git_check.outputs.lse_name }}-${{ needs.git_check.outputs.lse_version }}.dmg
@@ -255,7 +282,7 @@ jobs:
255
282
run : .\gradlew.bat createMsi -x checkstyleMain -x checkstyleTest
256
283
257
284
- name : ' Upload MSI'
258
- uses : actions/upload-artifact@v2
285
+ uses : actions/upload-artifact@v3
259
286
if : success()
260
287
with :
261
288
# NOTE: Gradle builder creates MSI file that always uses short version format in file name.
0 commit comments