14
14
image : arduino/arduino-cli:builder-1
15
15
volumes :
16
16
# cache go dependencies across pipeline's steps
17
- - $PWD /go:/go
17
+ - ${{ github.workspace }} /go:/go
18
18
19
19
steps :
20
20
- name : Checkout
42
42
with :
43
43
name : dist
44
44
45
- - name : Get the current release tag
46
- id : get_tag
47
- run : echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//}
48
-
49
45
- name : Download Gon
50
46
run : |
51
47
wget -q https://github.com/mitchellh/gon/releases/download/v0.2.2/gon_0.2.2_macos.zip
54
50
55
51
- name : Notarize binary, re-package it and update checksum
56
52
env :
57
- TAG : ${{ steps.get_tag.outputs.VERSION }}
58
53
AC_USERNAME : ${{ secrets.AC_USERNAME }}
59
54
AC_PASSWORD : ${{ secrets.AC_PASSWORD }}
60
55
# This step performs the following:
70
65
gon gon.config.hcl
71
66
# GitHub's upload/download-artifact@v1 actions don't preserve file permissions,
72
67
# so we need to add execution permission back until @v2 actions are released.
73
- chmod +x dist/arduino_cli_osx_darwin_amd64/arduino-cli
68
+ chmod +x dist/arduino_cli_osx_darwin_amd64/arduino-cli
69
+ TAG=${GITHUB_REF/refs\/tags\//}
74
70
tar -czvf dist/arduino-cli_${TAG}_macOS_64bit.tar.gz \
75
71
-C dist/arduino_cli_osx_darwin_amd64/ arduino-cli \
76
72
-C ../../ LICENSE.txt
@@ -106,6 +102,15 @@ jobs:
106
102
echo $body
107
103
echo "::set-output name=BODY::$body"
108
104
105
+ - name : Identify Prerelease
106
+ # This is a workaround while waiting for create-release action
107
+ # to implement auto pre-release based on tag
108
+ id : prerelease
109
+ run : |
110
+ wget -q -P /tmp https://github.com/fsaintjacques/semver-tool/archive/3.0.0.zip
111
+ unzip -p /tmp/3.0.0.zip semver-tool-3.0.0/src/semver >/tmp/semver && chmod +x /tmp/semver
112
+ if [[ $(/tmp/semver get prerel ${GITHUB_REF/refs\/tags\//}) ]]; then echo "::set-output name=IS_PRE::true"; fi
113
+
109
114
- name : Create Github Release
110
115
id : create_release
111
116
uses : actions/create-release@master
@@ -116,7 +121,7 @@ jobs:
116
121
release_name : ${{ github.ref }}
117
122
body : ${{ steps.changelog.outputs.BODY }}
118
123
draft : false
119
- prerelease : false
124
+ prerelease : ${{ steps.prerelease.outputs.IS_PRE }}
120
125
121
126
- name : Upload release files on Github
122
127
uses : svenstaro/upload-release-action@v1-release
0 commit comments