1
1
name : release
2
2
3
3
on :
4
- push : # only for testing
4
+ push :
5
+ tags :
6
+ - " [0-9]+.[0-9]+.[0-9]+*"
5
7
6
8
jobs :
7
9
build :
@@ -169,12 +171,51 @@ jobs:
169
171
GOOS : ${{ matrix.os }}
170
172
GOARCH : ${{ matrix.arch }}
171
173
CGO_ENABLED : 0
172
-
173
- - name : Debug print
174
- run : file rp2040load${{ matrix.extension }}
175
-
174
+
176
175
- name : Upload artifacts
177
176
uses : actions/upload-artifact@v2
178
177
with :
179
178
name : rp2040load_${{matrix.os}}_${{matrix.arch}}
180
- path : rp2040load${{ matrix.extension }}
179
+ path : rp2040load${{ matrix.extension }}
180
+
181
+ create-release :
182
+ runs-on :
183
+ ubuntu-latest
184
+ needs : [build, build-go]
185
+ steps :
186
+ - name : Download artifact
187
+ uses : actions/download-artifact@v2 # download all the artifacts
188
+
189
+ - name : Prepare artifacts for the release
190
+ run : |
191
+ mkdir release
192
+ declare -a target_folders=("linux_amd64" "linux_386" "linux_arm64" "linux_arm" "darwin_amd64" "windows_386")
193
+ for folder in "${target_folders[@]}"
194
+ do
195
+ chmod -v +x rp2040load_$folder/* && chmod -v +x tools_$folder/*
196
+ mv -v rp2040load_$folder/rp2040load* tools_$folder/
197
+ tar -cvzf tools_$folder.tar.gz tools_$folder/
198
+ done
199
+ mv -v tools_*.tar.gz release/
200
+
201
+ - name : Create Github Release
202
+ uses : actions/create-release@v1
203
+ env :
204
+ GITHUB_TOKEN : ${{ secrets.RP2040_CI_PAT }}
205
+ with :
206
+ tag_name : ${{ github.ref }}
207
+ release_name : ${{ github.ref }}
208
+ body : rp2040tools
209
+ draft : false
210
+ prerelease : true # ${{ steps.prerelease.outputs.IS_PRE }}
211
+
212
+ - name : Upload release files on Github
213
+ uses : svenstaro/upload-release-action@v2
214
+ with :
215
+ repo_token : ${{ secrets.RP2040_CI_PAT }}
216
+ tag : ${{ github.ref }}
217
+ file_glob : true # If set to true, the file argument can be a glob pattern
218
+ file : release/*
219
+
220
+ # - name: Upload release files on Arduino downloads servers
221
+ # run: aws s3 sync release/ s3://${{ secrets.DOWNLOADS_BUCKET }}
0 commit comments