mirror of
https://github.com/flobz/psa_car_controller.git
synced 2026-08-22 09:26:16 +00:00
ci: add beta branch
This commit is contained in:
committed by
Florian BEZANNIER
parent
23c950f18a
commit
6cb884b2f8
@@ -84,26 +84,24 @@ jobs:
|
||||
needs: push_to_registry
|
||||
name: Update psacc-ha version
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, '-')
|
||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && !contains(github.ref, 'b')
|
||||
steps:
|
||||
- name: Update psacc-ha version
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GH_PAT }}
|
||||
VERSION: ${{ github.ref_name }}
|
||||
run: |
|
||||
echo "Updating flobz/psacc-ha config.json to $VERSION"
|
||||
|
||||
# Get current content and SHA
|
||||
RESPONSE=$(gh api repos/flobz/psacc-ha/contents/psacc-ha/config.json)
|
||||
FILE_SHA=$(echo "$RESPONSE" | jq -r '.sha')
|
||||
CURRENT_CONTENT=$(echo "$RESPONSE" | jq -r '.content' | base64 -d)
|
||||
|
||||
# Replace version
|
||||
NEW_CONTENT=$(echo "$CURRENT_CONTENT" | sed "s/\"version\": \"v[^\"]*\"/\"version\": \"$VERSION\"/")
|
||||
|
||||
# Update file
|
||||
gh api repos/flobz/psacc-ha/contents/psacc-ha/config.json \
|
||||
-X PUT \
|
||||
-f message="chore: bump version to $VERSION" \
|
||||
-f content="$(echo "$NEW_CONTENT" | base64 -w 0)" \
|
||||
-f sha="$FILE_SHA"
|
||||
- uses: ./.github/actions/update-ha-config
|
||||
with:
|
||||
gh_token: ${{ secrets.GH_PAT }}
|
||||
version: ${{ github.ref_name }}
|
||||
branch: 'main'
|
||||
message: "chore: bump version to ${{ github.ref_name }}"
|
||||
|
||||
update_ha_config_beta:
|
||||
needs: push_to_registry
|
||||
name: Update psacc-ha beta version
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v') && contains(github.ref, 'b')
|
||||
steps:
|
||||
- uses: ./.github/actions/update-ha-config
|
||||
with:
|
||||
gh_token: ${{ secrets.GH_PAT }}
|
||||
version: ${{ github.ref_name }}
|
||||
branch: 'beta'
|
||||
message: "chore: bump beta version to ${{ github.ref_name }}"
|
||||
|
||||
Reference in New Issue
Block a user