From 669cc2f2c255387249b7a92d74d8ef7e8ddb0bce Mon Sep 17 00:00:00 2001
From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com>
Date: Sun, 22 Dec 2024 16:03:39 +0100
Subject: [PATCH 1/9] Use `main` as reference for remote package
---
TX-Ultimate-Easy-ESPHome.yaml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/TX-Ultimate-Easy-ESPHome.yaml b/TX-Ultimate-Easy-ESPHome.yaml
index 0befff0..f3b95c3 100644
--- a/TX-Ultimate-Easy-ESPHome.yaml
+++ b/TX-Ultimate-Easy-ESPHome.yaml
@@ -16,7 +16,7 @@ wifi:
packages:
remote_package:
url: https://github.com/edwardtfn/TX-Ultimate-Easy
- ref: latest
+ ref: main
refresh: 30s
files:
- ESPHome/TX-Ultimate-Easy-ESPHome_core.yaml
From b1187332fb8b2a9686780599d6a1961dc1624ade Mon Sep 17 00:00:00 2001
From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com>
Date: Sun, 22 Dec 2024 16:17:07 +0100
Subject: [PATCH 2/9] Ensure `latest` and `stable` tags are updated on `push`
to `main`
---
.github/workflows/release_tag.yml | 36 ++++++++++++++-----------------
1 file changed, 16 insertions(+), 20 deletions(-)
diff --git a/.github/workflows/release_tag.yml b/.github/workflows/release_tag.yml
index 6dce8f0..b4b7bc4 100644
--- a/.github/workflows/release_tag.yml
+++ b/.github/workflows/release_tag.yml
@@ -1,40 +1,36 @@
# This GitHub Actions workflow updates the "stable" and "latest" Git tags
-# to point to the tag associated with a newly published release. It performs
-# the following steps:
-# 1. Checks out the repository code with full history.
-# 2. Configures Git with a generic user for the action.
+# to point to the latest commit on the main branch whenever code is merged.
+# It performs the following steps:
+# 1. Checks out the repository code with full history
+# 2. Configures Git with a generic user for the action
# 3. Moves and forcibly pushes the "stable" and "latest" tags to align with
-# the tag of the newly published release.
-# This ensures that "stable" and "latest" always point to the most recent release.
+# the latest main branch commit
---
name: Update Tags
-# yamllint disable-line rule:truthy
-on:
- release:
- types: [published]
+on: # yamllint disable-line rule:truthy
+ push:
+ branches:
+ - main
jobs:
update-tags:
runs-on: ubuntu-latest
steps:
- name: Checkout code
- uses: actions/checkout@main
+ uses: actions/checkout@v4
with:
- fetch-depth: '0'
+ fetch-depth: 0
- name: Set up Git
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
- - name: Move and push stable tag
+ - name: Move and push tags
run: |
- git tag -f stable ${{ github.event.release.tag_name }}
- git push -f origin stable
-
- - name: Move and push latest tag
- run: |
- git tag -f latest ${{ github.event.release.tag_name }}
- git push -f origin latest
+ echo "Creating/updating stable and latest tags pointing to latest main commit"
+ git tag -fa stable -m "Update stable tag to latest main"
+ git tag -fa latest -m "Update latest tag to latest main"
+ git push origin stable latest --force
...
From 23b633cdcbb79ab2bdbfec0febdabe399636ebd0 Mon Sep 17 00:00:00 2001
From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com>
Date: Sun, 22 Dec 2024 16:20:51 +0100
Subject: [PATCH 3/9] Run all tests in parallel
Let's see if this saves some time.
---
.github/workflows/validate_esphome.yml | 4 ----
.github/workflows/validate_esphome_beta.yml | 4 ----
2 files changed, 8 deletions(-)
diff --git a/.github/workflows/validate_esphome.yml b/.github/workflows/validate_esphome.yml
index 9aa4fb7..9ff3b92 100644
--- a/.github/workflows/validate_esphome.yml
+++ b/.github/workflows/validate_esphome.yml
@@ -30,8 +30,6 @@ jobs:
build_basic:
name: Basic
- needs:
- - code_scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
@@ -42,7 +40,6 @@ jobs:
build_bluetooth_proxy_4:
name: Bluetooth Proxy (IDF)
- needs: build_basic
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
@@ -53,7 +50,6 @@ jobs:
build_bluetooth_proxy_53:
name: Bluetooth Proxy (IDF v5.3)
- needs: build_basic
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
diff --git a/.github/workflows/validate_esphome_beta.yml b/.github/workflows/validate_esphome_beta.yml
index 5d16d51..3f01fd1 100644
--- a/.github/workflows/validate_esphome_beta.yml
+++ b/.github/workflows/validate_esphome_beta.yml
@@ -47,8 +47,6 @@ jobs:
build_basic:
name: Basic
- needs:
- - code_scan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
@@ -60,7 +58,6 @@ jobs:
build_bluetooth_proxy_4:
name: Bluetooth Proxy (IDF)
- needs: build_basic
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
@@ -72,7 +69,6 @@ jobs:
build_bluetooth_proxy_53:
name: Bluetooth Proxy (IDF v5.3)
- needs: build_basic
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@main
From 0e53dfd3cd3083d540c370f7340f91dc63a45691 Mon Sep 17 00:00:00 2001
From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com>
Date: Sun, 22 Dec 2024 16:26:49 +0100
Subject: [PATCH 4/9] CodeRabbitAI
---
.github/workflows/release_tag.yml | 3 +++
1 file changed, 3 insertions(+)
diff --git a/.github/workflows/release_tag.yml b/.github/workflows/release_tag.yml
index b4b7bc4..2d4c6de 100644
--- a/.github/workflows/release_tag.yml
+++ b/.github/workflows/release_tag.yml
@@ -16,6 +16,9 @@ on: # yamllint disable-line rule:truthy
jobs:
update-tags:
runs-on: ubuntu-latest
+ concurrency:
+ group: ${{ github.workflow }}-${{ github.ref }}
+ cancel-in-progress: true
steps:
- name: Checkout code
uses: actions/checkout@v4
From 5d780f162ee014d930370261fec65965c31af1d4 Mon Sep 17 00:00:00 2001
From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com>
Date: Sun, 22 Dec 2024 16:37:05 +0100
Subject: [PATCH 5/9] Add `version` badge
---
README.md | 20 ++++++++++++--------
1 file changed, 12 insertions(+), 8 deletions(-)
diff --git a/README.md b/README.md
index 80a5575..e7f52d2 100644
--- a/README.md
+++ b/README.md
@@ -1,19 +1,23 @@
# TX Ultimate Easy
-
-![GitHub Activity][commits-shield]
-![License][license-shield]
-![GitHub Last Commit][last-commit-shield]
-![ESPHome][esphome-shield]
-![Discord][discord-shield]
-![Buy me an ice-cream][buymeacoffee-shield]
-
+[![Version][version-shield]](https://github.com/edwardtfn/TX-Ultimate-Easy/tags)
+[![GitHub Activity][commits-shield]](https://github.com/edwardtfn/TX-Ultimate-Easy/commits/main)
+[![License][license-shield]](LICENSE)
+[![GitHub Last Commit][last-commit-shield]](https://github.com/edwardtfn/TX-Ultimate-Easy/commits/main)
+[![ESPHome][esphome-shield]](https://esphome.io/)
+[![Discord][discord-shield]](https://discord.gg/Db6WJWzWuf)
+[![Buy me an ice-cream][buymeacoffee-shield]](https://www.buymeacoffee.com/edwardfirmo)
+
+[version-shield]: https://img.shields.io/github/v/tag/edwardtfn/TX-Ultimate-Easy?label=version
+[version]: https://github.com/edwardtfn/TX-Ultimate-Easy/tags
|  | TX Ultimate Easy provides custom ESPHome firmware for Sonoff TX Ultimate devices. Our project focuses on user-friendly configuration through the Home Assistant UI, eliminating the need for manual YAML editing. Whether you're new to home automation or an experienced user, TX Ultimate Easy makes it simple to manage your device. |
| --- | :-- |
+[version-shield]: https://img.shields.io/github/v/tag/edwardtfn/TX-Ultimate-Easy?label=version
+[version]: https://github.com/edwardtfn/TX-Ultimate-Easy/tags
[commits-shield]: https://img.shields.io/github/commit-activity/y/edwardtfn/TX-Ultimate-Easy
[commits]: https://github.com/edwardtfn/TX-Ultimate-Easy/commits/main
[license-shield]: https://img.shields.io/github/license/edwardtfn/TX-Ultimate-Easy
From d403bc2aa9e869cef0d350742626dbc3058fd8b6 Mon Sep 17 00:00:00 2001
From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com>
Date: Sun, 22 Dec 2024 16:41:21 +0100
Subject: [PATCH 6/9] CodeRabbitAI - Remove duplicated badge reference
---
README.md | 3 ---
1 file changed, 3 deletions(-)
diff --git a/README.md b/README.md
index e7f52d2..f3b3926 100644
--- a/README.md
+++ b/README.md
@@ -8,9 +8,6 @@
[![Discord][discord-shield]](https://discord.gg/Db6WJWzWuf)
[![Buy me an ice-cream][buymeacoffee-shield]](https://www.buymeacoffee.com/edwardfirmo)
-[version-shield]: https://img.shields.io/github/v/tag/edwardtfn/TX-Ultimate-Easy?label=version
-[version]: https://github.com/edwardtfn/TX-Ultimate-Easy/tags
-
|  | TX Ultimate Easy provides custom ESPHome firmware for Sonoff TX Ultimate devices. Our project focuses on user-friendly configuration through the Home Assistant UI, eliminating the need for manual YAML editing. Whether you're new to home automation or an experienced user, TX Ultimate Easy makes it simple to manage your device. |
| --- | :-- |
From 3b7f811876130da1d7f8f0b30cd237c8d792e7a3 Mon Sep 17 00:00:00 2001
From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com>
Date: Sun, 22 Dec 2024 17:04:52 +0100
Subject: [PATCH 7/9] Tag latest and stable only after versioning
---
.github/workflows/release_tag.yml | 39 ----------------
.github/workflows/versioning.yml | 78 +++++++++++++++++++++++++------
2 files changed, 63 insertions(+), 54 deletions(-)
delete mode 100644 .github/workflows/release_tag.yml
diff --git a/.github/workflows/release_tag.yml b/.github/workflows/release_tag.yml
deleted file mode 100644
index 2d4c6de..0000000
--- a/.github/workflows/release_tag.yml
+++ /dev/null
@@ -1,39 +0,0 @@
-# This GitHub Actions workflow updates the "stable" and "latest" Git tags
-# to point to the latest commit on the main branch whenever code is merged.
-# It performs the following steps:
-# 1. Checks out the repository code with full history
-# 2. Configures Git with a generic user for the action
-# 3. Moves and forcibly pushes the "stable" and "latest" tags to align with
-# the latest main branch commit
----
-name: Update Tags
-
-on: # yamllint disable-line rule:truthy
- push:
- branches:
- - main
-
-jobs:
- update-tags:
- runs-on: ubuntu-latest
- concurrency:
- group: ${{ github.workflow }}-${{ github.ref }}
- cancel-in-progress: true
- steps:
- - name: Checkout code
- uses: actions/checkout@v4
- with:
- fetch-depth: 0
-
- - name: Set up Git
- run: |
- git config --local user.email "action@github.com"
- git config --local user.name "GitHub Action"
-
- - name: Move and push tags
- run: |
- echo "Creating/updating stable and latest tags pointing to latest main commit"
- git tag -fa stable -m "Update stable tag to latest main"
- git tag -fa latest -m "Update latest tag to latest main"
- git push origin stable latest --force
-...
diff --git a/.github/workflows/versioning.yml b/.github/workflows/versioning.yml
index 2e49b1a..1c019a0 100644
--- a/.github/workflows/versioning.yml
+++ b/.github/workflows/versioning.yml
@@ -1,6 +1,9 @@
-# Workflow for managing versioning and tagging
+# This GitHub Actions workflow handles version bumping and tag updates.
+# It can be triggered either by:
+# 1. Pushing to main branch - automatically bumps version and updates tags
+# 2. Manual dispatch - allows independent control over stable and latest tags
---
-name: Version Bump and Tag
+name: Version and Tags
on: # yamllint disable-line rule:truthy
push:
@@ -9,34 +12,79 @@ on: # yamllint disable-line rule:truthy
paths-ignore:
- '**/VERSION'
- '**/VERSION_YAML'
+
workflow_dispatch:
inputs:
update_stable:
description: "Update stable tag?"
required: true
- default: "false"
+ default: false
+ type: boolean
+ update_latest:
+ description: "Update latest tag?"
+ required: true
+ default: false
+ type: boolean
jobs:
- versioning:
+ version-and-tag:
runs-on: ubuntu-latest
-
steps:
- - uses: "actions/checkout@v4"
+ - name: Checkout code
+ uses: actions/checkout@v4
+ with:
+ fetch-depth: 0
- name: Set up Git
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
- - name: Bump Version
- run: |
- chmod +x "./versioning/bump_version.sh"
- "./versioning/bump_version.sh"
+ - name: Bump version and push tag
+ id: version
+ uses: mathieudutour/github-tag-action@v6.1
+ with:
+ github_token: ${{ secrets.GITHUB_TOKEN }}
+ release_branches: main
+ default_bump: patch
+ tag_prefix: ""
+ dry_run: true
- - name: Push Changes and Tags
- env:
- GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}"
+ - name: Update version in files
+ if: steps.version.outputs.new_tag
run: |
- git push "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" main
- git push "https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git" --tags
+ chmod +x ./bump_version.sh
+ ./bump_version.sh ${{ steps.version.outputs.new_tag }}
+ git add .
+ git commit -m "chore: bump version to ${{ steps.version.outputs.new_tag }}"
+ git push
+
+ - name: Create version tag
+ if: steps.version.outputs.new_tag
+ run: |
+ echo "Creating version tag ${{ steps.version.outputs.new_tag }}"
+ git tag -fa ${{ steps.version.outputs.new_tag }} -m "Version ${{ steps.version.outputs.new_tag }}"
+ git push origin ${{ steps.version.outputs.new_tag }} --force
+
+ - name: Update stable tag
+ if: |
+ steps.version.outputs.new_tag && (
+ github.event_name == 'workflow_dispatch' && inputs.update_stable ||
+ github.event_name == 'push'
+ )
+ run: |
+ echo "Updating stable tag to point to ${{ steps.version.outputs.new_tag }}"
+ git tag -fa stable -m "Update stable tag to ${{ steps.version.outputs.new_tag }}"
+ git push origin stable --force
+
+ - name: Update latest tag
+ if: |
+ steps.version.outputs.new_tag && (
+ github.event_name == 'workflow_dispatch' && inputs.update_latest ||
+ github.event_name == 'push'
+ )
+ run: |
+ echo "Updating latest tag to point to ${{ steps.version.outputs.new_tag }}"
+ git tag -fa latest -m "Update latest tag to ${{ steps.version.outputs.new_tag }}"
+ git push origin latest --force
...
From 75f4245fe10aabe893d32834b8f03ad1e30751fd Mon Sep 17 00:00:00 2001
From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com>
Date: Sun, 22 Dec 2024 17:16:09 +0100
Subject: [PATCH 8/9] No need another versioning action
---
.github/workflows/versioning.yml | 35 ++++++--------------------------
1 file changed, 6 insertions(+), 29 deletions(-)
diff --git a/.github/workflows/versioning.yml b/.github/workflows/versioning.yml
index 1c019a0..029d2e1 100644
--- a/.github/workflows/versioning.yml
+++ b/.github/workflows/versioning.yml
@@ -40,51 +40,28 @@ jobs:
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
- - name: Bump version and push tag
- id: version
- uses: mathieudutour/github-tag-action@v6.1
- with:
- github_token: ${{ secrets.GITHUB_TOKEN }}
- release_branches: main
- default_bump: patch
- tag_prefix: ""
- dry_run: true
-
- - name: Update version in files
- if: steps.version.outputs.new_tag
+ - name: Bump version
run: |
chmod +x ./bump_version.sh
- ./bump_version.sh ${{ steps.version.outputs.new_tag }}
- git add .
- git commit -m "chore: bump version to ${{ steps.version.outputs.new_tag }}"
- git push
-
- - name: Create version tag
- if: steps.version.outputs.new_tag
- run: |
- echo "Creating version tag ${{ steps.version.outputs.new_tag }}"
- git tag -fa ${{ steps.version.outputs.new_tag }} -m "Version ${{ steps.version.outputs.new_tag }}"
- git push origin ${{ steps.version.outputs.new_tag }} --force
+ ./bump_version.sh
- name: Update stable tag
if: |
- steps.version.outputs.new_tag && (
+ success() && (
github.event_name == 'workflow_dispatch' && inputs.update_stable ||
github.event_name == 'push'
)
run: |
- echo "Updating stable tag to point to ${{ steps.version.outputs.new_tag }}"
- git tag -fa stable -m "Update stable tag to ${{ steps.version.outputs.new_tag }}"
+ git tag -fa stable -m "Update stable tag"
git push origin stable --force
- name: Update latest tag
if: |
- steps.version.outputs.new_tag && (
+ success() && (
github.event_name == 'workflow_dispatch' && inputs.update_latest ||
github.event_name == 'push'
)
run: |
- echo "Updating latest tag to point to ${{ steps.version.outputs.new_tag }}"
- git tag -fa latest -m "Update latest tag to ${{ steps.version.outputs.new_tag }}"
+ git tag -fa latest -m "Update latest tag"
git push origin latest --force
...
From dd25e5dbbad9be936774e1818135f18d001abd59 Mon Sep 17 00:00:00 2001
From: Edward Firmo <94725493+edwardtfn@users.noreply.github.com>
Date: Sun, 22 Dec 2024 17:19:59 +0100
Subject: [PATCH 9/9] Use `bump_version.sh` from folder `versioning`
---
.github/workflows/versioning.yml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/versioning.yml b/.github/workflows/versioning.yml
index 029d2e1..ac9ce8d 100644
--- a/.github/workflows/versioning.yml
+++ b/.github/workflows/versioning.yml
@@ -42,8 +42,8 @@ jobs:
- name: Bump version
run: |
- chmod +x ./bump_version.sh
- ./bump_version.sh
+ chmod +x ./versioning/bump_version.sh
+ ./versioning/bump_version.sh
- name: Update stable tag
if: |