mirror of
https://github.com/jhbruhn/respira.git
synced 2026-01-27 10:23:41 +00:00
Merge pull request #15 from jhbruhn/fix/inject-version-in-pages-build
Fix: inject version in pages build
This commit is contained in:
commit
7d42435056
2 changed files with 44 additions and 39 deletions
|
|
@ -1,4 +1,4 @@
|
||||||
name: Release
|
name: Draft Release
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
|
@ -27,10 +27,47 @@ jobs:
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
build-web:
|
||||||
|
name: Build Web App
|
||||||
|
needs: draft-release
|
||||||
|
if: needs.draft-release.outputs.tag-name != '' && github.ref == 'refs/heads/main'
|
||||||
|
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:
|
build-release:
|
||||||
name: Build Release - ${{ matrix.os }}
|
name: Build Release - ${{ matrix.os }}
|
||||||
needs: draft-release
|
needs: draft-release
|
||||||
if: needs.draft-release.outputs.tag-name != ''
|
if: needs.draft-release.outputs.tag-name != '' && github.ref == 'refs/heads/main'
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
|
|
@ -86,8 +123,8 @@ jobs:
|
||||||
|
|
||||||
upload-to-release:
|
upload-to-release:
|
||||||
name: Upload to GitHub 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 != ''
|
if: needs.draft-release.outputs.tag-name != '' && github.ref == 'refs/heads/main'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
38
.github/workflows/publish-pages.yml
vendored
38
.github/workflows/publish-pages.yml
vendored
|
|
@ -10,35 +10,8 @@ permissions:
|
||||||
id-token: write
|
id-token: write
|
||||||
|
|
||||||
jobs:
|
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:
|
publish-to-pages:
|
||||||
name: Publish to GitHub Pages
|
name: Publish to GitHub Pages
|
||||||
needs: build-web
|
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
environment:
|
environment:
|
||||||
name: github-pages
|
name: github-pages
|
||||||
|
|
@ -48,20 +21,15 @@ jobs:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
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
|
- name: Download release assets
|
||||||
run: |
|
run: |
|
||||||
# Create directory structure
|
# Create directory structure
|
||||||
mkdir -p pages/update/win32/x64
|
mkdir -p pages/update/win32/x64
|
||||||
mkdir -p pages/update/darwin/arm64
|
mkdir -p pages/update/darwin/arm64
|
||||||
|
|
||||||
# Copy web build to root
|
# Download and extract web build from the release
|
||||||
cp -r web-build/* pages/
|
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
|
# Download Windows auto-update files from the release
|
||||||
gh release download ${{ github.event.release.tag_name }} --pattern "*.exe" --dir pages/update/win32/x64
|
gh release download ${{ github.event.release.tag_name }} --pattern "*.exe" --dir pages/update/win32/x64
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue