diff --git a/.github/workflows/deploy-pages-dev.yml b/.github/workflows/deploy-pages-dev.yml index 408e17f8..e3440c0d 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 41fce91b..a11a941b 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 b754465d..8760c1f4 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