Compare commits
18 Commits
0.0.5
...
v2024.12.0
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ac4d583b64 | ||
|
|
15830d4134 | ||
|
|
0c19ca1205 | ||
|
|
2d676036dc | ||
|
|
c8ffa9e224 | ||
|
|
1406ada53a | ||
|
|
f02f90c3fa | ||
|
|
f6169e3ea2 | ||
|
|
6774a1ac18 | ||
|
|
21720d8ba3 | ||
|
|
7727c968db | ||
|
|
dc9e19d43c | ||
|
|
737343e395 | ||
|
|
5569260f92 | ||
|
|
04ca752c3b | ||
|
|
23436428a4 | ||
|
|
26a244cbed | ||
|
|
ce8b4e700e |
8
.github/workflows/versioning.yml
vendored
8
.github/workflows/versioning.yml
vendored
@@ -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
BIN
Assets/Logo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 165 KiB |
@@ -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)"
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
1
versioning/VERSION
Normal file
@@ -0,0 +1 @@
|
||||
2024.12.01
|
||||
1
versioning/VERSION_YAML
Normal file
1
versioning/VERSION_YAML
Normal file
@@ -0,0 +1 @@
|
||||
version: 2024.12.01
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user