mirror of
https://github.com/jhbruhn/respira.git
synced 2026-01-27 02:13:41 +00:00
fix: Build web app with version in release workflow
Moves web app build from publish-pages workflow to release workflow to ensure version consistency and better artifact management.
Changes:
- Added build-web job to release.yml that:
- Updates package.json with the release version
- Builds the web app with proper base path
- Creates a versioned zip artifact (respira-web-{version}.zip)
- Uploads as a release asset alongside desktop builds
- Updated publish-pages.yml to:
- Remove the build-web job (no longer needed)
- Download the pre-built web artifact from the release
- Extract and deploy the versioned build
Benefits:
- All artifacts (desktop + web) built together with same version
- Web app now includes correct version number in package.json
- Simpler and faster publish-pages workflow (no rebuild needed)
- Better caching and consistency across deployments
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
5f46f67cb4
commit
78e15432d8
2 changed files with 41 additions and 36 deletions
38
.github/workflows/publish-pages.yml
vendored
38
.github/workflows/publish-pages.yml
vendored
|
|
@ -10,35 +10,8 @@ permissions:
|
|||
id-token: write
|
||||
|
||||
jobs:
|
||||
build-web:
|
||||
name: Build Web App
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: ".node-version"
|
||||
cache: "npm"
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build web app
|
||||
run: npm run build -- --base=/respira/
|
||||
|
||||
- name: Upload web build artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: web-build
|
||||
path: dist/
|
||||
|
||||
publish-to-pages:
|
||||
name: Publish to GitHub Pages
|
||||
needs: build-web
|
||||
runs-on: ubuntu-latest
|
||||
environment:
|
||||
name: github-pages
|
||||
|
|
@ -48,20 +21,15 @@ jobs:
|
|||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Download web build artifact
|
||||
uses: actions/download-artifact@v4
|
||||
with:
|
||||
name: web-build
|
||||
path: web-build
|
||||
|
||||
- name: Download release assets
|
||||
run: |
|
||||
# Create directory structure
|
||||
mkdir -p pages/update/win32/x64
|
||||
mkdir -p pages/update/darwin/arm64
|
||||
|
||||
# Copy web build to root
|
||||
cp -r web-build/* pages/
|
||||
# Download and extract web build from the release
|
||||
gh release download ${{ github.event.release.tag_name }} --pattern "respira-web-*.zip"
|
||||
unzip -q respira-web-*.zip -d pages/
|
||||
|
||||
# Download Windows auto-update files from the release
|
||||
gh release download ${{ github.event.release.tag_name }} --pattern "*.exe" --dir pages/update/win32/x64
|
||||
|
|
|
|||
39
.github/workflows/release.yml
vendored
39
.github/workflows/release.yml
vendored
|
|
@ -27,6 +27,43 @@ jobs:
|
|||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
build-web:
|
||||
name: Build Web App
|
||||
needs: draft-release
|
||||
if: needs.draft-release.outputs.tag-name != ''
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Setup Node.js
|
||||
uses: actions/setup-node@v6
|
||||
with:
|
||||
node-version-file: ".node-version"
|
||||
cache: "npm"
|
||||
|
||||
- name: Update package.json version
|
||||
run: |
|
||||
npm version ${{ needs.draft-release.outputs.version }} --no-git-tag-version
|
||||
|
||||
- name: Install dependencies
|
||||
run: npm ci
|
||||
|
||||
- name: Build web app
|
||||
run: npm run build -- --base=/respira/
|
||||
|
||||
- name: Create web artifact zip
|
||||
run: |
|
||||
cd dist
|
||||
zip -r ../respira-web-${{ needs.draft-release.outputs.version }}.zip .
|
||||
|
||||
- name: Upload web artifact
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: web-artifacts
|
||||
path: respira-web-${{ needs.draft-release.outputs.version }}.zip
|
||||
|
||||
build-release:
|
||||
name: Build Release - ${{ matrix.os }}
|
||||
needs: draft-release
|
||||
|
|
@ -86,7 +123,7 @@ jobs:
|
|||
|
||||
upload-to-release:
|
||||
name: Upload to GitHub Release
|
||||
needs: [draft-release, build-release]
|
||||
needs: [draft-release, build-web, build-release]
|
||||
if: needs.draft-release.outputs.tag-name != ''
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue