Show version, edition, Git revision, runtime provider, musrfit, and ROOT in Quick Start across Electron and web deployments. Embed source provenance in Linux and Windows packages, repair the hardened help-window IPC path, and make Plotly controls toggle consistently by tap or click.
139 lines
5.5 KiB
YAML
139 lines
5.5 KiB
YAML
name: Build and package
|
|
|
|
on:
|
|
push:
|
|
tags:
|
|
- 'v*'
|
|
workflow_dispatch:
|
|
inputs:
|
|
runtime_run_id:
|
|
description: 'Optional Actions runtime override; otherwise use the committed registry pin (legacy variable during migration)'
|
|
required: false
|
|
|
|
permissions:
|
|
contents: write
|
|
actions: read
|
|
packages: write
|
|
|
|
jobs:
|
|
build-package:
|
|
if: ${{ gitea.event_name != 'push' || gitea.event.deleted != true }}
|
|
runs-on: ubuntu-latest-full
|
|
timeout-minutes: 120
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
env:
|
|
ELECTRON_SKIP_BINARY_DOWNLOAD: '1'
|
|
RUNTIME_RUN_OVERRIDE: ${{ inputs.runtime_run_id }}
|
|
LEGACY_RUNTIME_RUN_ID: ${{ vars.MUSRFLOW_RUNTIME_RUN_ID }}
|
|
PACKAGE_RUN_ID: ${{ gitea.run_id }}
|
|
GITEA_EVENT_NAME: ${{ gitea.event_name }}
|
|
GITEA_REF: ${{ gitea.ref }}
|
|
steps:
|
|
- name: Check out muSRFlow
|
|
uses: https://github.com/actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
|
with:
|
|
github-server-url: ${{ gitea.server_url }}
|
|
persist-credentials: false
|
|
|
|
- name: Set up Node.js
|
|
uses: https://github.com/actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
|
|
with:
|
|
node-version: '22.23.2'
|
|
|
|
- name: Validate release identity
|
|
run: node scripts/ci-release.js prepare
|
|
|
|
- name: Check runtime selection
|
|
run: |
|
|
node scripts/ci-runtime-registry.js select packaging/runtime/runtime-source.json
|
|
echo "Packaging run ID for Publish packages: $PACKAGE_RUN_ID"
|
|
|
|
- name: Download selected runtime
|
|
if: ${{ env.RUNTIME_SOURCE == 'artifact' }}
|
|
uses: https://github.com/actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
|
|
with:
|
|
name: musrflow-runtime-linux-x64
|
|
path: runtime-download
|
|
run-id: ${{ env.RUNTIME_RUN_ID }}
|
|
repository: ${{ gitea.repository }}
|
|
github-token: ${{ secrets.GITEA_TOKEN }}
|
|
|
|
- name: Download pinned registry runtime
|
|
if: ${{ env.RUNTIME_SOURCE == 'registry' }}
|
|
env:
|
|
GITEA_SERVER_URL: ${{ gitea.server_url }}
|
|
GITEA_REPOSITORY: ${{ gitea.repository }}
|
|
RUNTIME_TOKEN: ${{ secrets.PACKAGES_TOKEN || secrets.GITEA_TOKEN }}
|
|
run: node scripts/ci-runtime-registry.js download packaging/runtime/runtime-source.json runtime-download
|
|
|
|
- name: Install dependencies
|
|
run: npm ci --no-audit --no-fund
|
|
|
|
- name: Verify and restore runtime before packaging
|
|
run: |
|
|
set -euo pipefail
|
|
node scripts/ci-restore-runtime.js runtime-download .ci-runtime
|
|
# The installer exports RUNTIME_DIR for subsequent steps, not this shell.
|
|
|
|
- name: Validate restored scientific tools
|
|
run: bash packaging/runtime/validate-runtime.sh "$RUNTIME_DIR" --arch x64
|
|
|
|
- name: Run tests
|
|
run: npm run test:electron
|
|
|
|
- name: Build Linux application and runtime packages
|
|
run: |
|
|
set -euo pipefail
|
|
# Application packaging also populates the fpm/AppImage tool cache.
|
|
node scripts/write-build-info.js
|
|
npx --yes electron-builder@26.15.3 --linux rpm AppImage --x64 --publish never
|
|
bash packaging/runtime/build-runtime-appimage.sh
|
|
bash packaging/runtime/build-runtime-rpm.sh
|
|
bash packaging/runtime/build-runtime-archive.sh
|
|
npm run checksums
|
|
|
|
- name: Collect complete package set
|
|
run: |
|
|
set -euo pipefail
|
|
version=$(node -p "require('./package.json').version")
|
|
mkdir -p artifacts
|
|
# Explicit files make partial builds fail rather than hiding missing output.
|
|
for file in "musrflow-$version-x86_64.rpm" "muSRFlow-$version-x86_64.AppImage" \
|
|
"musrflow-runtime-$version-x86_64.rpm" "musrflow-runtime-$version-x86_64.AppImage"; do
|
|
test -s "dist/$file"
|
|
cp "dist/$file" "dist/$file.md5" "dist/$file.sha256" artifacts/
|
|
done
|
|
cp -a dist/runtime-downloads artifacts/
|
|
cp "$RUNTIME_DIR/runtime-manifest.json" artifacts/
|
|
printf 'runtime_workflow_run=%s\nmuSRFlow=%s\n' "$RUNTIME_RUN_ID" "$(git rev-parse HEAD)" > artifacts/build-source.txt
|
|
cp .ci-release-context.json artifacts/release-context.json
|
|
if [ "$RUNTIME_SOURCE" = registry ]; then cp packaging/runtime/runtime-source.json artifacts/runtime-source.json; fi
|
|
|
|
- name: Upload packages
|
|
uses: https://github.com/actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
|
|
with:
|
|
name: musrflow-linux-packages
|
|
path: artifacts/
|
|
if-no-files-found: error
|
|
compression-level: 0
|
|
retention-days: 30
|
|
|
|
# Preserve the complete artifact before publishing so registry failures
|
|
# can be retried with Publish packages without recompiling anything.
|
|
- name: Publish and link packages to repository
|
|
env:
|
|
GITEA_SERVER_URL: ${{ gitea.server_url }}
|
|
GITEA_REPOSITORY: ${{ gitea.repository }}
|
|
PACKAGES_TOKEN: ${{ secrets.PACKAGES_TOKEN || secrets.GITEA_TOKEN }}
|
|
run: node scripts/ci-publish-packages.js artifacts
|
|
|
|
- name: Create draft Release when both platforms are ready
|
|
env:
|
|
GITEA_SERVER_URL: ${{ gitea.server_url }}
|
|
GITEA_REPOSITORY: ${{ gitea.repository }}
|
|
RELEASES_TOKEN: ${{ secrets.RELEASES_TOKEN || secrets.GITEA_TOKEN }}
|
|
PACKAGES_TOKEN: ${{ secrets.PACKAGES_TOKEN || secrets.GITEA_TOKEN }}
|
|
run: node scripts/ci-release.js draft artifacts
|