9
9
required : false
10
10
type : string
11
11
release :
12
- types : [created]
12
+ types : [created,prereleased ]
13
13
push :
14
14
paths :
15
15
- .github/workflows/build-with-firmware.yml
31
31
RELATIVE_PATH : " applications/external/subbrute"
32
32
CURRENT_VERSION : ${{ vars.RELEASE_VERSION }}
33
33
RELEASE_VERSION : ${{ vars.RELEASE_VERSION }}
34
+ ZIP_NAME : ' '
35
+ ZIP_TAG : ' '
36
+ TGZ_NAME : ' '
37
+ TGZ_TAG : ' '
34
38
strategy :
35
39
fail-fast : false
36
40
matrix :
53
57
$ReleaseVersion = ([string]::IsNullOrWhitespace($env:INPUT_VERSION) ? $env:CURRENT_VERSION : $env:INPUT_VERSION)
54
58
Write-Output ('RELEASE_VERSION={0}' -f $ReleaseVersion) >> $env:GITHUB_ENV
55
59
56
- - name : Copy Repo Files
60
+ - name : Copy Firmware Files
57
61
uses : actions/checkout@v3
58
62
with :
59
63
repository : " ${{ matrix.url }}"
@@ -132,6 +136,19 @@ jobs:
132
136
# # An explicit key for restoring and saving the cache
133
137
# key: 'fbt=${{ env.FIRMWARE_VERSION }}'
134
138
#
139
+ - name : Remove other apps
140
+ shell : bash
141
+ if : ${{ success() }}
142
+ # rm to remove problem FAP which includes non existent files
143
+ run : |
144
+ rm -Rf ./applications/debug ./applications/examples
145
+ mkdir ./tmp
146
+ mv ./applications/external/application.fam ./tmp/
147
+ mv -f ./applications/external/subbrute/ ./tmp/
148
+ rm -Rf ./applications/external/*
149
+ mv -f ./tmp/* ./applications/external/
150
+ rm -Rf ./tmp/
151
+
135
152
- name : Build Firmware
136
153
shell : bash
137
154
if : ${{ success() }}
@@ -140,7 +157,18 @@ jobs:
140
157
DIST_SUFFIX : ${{ matrix.version }}
141
158
WORKFLOW_BRANCH_OR_TAG : release-cfw
142
159
run : |
143
- ./fbt COMPACT=1 DEBUG=0 fap_dist
160
+ ./fbt COMPACT=1 DEBUG=0 FBT_NO_SYNC=0
161
+
162
+ - name : Build FAPs
163
+ shell : bash
164
+ if : ${{ success() }}
165
+ env :
166
+ FBT_NO_SYNC : 0
167
+ DIST_SUFFIX : ${{ matrix.version }}
168
+ WORKFLOW_BRANCH_OR_TAG : release-cfw
169
+ # rm to remove problem FAP which includes non existent files
170
+ run : |
171
+ ./fbt COMPACT=1 DEBUG=0 FBT_NO_SYNC=0 fap_dist
144
172
145
173
# - name: Save FBT
146
174
# id: cache-save
@@ -180,20 +208,21 @@ jobs:
180
208
}
181
209
$ZipName = $env:ZIP_NAME
182
210
$TgzName = $env:TGZ_NAME
183
- $FapNamme = 'SubGHz_Bruteforcer .fap'
211
+ $FapNamme = 'subghz_bruteforcer .fap'
184
212
$DstFap = "./$FapNamme"
213
+ $AppDir = "dist/f7-C/apps/Sub-GHz"
185
214
186
- if (!(Test-Path -Path "dist/f7-C/apps/Sub-GHz /$FapNamme" -PathType Leaf)) {
215
+ if (!(Test-Path -Path "$AppDir /$FapNamme" -PathType Leaf)) {
187
216
Write-Error '::error title=Files not found::Cannot find files in location'
188
217
exit 1
189
218
}
190
219
191
- $Size = (Get-Item -Path "dist/f7-C/apps/Sub-GHz /$FapNamme" | Get-ItemPropertyValue -Name Length)
220
+ $Size = (Get-Item -Path "$AppDir /$FapNamme" | Get-ItemPropertyValue -Name Length)
192
221
Write-Output ('Filesize: {0}' -f (Format-Bytes $Size))
193
- Copy-Item -Force -Path "dist/f7-C/apps/Sub-GHz /$FapNamme" -Destination $DstFap
222
+ Copy-Item -Force -Verbose - Path "$AppDir /$FapNamme" -Destination $DstFap
194
223
195
224
zip -r -qq $ZipName $DstFap
196
- tar zcf $TgzName $DstFap
225
+ tar zcf $TgzName $DstFap
197
226
198
227
if ( !(Test-Path -Path $ZipName -PathType Leaf) -or !(Test-Path -Path $TgzName -PathType Leaf) ) {
199
228
Write-Error '::error title=Files not found::Cannot find files in location'
@@ -207,13 +236,15 @@ jobs:
207
236
Write-Output ('TGZ_NAME={0}' -f $TgzName ) >> $env:GITHUB_ENV
208
237
Write-Output ('ZIP_TAG={0} ({1})' -f $ZipName, $ZipSize) >> $env:GITHUB_ENV
209
238
Write-Output ('TGZ_TAG={0} ({1})' -f $TgzName , $TgzSize) >> $env:GITHUB_ENV
210
- - name : Create assets
239
+
240
+ - name : Upload assets
211
241
if : ${{ success() && env.ZIP_NAME != '' }}
212
242
env :
213
243
GITHUB_TOKEN : ${{ secrets.FLIPPER_TOKEN }}
214
244
run : |
215
- gh release upload 'v${{ env.RELEASE_VERSION }}' --clobber \
216
- '${{ env.ZIP_NAME }}#${{ env.ZIP_TAG }}' '${{ env.TGZ_NAME }}#${{ env.TGZ_TAG }}' -R ${{ env.REPO_SELF }}
245
+ gh release create v${{ env.RELEASE_VERSION }} --generate-notes --draft -R ${{ env.REPO_SELF }}
246
+ gh release upload 'v${{ env.RELEASE_VERSION }}' '${{ env.ZIP_NAME }}#${{ env.ZIP_TAG }}' \
247
+ '${{ env.TGZ_NAME }}#${{ env.TGZ_TAG }}' --clobber -R ${{ env.REPO_SELF }}
217
248
gh release edit 'v${{ env.RELEASE_VERSION }}' --draft=false -R ${{ env.REPO_SELF }}
218
249
219
250
# EOF
0 commit comments