mirror of
https://github.com/xoseperez/espurna.git
synced 2026-02-20 01:31:34 +01:00
ci: consistent variable names
also fix invalid last -> last_tag
This commit is contained in:
2
.github/release_template.md
vendored
2
.github/release_template.md
vendored
@@ -4,7 +4,7 @@ When updating from 1.14.1 make sure **there is enough available space on the dev
|
||||
|
||||
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.
|
||||
|
||||
# Snapshot build $$DATE$$
|
||||
# Snapshot build
|
||||
|
||||
**How to upgrade "over-the-air" aka OTA**: https://github.com/xoseperez/espurna/wiki/OTA
|
||||
**Latest changes**: https://github.com/xoseperez/espurna/compare/$$LAST_TAG$$...$$BUILD_TAG$$
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
name: Release (test)
|
||||
name: Preview release template
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
@@ -7,10 +7,10 @@ jobs:
|
||||
variables:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
build_date: ${{ steps.result.outputs.build_date }}
|
||||
build_tag: ${{ steps.result.outputs.build_tag }}
|
||||
date: ${{ steps.result.outputs.date }}
|
||||
dev: ${{ steps.result.outputs.dev }}
|
||||
last_tag: ${{ steps.result.outputs.last }}
|
||||
last_rev: ${{ steps.result.outputs.last_rev }}
|
||||
last_tag: ${{ steps.result.outputs.last_tag }}
|
||||
|
||||
steps:
|
||||
- name: Prepare version variables
|
||||
@@ -18,7 +18,7 @@ jobs:
|
||||
shell: bash
|
||||
run: |
|
||||
remote_last_tag() {
|
||||
git ls-remote --tags --sort='version:refname' https://github.com/xoseperez/espurna 'github*' |\
|
||||
git ls-remote --tags --sort='version:refname' https://github.com/xoseperez/espurna.git 'github*' |\
|
||||
cut -d'/' -f3 |\
|
||||
grep -o -E '^github[0-9]{6}$' |\
|
||||
sort -r |\
|
||||
@@ -30,17 +30,17 @@ jobs:
|
||||
}
|
||||
|
||||
date=$(date +'%y%m%d')
|
||||
echo "date=${date}" >> "$GITHUB_OUTPUT"
|
||||
echo "build_date=${date}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
tag="github${date}"
|
||||
echo "build_tag=${tag}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
dev=$(remote_revision dev)
|
||||
echo "dev=${dev}" >> "$GITHUB_OUTPUT"
|
||||
echo "last_rev=${dev}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
last=$(remote_last_tag)
|
||||
echo "last_tag=${last}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
build="github${date}"
|
||||
echo "build_tag=${build}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
release:
|
||||
needs: variables
|
||||
runs-on: ubuntu-latest
|
||||
@@ -55,9 +55,13 @@ jobs:
|
||||
|
||||
- name: Render release template
|
||||
run: |
|
||||
echo "build_date=" ${{ needs.variables.outputs.build_date }}
|
||||
echo "build_tag=" ${{ needs.variables.outputs.build_tag }}
|
||||
echo "last_rev=" ${{ needs.variables.outputs.last_rev }}
|
||||
echo "last_tag=" ${{ needs.variables.outputs.last_tag }}
|
||||
|
||||
sed \
|
||||
-i \
|
||||
-e 's/\$\$DATE\$\$/'${{ needs.variables.outputs.date }}'/g' \
|
||||
-e 's/\$\$BUILD_TAG\$\$/'${{ needs.variables.outputs.build_tag }}'/g' \
|
||||
-e 's/\$\$LAST_TAG\$\$/'${{ needs.variables.outputs.last_tag }}'/g' \
|
||||
release_template.md
|
||||
18
.github/workflows/release.yml
vendored
18
.github/workflows/release.yml
vendored
@@ -11,10 +11,10 @@ jobs:
|
||||
variables:
|
||||
runs-on: ubuntu-latest
|
||||
outputs:
|
||||
build_date: ${{ steps.result.outputs.build_date }}
|
||||
build_tag: ${{ steps.result.outputs.build_tag }}
|
||||
date: ${{ steps.result.outputs.date }}
|
||||
dev: ${{ steps.result.outputs.dev }}
|
||||
last_tag: ${{ steps.result.outputs.last }}
|
||||
last_rev: ${{ steps.result.outputs.last_rev }}
|
||||
last_tag: ${{ steps.result.outputs.last_tag }}
|
||||
|
||||
steps:
|
||||
- name: Prepare version variables
|
||||
@@ -34,17 +34,17 @@ jobs:
|
||||
}
|
||||
|
||||
date=$(date +'%y%m%d')
|
||||
echo "date=${date}" >> "$GITHUB_OUTPUT"
|
||||
echo "build_date=${date}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
tag="github${date}"
|
||||
echo "build_tag=${tag}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
dev=$(remote_revision dev)
|
||||
echo "dev=${dev}" >> "$GITHUB_OUTPUT"
|
||||
echo "last_rev=${dev}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
last=$(remote_last_tag)
|
||||
echo "last_tag=${last}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
build="github${date}"
|
||||
echo "build_tag=${build}" >> "$GITHUB_OUTPUT"
|
||||
|
||||
build:
|
||||
needs: variables
|
||||
runs-on: ubuntu-latest
|
||||
@@ -162,7 +162,7 @@ jobs:
|
||||
- uses: ncipollo/release-action@v1
|
||||
with:
|
||||
tag: ${{ needs.variables.outputs.build_tag }}
|
||||
commit: ${{ needs.variables.outputs.dev }}
|
||||
commit: ${{ needs.variables.outputs.last_rev }}
|
||||
name: Snapshot build (${{ needs.variables.outputs.build_tag }})
|
||||
bodyFile: "release_template.md"
|
||||
artifacts: "Debug.zip,build/*.bin"
|
||||
|
||||
Reference in New Issue
Block a user