Skip to content

MAINT: Improve outdated infrastructure #2361

MAINT: Improve outdated infrastructure

MAINT: Improve outdated infrastructure #2361

Workflow file for this run

name: Construct
concurrency:
group: ${{ github.workflow }}-${{ github.event.number }}-${{ github.event.ref }}
cancel-in-progress: true
on: # yamllint disable-line rule:truthy
push:
branches:
- main
tags:
- '*'
pull_request:
branches:
- main
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
inputs:
ssh:
description: 'Enable ssh debugging'
required: false
default: false
type: boolean
jobs:
# Build installers
build_local:
name: Build local packages
runs-on: ubuntu-latest
env:
CI_OS: ${{ matrix.os }}
defaults:
run:
shell: bash -el {0}
outputs:
enable-ssh: ${{ steps.triage-ssh.outputs.enable-ssh }}
timeout-minutes: 10
steps:
- uses: actions/checkout@v6
- name: Triage SSH
id: triage-ssh
run: |
if [[ "${{ inputs.ssh }}" == "true" ]] || [[ "$COMMIT_MESSAGE" == *"[actions ssh]"* ]]; then
echo "enable-ssh=true" | tee -a $GITHUB_OUTPUT
else
echo "enable-ssh=false" | tee -a $GITHUB_OUTPUT
fi
- uses: mamba-org/setup-micromamba@v3
with:
environment-name: localbuild
create-args: python=3.13 conda-build
- run: ./tools/run_conda_build.sh
- uses: actions/upload-artifact@v7
with:
name: local-packages
path: conda-bld
retention-days: 1
build_macos:
name: Build (${{ matrix.os }})
needs: [build_local]
strategy:
fail-fast: false
matrix:
os: [macos-15-intel, macos-latest] # Intel and Apple Silicon, respectively
runs-on: ${{ matrix.os }}
timeout-minutes: 50
env:
CI_OS: ${{ matrix.os }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v6
- uses: mxschmitt/action-tmate@v3
if: needs.build_local.outputs.enable-ssh == 'true'
timeout-minutes: 20
with:
detached: true
- uses: mamba-org/setup-micromamba@v3
with:
environment-file: environment.yml
- uses: actions/download-artifact@v8
with:
name: local-packages
path: conda-bld
- run: ./tools/extract_version.sh
- run: ./tools/macos_install_certificates.sh
if: ${{ github.event_name != 'pull_request' }}
env:
APPLICATION_CERT_BASE64: ${{ secrets.APPLE_APPLICATION_CERT_BASE64 }}
APPLICATION_CERT_PASSWORD: ${{ secrets.APPLE_APPLICATION_CERT_PASSWORD }}
INSTALLER_CERT_BASE64: ${{ secrets.APPLE_INSTALLER_CERT_BASE64 }}
INSTALLER_CERT_PASSWORD: ${{ secrets.APPLE_INSTALLER_CERT_PASSWORD }}
KEYCHAIN_PASSWORD: ${{ secrets.APPLE_KEYCHAIN_PASSWORD }}
- name: Patch config (non-PR)
if: ${{ github.event_name != 'pull_request' }}
run: |
sed -i "" "s/_name: *# \[osx\]/_name: 9779L28NP8 # \[osx\]/" ${RECIPE_DIR}/construct.yaml
- run: ./tools/run_constructor.sh
timeout-minutes: 20
- run: ./tools/macos_check_installer_signature.sh
- run: ./tools/macos_notarize_installer.sh
if: ${{ github.event_name != 'pull_request' }}
env:
APPLE_ID: ${{ secrets.APPLE_ID }}
APPLE_ID_PASSWORD: ${{ secrets.APPLE_ID_PASSWORD }}
APPLE_TEAM_ID: ${{ secrets.APPLE_TEAM_ID }}
- run: ./tools/calculate_installer_hash.sh
- run: |
installer -verbose -pkginfo -pkg ./${MNE_INSTALLER_NAME}
installer -verbose -dominfo -pkg ./${MNE_INSTALLER_NAME}
installer -verbose -volinfo -pkg ./${MNE_INSTALLER_NAME}
- uses: actions/upload-artifact@v7
with:
path: ${{ env.MNE_INSTALLER_NAME }}
retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }}
archive: false
build_linux:
name: Build (${{ matrix.os }})
needs: [build_local]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
timeout-minutes: 50
env:
CI_OS: ${{ matrix.os }}
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v6
- uses: mxschmitt/action-tmate@v3
if: needs.build_local.outputs.enable-ssh == 'true'
timeout-minutes: 20
with:
detached: true
- uses: mamba-org/setup-micromamba@v3
with:
environment-file: environment.yml
- uses: actions/download-artifact@v8
with:
name: local-packages
path: conda-bld
- run: ./tools/extract_version.sh
- run: ./tools/run_constructor.sh
timeout-minutes: 20
- run: ./tools/calculate_installer_hash.sh
- uses: actions/upload-artifact@v7
with:
path: ${{ env.MNE_INSTALLER_NAME }}
retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }}
archive: false
build_windows:
name: Build (${{ matrix.os }})
needs: [build_local]
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [windows-latest]
timeout-minutes: 50
env:
CI_OS: ${{ matrix.os }}
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v6
- uses: mxschmitt/action-tmate@v3
if: needs.build_local.outputs.enable-ssh == 'true'
timeout-minutes: 20
with:
detached: true
- uses: mamba-org/setup-micromamba@v3
with:
environment-file: environment.yml
- uses: actions/download-artifact@v8
with:
name: local-packages
path: conda-bld
- run: ./tools/extract_version.sh
- run: ./tools/run_constructor.sh
timeout-minutes: 20
- run: ./tools/calculate_installer_hash.sh
- uses: actions/upload-artifact@v7
with:
path: ${{ env.MNE_INSTALLER_NAME }}
retention-days: ${{ env.ARTIFACT_RETENTION_DAYS }}
archive: false
# Test
test_macos:
name: Test (${{ matrix.os }})
needs: [build_macos]
strategy:
fail-fast: false
matrix:
os: [macos-15-intel, macos-latest]
runs-on: ${{ matrix.os }}
timeout-minutes: 50
env:
CI_OS: ${{ matrix.os }}
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v6
- run: ./tools/extract_version.sh
- uses: actions/download-artifact@v8
with:
name: ${{ env.MNE_INSTALLER_NAME }}
skip-decompress: true
- name: Run installer
run: |
sudo installer -verbose -pkg ${MNE_INSTALLER_NAME} -target / \
|| ( tail -n 30 /var/log/install.log && exit 1 ) # display last log messages on error
- run: ./tools/export_frozen_env_def.sh
- uses: actions/upload-artifact@v7
with:
path: ${{ env.MNE_INSTALLER_JSON_NAME }}
archive: false
# upload just one for each installer version
if: matrix.os == 'macos-15-intel' || matrix.os == 'macos-latest'
- uses: pyvista/setup-headless-display-action@main
with:
qt: true
pyvista: false
wm: false
- run: ./tools/check_installation.sh
test_linux:
name: Test (${{ matrix.os }})
needs: [build_linux]
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-24.04]
runs-on: ${{ matrix.os }}
timeout-minutes: 50
env:
CI_OS: ${{ matrix.os }}
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v6
- run: ./tools/extract_version.sh
- uses: actions/download-artifact@v8
with:
name: ${{ env.MNE_INSTALLER_NAME }}
skip-decompress: true
- run: sh ./${MNE_INSTALLER_NAME} -b
- run: ./tools/export_frozen_env_def.sh
- uses: actions/upload-artifact@v7
with:
path: ${{ env.MNE_INSTALLER_JSON_NAME }}
archive: false
# upload just one for each installer version
if: matrix.os == 'ubuntu-24.04'
- uses: pyvista/setup-headless-display-action@main
with:
qt: true
pyvista: false
wm: false
- run: ./tools/check_installation.sh
test_windows:
needs: [build_windows]
name: Test (${{ matrix.os }})
strategy:
fail-fast: false
matrix:
os: [windows-2022, windows-2025]
runs-on: ${{ matrix.os }}
timeout-minutes: 80
env:
CI_OS: ${{ matrix.os }}
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/checkout@v6
- run: ./tools/extract_version.sh
- uses: actions/download-artifact@v8
with:
name: ${{ env.MNE_INSTALLER_NAME }}
skip-decompress: true
# https://docs.anaconda.com/anaconda/install/silent-mode.html#windows
- run: .\%MNE_INSTALLER_NAME% /S /InstallationType=JustMe /AddToPath=1
timeout-minutes: 70
shell: cmd
- run: ./tools/export_frozen_env_def.sh
- uses: actions/upload-artifact@v7
with:
path: ${{ env.MNE_INSTALLER_JSON_NAME }}
archive: false
# upload just one for each installer version
if: matrix.os == 'windows-2022'
- uses: pyvista/setup-headless-display-action@main
with:
qt: true
pyvista: false
wm: false
- run: ./tools/check_installation.sh
timeout-minutes: 5 # < 2 min even on Windows
# Release
release:
name: Release
needs: [build_macos, build_linux, build_windows, test_macos, test_linux, test_windows]
runs-on: ubuntu-latest
timeout-minutes: 20
defaults:
run:
shell: bash -el {0}
steps:
# These names should correspond to MNE_INSTALLER_NAME (plus JSONs) in tools/extract_version.sh
- uses: actions/download-artifact@v8
with:
pattern: MNE-Python-*
merge-multiple: true
skip-decompress: true
- run: ls -al ./
- uses: ncipollo/release-action@v1
with:
artifacts: "MNE-Python-*.*"
token: ${{ secrets.GITHUB_TOKEN }}
draft: true
prerelease: true
allowUpdates: true
generateReleaseNotes: true
if: github.ref_type == 'tag'