From 185207e17ac097d1b8951ee64a8ea2feaa9a6717 Mon Sep 17 00:00:00 2001 From: Florian Date: Wed, 14 Aug 2024 20:41:55 +0200 Subject: [PATCH] Update Workflows --- .github/workflows/deploy-pages-dev.yml | 20 +++++++++++++------- .github/workflows/deploy-pages.yml | 23 ++++++++++++++++------- firmware/base.yaml | 2 +- 3 files changed, 30 insertions(+), 15 deletions(-) diff --git a/.github/workflows/deploy-pages-dev.yml b/.github/workflows/deploy-pages-dev.yml index 408e17f..e3440c0 100644 --- a/.github/workflows/deploy-pages-dev.yml +++ b/.github/workflows/deploy-pages-dev.yml @@ -25,31 +25,37 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: - fetch-depth: 0 # Not needed if lastUpdated is not enabled - # - uses: pnpm/action-setup@v3 # Uncomment this if you're using pnpm - # - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun + fetch-depth: 0 + - name: Setup Node uses: actions/setup-node@v4 with: node-version: 20 - cache: npm # or pnpm / yarn + cache: npm + - name: Setup Pages uses: actions/configure-pages@v4 - + - name: Extract version from base.yaml id: extract_version run: | VERSION=$(awk '/project:/, /version:/' firmware/base.yaml | grep 'version:' | awk '{print $2}' | sed 's/[",]//g') - echo "VERSION=${VERSION}-dev" >> $GITHUB_ENV + echo "VERSION=${VERSION}" >> $GITHUB_ENV + + - name: Update ESPHome project version + run: | + sed -i '/^ project:/,/^ platformio_options:/s/^ version: .*/ version: "'"$VERSION"'-dev"/' firmware/base.yaml - name: Update package.json version run: | - sed -i "s/\"version\": \".*\"/\"version\": \"${VERSION}\"/" package.json + sed -i "s/\"version\": \".*\"/\"version\": \"${VERSION}-dev\"/" package.json - name: Install dependencies run: npm ci + - name: Build with VitePress run: npm run docs:build + - name: Upload VitePress artifact uses: actions/upload-artifact@v4 with: diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml index 41fce91..a11a941 100644 --- a/.github/workflows/deploy-pages.yml +++ b/.github/workflows/deploy-pages.yml @@ -31,24 +31,33 @@ jobs: - name: Checkout uses: actions/checkout@v4 with: - fetch-depth: 0 # Not needed if lastUpdated is not enabled - # - uses: pnpm/action-setup@v3 # Uncomment this if you're using pnpm - # - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun + fetch-depth: 0 + - name: Setup Node uses: actions/setup-node@v4 with: node-version: 20 - cache: npm # or pnpm / yarn + cache: npm + - name: Setup Pages uses: actions/configure-pages@v4 - - name: Set Version + + - name: Extract version from base.yaml + id: extract_version + run: | + VERSION=$(awk '/project:/, /version:/' firmware/base.yaml | grep 'version:' | awk '{print $2}' | sed 's/[",]//g') + echo "VERSION=${VERSION}" >> $GITHUB_ENV + + - name: Update package.json version run: | - version=$(grep 'version:' firmware/base.yaml | awk -F'"' '{print $2}') - sed -i -e "s/\"version\": \"[^\"]*\"/\"version\": \"$version\"/" package.json + sed -i "s/\"version\": \".*\"/\"version\": \"${VERSION}\"/" package.json + - name: Install dependencies run: npm ci + - name: Build with VitePress run: npm run docs:build + - name: Upload VitePress artifact uses: actions/upload-artifact@v4 with: diff --git a/firmware/base.yaml b/firmware/base.yaml index b754465..8760c1f 100644 --- a/firmware/base.yaml +++ b/firmware/base.yaml @@ -64,7 +64,7 @@ esphome: project: name: "AzonInc.Doorman-Stock" - version: "2024.8.1" + version: "2024.8.1" platformio_options: board_build.flash_mode: dio