Skip to content

Commit 7d5f573

Browse files
authored
chore: Simplify release workflow
* Use softprops/action-gh-release for GH releases * Simplify S3 uploads * Use generic version for blackbox-tests * Remove makever.sh * Fix missing VERSION for blackbox tests * Revert system LED bogus change
1 parent eb07a92 commit 7d5f573

File tree

4 files changed

+23
-49
lines changed

4 files changed

+23
-49
lines changed

.github/workflows/main.yml

Lines changed: 21 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -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).

builder/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ ADD https://qtoggle.s3.amazonaws.com/various/xtensa-lx106-elf.tar.xz /opt
3232
RUN cd /opt && tar xvf xtensa-lx106-elf.tar.xz && rm xtensa-lx106-elf.tar.xz
3333

3434
# esp8266 sdk
35-
ADD fix-sdk.sh makever.sh /opt/
35+
ADD fix-sdk.sh /opt/
3636
RUN git clone https://github.com/espressif/ESP8266_NONOS_SDK.git /opt/esp-nonos-sdk && \
3737
cd /opt/esp-nonos-sdk && \
3838
git checkout a0b1311 && \

builder/makever.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

src/espgoodies/system.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -501,11 +501,8 @@ void update(void) {
501501
if (!wifi_station_is_connected()) {
502502
new_led_value = (now_us * 2 / 1000000) % 2;
503503
}
504-
else if (setup_mode_state == SETUP_MODE_TRIGGERED) {
505-
new_led_value = !status_led_level;
506-
}
507504
else {
508-
return;
505+
new_led_value = !status_led_level;
509506
}
510507
}
511508

0 commit comments

Comments
 (0)