Skip to content

Commit

Permalink
Update Workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
AzonInc committed Aug 14, 2024
1 parent c1e9085 commit 185207e
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 15 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/deploy-pages-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
23 changes: 16 additions & 7 deletions .github/workflows/deploy-pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion firmware/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 185207e

Please sign in to comment.