Skip to content

Add repo in upload Path with progress #132

Add repo in upload Path with progress

Add repo in upload Path with progress #132

Workflow file for this run

name: Build desktop apps
on:
push:
branches: [ beta, beta-pre-clean ]
workflow_dispatch:
permissions:
contents: write
jobs:
build-mac:
runs-on: macos-latest
strategy:
matrix:
arch: [x64, arm64]
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: package-lock.json
- name: Install dependencies
run: npm ci
- name: Build renderer (Vite)
run: npm run build
- name: Build Electron app
run: npx electron-builder --mac --${{ matrix.arch }} --publish=never
env:
CSC_IDENTITY_AUTO_DISCOVERY: false
- name: Upload macOS artifact
uses: actions/upload-artifact@v4
with:
name: lumen-browser-mac-${{ matrix.arch }}
path: release/*.dmg
build-windows:
runs-on: windows-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: package-lock.json
- name: Install dependencies
run: npm ci
- name: Build Windows installer (NSIS)
run: npm run dist:win
- name: Upload Windows artifact
uses: actions/upload-artifact@v4
with:
name: lumen-browser-windows-x64
path: |
release/*Setup*.exe
!release/*.__uninstaller.exe
!release/*.blockmap
build-linux:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 20
cache: npm
cache-dependency-path: package-lock.json
- name: Install Linux deps
shell: bash
run: |
set -euo pipefail
sudo apt-get update
sudo apt-get install -y libfuse2 || sudo apt-get install -y libfuse2t64 || sudo apt-get install -y fuse
- name: Install dependencies
run: npm ci
- name: Build renderer (Vite)
run: npm run build
- name: Build Linux AppImage (x64)
run: npx electron-builder --linux AppImage --x64 --publish=never
- name: Upload Linux artifact
uses: actions/upload-artifact@v4
with:
name: lumen-browser-linux-x64
path: |
release/*.AppImage
!release/*.blockmap
checksums:
needs: [build-mac, build-windows, build-linux]
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Download build artifacts
uses: actions/download-artifact@v4
with:
pattern: lumen-browser-*
path: artifacts
- name: Prepare release assets
id: meta
shell: bash
run: |
set -euo pipefail
VERSION="$(python -c "import json; print(json.load(open('package.json','r',encoding='utf-8')).get('version',''))")"
VERSION="$(echo "$VERSION" | tr -d '[:space:]')"
if [ -z "$VERSION" ]; then
echo "Missing version in package.json" >&2
exit 1
fi
TAG="v${VERSION}-draft${GITHUB_RUN_NUMBER}"
echo "version=${VERSION}" >> "$GITHUB_OUTPUT"
echo "tag=${TAG}" >> "$GITHUB_OUTPUT"
echo "Draft release tag: ${TAG}"
mkdir -p release_assets
mac_x64="$(ls -1t artifacts/lumen-browser-mac-x64/*.dmg 2>/dev/null | head -n 1 || true)"
mac_arm64="$(ls -1t artifacts/lumen-browser-mac-arm64/*.dmg 2>/dev/null | head -n 1 || true)"
win_x64="$(ls -1t artifacts/lumen-browser-windows-x64/*Setup*.exe 2>/dev/null | head -n 1 || true)"
linux_x64="$(ls -1t artifacts/lumen-browser-linux-x64/*.AppImage 2>/dev/null | head -n 1 || true)"
if [ -z "$mac_x64" ] || [ -z "$mac_arm64" ] || [ -z "$win_x64" ] || [ -z "$linux_x64" ]; then
echo "Missing one or more platform artifacts:" >&2
echo "mac_x64=$mac_x64" >&2
echo "mac_arm64=$mac_arm64" >&2
echo "win_x64=$win_x64" >&2
echo "linux_x64=$linux_x64" >&2
exit 1
fi
cp "$mac_x64" "release_assets/Lumen-Browser-${VERSION}-mac-x64.dmg"
cp "$mac_arm64" "release_assets/Lumen-Browser-${VERSION}-mac-arm64.dmg"
cp "$win_x64" "release_assets/Lumen-Browser-Setup-${VERSION}-windows-x64.exe"
cp "$linux_x64" "release_assets/Lumen-Browser-${VERSION}-linux-x64.AppImage"
- name: Build SHA256SUMS.txt
shell: bash
run: |
set -euo pipefail
(cd release_assets && sha256sum * ) > SHA256SUMS.txt
- name: Upload SHA256SUMS.txt
uses: actions/upload-artifact@v4
with:
name: lumen-browser-SHA256SUMS
path: SHA256SUMS.txt
- name: Validate release tag (avoid mismatched tag commit)
id: tagcheck
shell: bash
env:
TAG: ${{ steps.meta.outputs.tag }}
run: |
set -euo pipefail
git fetch --tags --force
if git rev-parse -q --verify "refs/tags/${TAG}" >/dev/null 2>&1; then
tag_commit="$(git rev-list -n 1 "${TAG}")"
if [ "${tag_commit}" != "${GITHUB_SHA}" ]; then
echo "Tag ${TAG} already exists but points to ${tag_commit}, not this commit (${GITHUB_SHA})." >&2
echo "enabled=false" >> "$GITHUB_OUTPUT"
exit 0
fi
fi
echo "enabled=true" >> "$GITHUB_OUTPUT"
- name: Create / update draft GitHub release
if: steps.tagcheck.outputs.enabled == 'true'
id: draft_release
uses: ncipollo/release-action@v1
with:
token: ${{ github.token }}
tag: ${{ steps.meta.outputs.tag }}
commit: ${{ github.sha }}
name: Lumen Browser ${{ steps.meta.outputs.tag }}
draft: true
allowUpdates: true
updateOnlyUnreleased: true
replacesArtifacts: true
artifacts: |
release_assets/*
SHA256SUMS.txt
- name: Release summary
if: steps.tagcheck.outputs.enabled == 'true'
shell: bash
run: |
set -euo pipefail
echo "Draft release created/updated:" >> "$GITHUB_STEP_SUMMARY"
echo "" >> "$GITHUB_STEP_SUMMARY"
echo "- Tag: \`${{ steps.meta.outputs.tag }}\`" >> "$GITHUB_STEP_SUMMARY"
echo "- URL: ${{ steps.draft_release.outputs.html_url }}" >> "$GITHUB_STEP_SUMMARY"