Skip to content

Fix live reduction when Mantid default facility is not SNS #653

Fix live reduction when Mantid default facility is not SNS

Fix live reduction when Mantid default facility is not SNS #653

Workflow file for this run

name: Pixi Packaging and Deployment
on:
workflow_dispatch:
push:
branches: [main]
tags: ['v*']
pull_request:
# Run on pull requests targeting any base branch
env:
PKG_NAME: snapred
MODULE_NAME: snapred
jobs:
linux:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for accurate versioning
fetch-tags: true # Fetch tags to ensure versioning works correctly
- name: Setup Pixi
uses: prefix-dev/setup-pixi@5185adfbffb4bd703da3010310260805d89ebb11 # v0.9.6
with:
manifest-path: pyproject.toml
# Workaround: Dynamic versioning (versioningit) causes lock file version mismatch.
# We skip the editable package install and do it separately with pip.
# See: https://github.com/prefix-dev/pixi/pull/3092
run-install: false
- name: Install dependencies (skip local package)
run: pixi install --frozen --skip ${{ env.PKG_NAME }}
- name: Install local package
run: pixi run pip install --no-deps -e .
- name: Build conda package
run: |
pixi run build-conda
mkdir -p /tmp/local-channel/linux-64
cp *.conda /tmp/local-channel/linux-64
- name: Verify conda package
uses: neutrons/conda-verify@main
with:
package-name: ${{ env.PKG_NAME }}
module-name: ${{ env.MODULE_NAME }}
python-version: "3.12"
local-channel: /tmp/local-channel
extra-channels: mantid-ornl mantid neutrons
- name: upload conda package to anaconda
if: startsWith(github.ref, 'refs/tags/v')
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
IS_RC: ${{ contains(github.ref, 'rc') }}
run: |
# label is main or rc depending on the tag-name
CONDA_LABEL="main"
if [ "${IS_RC}" = "true" ]; then CONDA_LABEL="rc"; fi
echo pushing ${{ github.ref }} with label $CONDA_LABEL
pixi run anaconda upload --label $CONDA_LABEL --user neutrons snapred-*.conda
trigger-deploy:
runs-on: ubuntu-latest
needs: [linux]
# only trigger deploys from protected branches and tags
if: ${{github.ref_protected || github.ref_type == 'tag' }}
steps:
- name: Determine Environment
uses: neutrons/branch-mapper@v2
id: conda_env_name
with:
prefix: snapred
- name: Trigger deploy
id: trigger
uses: eic/trigger-gitlab-ci@v3
with:
url: https://code.ornl.gov
token: ${{ secrets.GITLAB_TRIGGER_TOKEN }}
ref_name: main
project_id: 7835
variables: |
PLAY="update"
CONDA_ENV="${{ steps.conda_env_name.outputs.name }}"