@@ -43,12 +43,11 @@ jobs:
4343 fetch-depth : 0
4444 - name : Build
4545 run : |
46- export VERSION="$(/opt/makever.sh)"
4746 make clean
4847 make -j4
4948 - name : TestMyESP helper
5049 run : |
51- export VERSION="$(/opt/makever.sh)"
50+ export VERSION=0.0.0-unknown.0
5251 extra_opts=""
5352 if [[ "${{ github.event.inputs.verbose }}" == "yes" ]]; then
5453 extra_opts+="--verbose"
@@ -92,42 +91,36 @@ jobs:
9291 uses : actions/checkout@master
9392 - name : Extract version from tag
9493 id : tagName
95- uses : little-core-labs /get-git- tag@v3.0.2
94+ uses : olegtarasov /get-tag@v2.1
9695 with :
97- tagRegex : " version-(.*)"
96+ tagRegex : " version-(?<version> .*)"
9897 - name : Build
9998 run : |
10099 export DEBUG=false
101- export VERSION="$(/opt/makever.sh) "
100+ export VERSION="${{ steps.tagName.outputs.version }} "
102101 make clean
103102 make -j4
104- for flash_freq in 20 26 40 80; do
105- for flash_mode in qio qout dio dout; do
106- rm -f build/firmware.bin
107- make FLASH_MODE=${flash_mode} FLASH_FREQ=${flash_freq}
108- mv build/firmware.bin build/firmware-${flash_mode}-${flash_freq}.bin
109- done
110- done
111103 - name : Setup s3cmd
112104 run : |
113105 echo "[default]" > ~/.s3cfg
114106 echo "access_key = ${{ secrets.AWS_ACCESS_KEY }}" >> ~/.s3cfg
115107 echo "secret_key = ${{ secrets.AWS_SECRET_KEY }}" >> ~/.s3cfg
116108 - name : Upload to S3
117109 run : |
118- if [[ "${GIT_TAG_NAME}" =~ beta.[0-9]+$ ]]; then # beta version
110+ VERSION="${{ steps.tagName.outputs.version }}"
111+ if [[ "${VERSION}" =~ beta.[0-9]+$ ]]; then # beta version
119112 latest_file="latest_beta"
120- elif [[ "${GIT_TAG_NAME }" =~ alpha.[0-9]+$ ]]; then # alpha version
113+ elif [[ "${VERSION }" =~ alpha.[0-9]+$ ]]; then # alpha version
121114 latest_file="latest_alpha"
122115 else # stable version
123116 latest_file="latest_stable"
124117 fi
125- echo "Version: ${GIT_TAG_NAME }" > build/${latest_file}
118+ echo "Version: ${VERSION }" > build/${latest_file}
126119 echo -n "Date: " >> build/${latest_file}
127120 date "+%Y-%m-%d" >> build/${latest_file}
128121
129- s3cmd put -P --guess-mime-type build/user*.bin s3://${S3_BUCKET}/${S3_FOLDER}/${GIT_TAG_NAME }/
130- s3cmd put -P --guess-mime-type build/firmware-* .bin s3://${S3_BUCKET}/${S3_FOLDER}/${GIT_TAG_NAME }/
122+ s3cmd put -P --guess-mime-type build/user*.bin s3://${S3_BUCKET}/${S3_FOLDER}/${VERSION }/
123+ s3cmd put -P --guess-mime-type build/firmware.bin s3://${S3_BUCKET}/${S3_FOLDER}/${VERSION }/
131124 s3cmd put -P --guess-mime-type build/${latest_file} s3://${S3_BUCKET}/${S3_FOLDER}/${latest_file}
132125 s3cmd put -P --guess-mime-type build/${latest_file} s3://${S3_BUCKET}/${S3_FOLDER}/latest
133126
@@ -142,20 +135,15 @@ jobs:
142135 id : tagName
143136 uses : olegtarasov/get-tag@v2.1
144137 with :
145- tagRegex : " version-(.*)"
138+ tagRegex : " version-(?<version> .*)"
146139 - name : Create Github release
147- run : |
148- url="https://api.github.com/repos/qtoggle/espqtoggle/releases?access_token=${{ secrets.GITHUB_TOKEN }}"
149- prerelease=$(if echo "${GIT_TAG_NAME}" | grep -E "alpha|beta" &>/dev/null; then echo true; else echo false; fi)
150- markdown="| | QIO | QOUT | DIO | DOUT |\n"
151- markdown+="|:-:|:-:|:-:|:-:|:-:|\n"
152- for flash_freq in 20 26 40 80; do
153- markdown+="| ${flash_freq}MHz | "
154- for flash_mode in qio qout dio dout; do
155- firmware_url="https://provisioning.qtoggle.io/firmware/espqtoggle/${GIT_TAG_NAME}/firmware-${flash_mode}-${flash_freq}.bin"
156- markdown+=" [firmware.bin](${firmware_url}) |"
157- done
158- markdown+="\n"
159- done
160- body="{\"tag_name\": \"version-${GIT_TAG_NAME}\", \"name\": \"${GIT_TAG_NAME}\", \"body\": \"${markdown}\", \"prerelease\": ${prerelease}, \"draft\": true}"
161- curl -Ss "${url}" -X POST -d "${body}" > /dev/null
140+ uses : softprops/action-gh-release@v1
141+ with :
142+ name : ${{ steps.tagName.outputs.version }}
143+ draft : true
144+ prerelease : contains(github.ref, 'alpha') || contains(github.ref, 'beta')
145+ body : |
146+ What's new (since ...):
147+ - ...
148+
149+ Download [firmware.bin](https://provisioning.qtoggle.io/firmware/espqtoggle/${{ steps.tagName.outputs.version }}/firmware.bin).
0 commit comments