Skip to content

Update artifacts after stash #2

Update artifacts after stash

Update artifacts after stash #2

name: Update Documentation Version
on:
push:
branches: ["main"]
paths:
- 'artifacts/manifest.json'
jobs:
update-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.PAT }}
# Replace the badge with the latest version
# https://img.shields.io/badge/esp32s2-0.1.0-magenta
- name: Read manifest and update docs
run: |
# Read version from manifest.json
eps32VERSION=$(jq -r .version artifacts/openspool-esp32/manifest.json)
esp32s2VERSION=$(jq -r .version artifacts/openspool-esp32s2/manifest.json)
echo "VERSION=$eps32VERSION"
sed -i 's/badge\/esp32-[^-]*-magenta/badge\/esp32-'"$eps32VERSION"'-magenta/' docs/index.md
sed -i 's/badge\/esp32-[^-]*-magenta/badge\/esp32-'"$eps32VERSION"'-magenta/' README.md
cat docs/index.md | grep shields.io
echo "VERSION=$esp32s2VERSION"
sed -i 's/badge\/esp32s2-[^-]*-magenta/badge\/esp32s2-'"$esp32s2VERSION"'-magenta/' docs/index.md
sed -i 's/badge\/esp32s2-[^-]*-magenta/badge\/esp32s2-'"$esp32s2VERSION"'-magenta/' README.md
cat docs/index.md | grep shields.io
- name: Commit manifest file
uses: EndBug/add-and-commit@v9
with:
committer_name: GitHub Actions
committer_email: actions@github.com
message: Update manifest.json
add: "docs/*.md"
push: true