diff --git a/.github/workflows/release_tag.yml b/.github/workflows/release_tag.yml deleted file mode 100644 index 6dce8f0..0000000 --- a/.github/workflows/release_tag.yml +++ /dev/null @@ -1,40 +0,0 @@ -# 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. -# 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. ---- -name: Update Tags - -# yamllint disable-line rule:truthy -on: - release: - types: [published] - -jobs: - update-tags: - runs-on: ubuntu-latest - steps: - - name: Checkout code - uses: actions/checkout@main - 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 stable tag - 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 -... 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 diff --git a/.github/workflows/versioning.yml b/.github/workflows/versioning.yml index 2e49b1a..ac9ce8d 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,56 @@ 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 + - name: Bump version run: | - chmod +x "./versioning/bump_version.sh" - "./versioning/bump_version.sh" + chmod +x ./versioning/bump_version.sh + ./versioning/bump_version.sh - - name: Push Changes and Tags - env: - GITHUB_TOKEN: "${{ secrets.GITHUB_TOKEN }}" + - name: Update stable tag + if: | + success() && ( + github.event_name == 'workflow_dispatch' && inputs.update_stable || + github.event_name == 'push' + ) 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 + git tag -fa stable -m "Update stable tag" + git push origin stable --force + + - name: Update latest tag + if: | + success() && ( + github.event_name == 'workflow_dispatch' && inputs.update_latest || + github.event_name == 'push' + ) + run: | + git tag -fa latest -m "Update latest tag" + git push origin latest --force ... diff --git a/README.md b/README.md index 80a5575..f3b3926 100644 --- a/README.md +++ b/README.md @@ -1,19 +1,20 @@ # 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) |  ![TX Ultimate Easy Logo](Assets/Logo.webp) | 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 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