Compare commits

..

18 Commits

Author SHA1 Message Date
GitHub Actions
ac4d583b64 Bump version to 2024.12.01 2024-12-21 10:37:03 +00:00
Edward Firmo
15830d4134 Merge pull request #42 from edwardtfn/test-new-versioning-03
Fix repo name
2024-12-21 11:27:19 +01:00
Edward Firmo
0c19ca1205 Fix repo name 2024-12-21 11:26:57 +01:00
Edward Firmo
2d676036dc Merge pull request #41 from edwardtfn/test-new-versioning-02
New approach to GitHub tokens
2024-12-21 11:20:35 +01:00
Edward Firmo
c8ffa9e224 New approach to GitHub tokens 2024-12-21 11:20:13 +01:00
Edward Firmo
1406ada53a Merge pull request #40 from edwardtfn/test-new-versioning
Testing new versioning
2024-12-21 11:13:58 +01:00
Edward Firmo
f02f90c3fa Testing new versioning 2024-12-21 11:05:40 +01:00
Edward Firmo
f6169e3ea2 Merge branch 'main' of https://github.com/edwardtfn/TX-Ultimate-Easy 2024-12-21 11:01:47 +01:00
Edward Firmo
6774a1ac18 Set initial version number 2024-12-21 11:01:01 +01:00
Edward Firmo
21720d8ba3 Merge pull request #39 from edwardtfn/dev
New versioning
2024-12-21 10:58:41 +01:00
Edward Firmo
7727c968db Merge branch 'dev' of https://github.com/edwardtfn/TX-Ultimate-Easy into dev 2024-12-21 10:33:54 +01:00
Edward Firmo
dc9e19d43c Add section about version validation 2024-12-21 10:33:36 +01:00
Edward Firmo
737343e395 Add fetch-depth: 0 to checkout action
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2024-12-21 10:31:23 +01:00
Edward Firmo
5569260f92 Update checkout action version
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2024-12-21 10:30:28 +01:00
Edward Firmo
04ca752c3b Add error handling for git operations
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2024-12-21 10:29:46 +01:00
Edward Firmo
23436428a4 Add error handling for invalid version format
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2024-12-21 10:29:12 +01:00
Edward Firmo
26a244cbed Fix potential overflow in sequence number
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
2024-12-21 10:28:14 +01:00
Edward Firmo
ce8b4e700e Merge pull request #38 from edwardtfn/0.0.5
Clean up LED files & new versioning
2024-12-21 10:18:49 +01:00
8 changed files with 41 additions and 13 deletions

View File

@@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Git
run: |
@@ -34,12 +34,12 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git push origin main
git push origin --tags --force
git push https://x-access-token:${GITHUB_TOKEN}@github.com/edwardtfn/TX-Ultimate-Easy.git main
git push https://x-access-token:${GITHUB_TOKEN}@github.com/edwardtfn/TX-Ultimate-Easy.git --tags
- name: Conditionally Update Stable Tag
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.update_stable == 'true' }}
run: |
git tag -f stable
git push origin stable --force
git push https://x-access-token:${GITHUB_TOKEN}@github.com/edwardtfn/TX-Ultimate-Easy.git stable --force
...

BIN
Assets/Logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 KiB

View File

@@ -15,11 +15,7 @@ substitutions:
name: tx-ultimate-easy
friendly_name: TX Ultimate Easy
latitude: '0'
longitude: '0'
zone_home: 'zone.home'
version: '0.0.4'
<<: !include ../versioning/VERSION_YAML
TX_MODEL_FORMAT_EU_TEXT: "EU (Square, T5-xC-86)"
TX_MODEL_FORMAT_US_TEXT: "US (Rectangle, T5-xC-120)"

View File

@@ -98,6 +98,7 @@ async def register_tx_ultimate_easy(var, config):
config[CONF_ON_LONG_TOUCH_RELEASE],
)
async def to_code(config):
var = cg.new_Pvariable(config[CONF_ID])
await cg.register_component(var, config)

View File

@@ -50,6 +50,17 @@ This ensures the correct version is used directly in the ESPHome setup without r
- Enhance the `bump_version.sh` script to support different versioning schemes if needed.
- Integrate versioning information into your deployment pipelines to label builds with their corresponding version.
## Version Validation
The versioning system enforces strict format validation:
- Year must be a 4-digit number (YYYY)
- Month must be a 2-digit number (01-12)
- Sequence must be a 2-digit number (01-99)
The `bump_version.sh` script includes validation checks and will fail if:
- The version format is invalid
- The sequence number would exceed 99 in a month
### GitHub Actions Workflow Adjustment
The GitHub Actions workflow for versioning runs only when changes are merged into the `main` branch, ensuring no premature version updates during PR creation.
This behavior is automatically handled by the integrated workflow.

1
versioning/VERSION Normal file
View File

@@ -0,0 +1 @@
2024.12.01

1
versioning/VERSION_YAML Normal file
View File

@@ -0,0 +1 @@
version: 2024.12.01

View File

@@ -13,6 +13,10 @@ fi
# Extract components
CURRENT_YEAR=$(date +%Y)
CURRENT_MONTH=$(date +%m)
if ! [[ "$CURRENT_VERSION" =~ ^[0-9]{4}\.[0-9]{2}\.[0-9]{2}$ ]]; then
echo "Error: Invalid version format in $VERSION_FILE"
exit 1
fi
CURRENT_SEQ=$(echo "$CURRENT_VERSION" | awk -F. '{print $3}')
VERSION_YEAR=$(echo "$CURRENT_VERSION" | awk -F. '{print $1}')
@@ -20,7 +24,12 @@ VERSION_MONTH=$(echo "$CURRENT_VERSION" | awk -F. '{print $2}')
# Determine new version
if [[ "$CURRENT_YEAR" == "$VERSION_YEAR" && "$CURRENT_MONTH" == "$VERSION_MONTH" ]]; then
NEW_SEQ=$(printf "%02d" $((10#$CURRENT_SEQ + 1))) # Increment sequence
NEXT_SEQ=$((10#$CURRENT_SEQ + 1))
if [ $NEXT_SEQ -gt 99 ]; then
echo "Error: Sequence number would exceed 99"
exit 1
fi
NEW_SEQ=$(printf "%02d" $NEXT_SEQ)
else
NEW_SEQ="01" # Reset sequence for a new month
fi
@@ -34,6 +43,15 @@ echo "$NEW_VERSION" > "$VERSION_FILE"
echo "version: $NEW_VERSION" > "$VERSION_YAML_FILE"
# Commit and tag
git add "$VERSION_FILE" "$VERSION_YAML_FILE"
git commit -m "Bump version to $NEW_VERSION"
git tag "v$NEW_VERSION"
if ! git add "$VERSION_FILE" "$VERSION_YAML_FILE"; then
echo "Error: Failed to stage version files"
exit 1
fi
if ! git commit -m "Bump version to $NEW_VERSION"; then
echo "Error: Failed to commit version bump"
exit 1
fi
if ! git tag "v$NEW_VERSION"; then
echo "Error: Failed to create version tag"
exit 1
fi