Skip to content

Commit 00bfa64

Browse files
committed
ci: consistent variable names
also fix invalid last -> last_tag
1 parent db17193 commit 00bfa64

File tree

3 files changed

+25
-21
lines changed

3 files changed

+25
-21
lines changed

.github/release_template.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ When updating from 1.14.1 make sure **there is enough available space on the dev
44

55
Make sure to **only** perform OTA upgrade with a properly powered device. Attempting to flash and / or use a normally AC powered device (like a Sonoff) instead powered through 3v3 **may** result in unexpected issues with the firmware.
66

7-
# Snapshot build $$DATE$$
7+
# Snapshot build
88

99
**How to upgrade "over-the-air" aka OTA**: https://github.com/xoseperez/espurna/wiki/OTA
1010
**Latest changes**: https://github.com/xoseperez/espurna/compare/$$LAST_TAG$$...$$BUILD_TAG$$

.github/workflows/test.yml .github/workflows/release-preview.yml

+15-11
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Release (test)
1+
name: Preview release template
22

33
on:
44
workflow_dispatch:
@@ -7,18 +7,18 @@ jobs:
77
variables:
88
runs-on: ubuntu-latest
99
outputs:
10+
build_date: ${{ steps.result.outputs.build_date }}
1011
build_tag: ${{ steps.result.outputs.build_tag }}
11-
date: ${{ steps.result.outputs.date }}
12-
dev: ${{ steps.result.outputs.dev }}
13-
last_tag: ${{ steps.result.outputs.last }}
12+
last_rev: ${{ steps.result.outputs.last_rev }}
13+
last_tag: ${{ steps.result.outputs.last_tag }}
1414

1515
steps:
1616
- name: Prepare version variables
1717
id: result
1818
shell: bash
1919
run: |
2020
remote_last_tag() {
21-
git ls-remote --tags --sort='version:refname' https://github.com/xoseperez/espurna 'github*' |\
21+
git ls-remote --tags --sort='version:refname' https://github.com/xoseperez/espurna.git 'github*' |\
2222
cut -d'/' -f3 |\
2323
grep -o -E '^github[0-9]{6}$' |\
2424
sort -r |\
@@ -30,17 +30,17 @@ jobs:
3030
}
3131
3232
date=$(date +'%y%m%d')
33-
echo "date=${date}" >> "$GITHUB_OUTPUT"
33+
echo "build_date=${date}" >> "$GITHUB_OUTPUT"
34+
35+
tag="github${date}"
36+
echo "build_tag=${tag}" >> "$GITHUB_OUTPUT"
3437
3538
dev=$(remote_revision dev)
36-
echo "dev=${dev}" >> "$GITHUB_OUTPUT"
39+
echo "last_rev=${dev}" >> "$GITHUB_OUTPUT"
3740
3841
last=$(remote_last_tag)
3942
echo "last_tag=${last}" >> "$GITHUB_OUTPUT"
4043
41-
build="github${date}"
42-
echo "build_tag=${build}" >> "$GITHUB_OUTPUT"
43-
4444
release:
4545
needs: variables
4646
runs-on: ubuntu-latest
@@ -55,9 +55,13 @@ jobs:
5555
5656
- name: Render release template
5757
run: |
58+
echo "build_date=" ${{ needs.variables.outputs.build_date }}
59+
echo "build_tag=" ${{ needs.variables.outputs.build_tag }}
60+
echo "last_rev=" ${{ needs.variables.outputs.last_rev }}
61+
echo "last_tag=" ${{ needs.variables.outputs.last_tag }}
62+
5863
sed \
5964
-i \
60-
-e 's/\$\$DATE\$\$/'${{ needs.variables.outputs.date }}'/g' \
6165
-e 's/\$\$BUILD_TAG\$\$/'${{ needs.variables.outputs.build_tag }}'/g' \
6266
-e 's/\$\$LAST_TAG\$\$/'${{ needs.variables.outputs.last_tag }}'/g' \
6367
release_template.md

.github/workflows/release.yml

+9-9
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ jobs:
1111
variables:
1212
runs-on: ubuntu-latest
1313
outputs:
14+
build_date: ${{ steps.result.outputs.build_date }}
1415
build_tag: ${{ steps.result.outputs.build_tag }}
15-
date: ${{ steps.result.outputs.date }}
16-
dev: ${{ steps.result.outputs.dev }}
17-
last_tag: ${{ steps.result.outputs.last }}
16+
last_rev: ${{ steps.result.outputs.last_rev }}
17+
last_tag: ${{ steps.result.outputs.last_tag }}
1818

1919
steps:
2020
- name: Prepare version variables
@@ -34,17 +34,17 @@ jobs:
3434
}
3535
3636
date=$(date +'%y%m%d')
37-
echo "date=${date}" >> "$GITHUB_OUTPUT"
37+
echo "build_date=${date}" >> "$GITHUB_OUTPUT"
38+
39+
tag="github${date}"
40+
echo "build_tag=${tag}" >> "$GITHUB_OUTPUT"
3841
3942
dev=$(remote_revision dev)
40-
echo "dev=${dev}" >> "$GITHUB_OUTPUT"
43+
echo "last_rev=${dev}" >> "$GITHUB_OUTPUT"
4144
4245
last=$(remote_last_tag)
4346
echo "last_tag=${last}" >> "$GITHUB_OUTPUT"
4447
45-
build="github${date}"
46-
echo "build_tag=${build}" >> "$GITHUB_OUTPUT"
47-
4848
build:
4949
needs: variables
5050
runs-on: ubuntu-latest
@@ -162,7 +162,7 @@ jobs:
162162
- uses: ncipollo/release-action@v1
163163
with:
164164
tag: ${{ needs.variables.outputs.build_tag }}
165-
commit: ${{ needs.variables.outputs.dev }}
165+
commit: ${{ needs.variables.outputs.last_rev }}
166166
name: Snapshot build (${{ needs.variables.outputs.build_tag }})
167167
bodyFile: "release_template.md"
168168
artifacts: "Debug.zip,build/*.bin"

0 commit comments

Comments
 (0)