Skip to content

v24.01.0

v24.01.0 #12

Workflow file for this run

# SPDX-License-Identifier: BSD-3-Clause
# Copyright (c) 2023 Scipp contributors (https://github.com/scipp)
name: Release
on:
release:
types: [published]
workflow_dispatch:
defaults:
run:
shell: bash -l {0} # required for conda env
jobs:
build_conda:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
fetch-depth: 0 # history required so cmake can determine version
- name: Setup conda environment
uses: mamba-org/setup-micromamba@v1
with:
environment-name: build-release
create-args: >-
python=3.8
conda-build
boa
- run: conda mambabuild --channel conda-forge --channel scipp --channel mantid --no-anaconda-upload --override-channels --output-folder conda/package conda
- uses: actions/upload-artifact@v3
with:
name: conda-package-ess
path: conda/package/*/ess*.tar.bz2
build_wheels:
name: Wheels
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # history required so setuptools_scm can determine version
- uses: actions/setup-python@v3
with:
python-version: '3.8'
- run: python -m pip install --upgrade pip
- run: python -m pip install -r requirements/wheels.txt
- name: Build wheels
run: python -m build
- name: Upload wheels
uses: actions/upload-artifact@v3
with:
name: dist
path: dist
upload_packages:
name: Deploy packages
needs: [build_conda, build_wheels]
runs-on: ubuntu-22.04
if: github.event_name == 'release' && github.event.action == 'published'
steps:
- uses: actions/download-artifact@v3
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: '3.8'
- run: conda install -c conda-forge --yes anaconda-client
- run: anaconda --token ${{ secrets.ANACONDATOKEN }} upload --user scipp --label main $(ls conda-package-*/*/*.tar.bz2)
- uses: actions/setup-python@v3
# We disable pypi upload for now, because the name `ess` is not authorized
# - uses: pypa/gh-action-pypi-publish@v1.6.4
# with:
# user: __token__
# password: ${{ secrets.PYPI_TOKEN }}
manage-versions:
name: Manage Versions
runs-on: ubuntu-22.04
outputs:
version-new: ${{ steps.version.outputs.new }}
version-replaced: ${{ steps.version.outputs.replaced }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v3
with:
python-version: 3.8
- run: python -m pip install --upgrade pip
- run: python -m pip install -r requirements/ci.txt
- name: Set outputs
id: version
run: |
echo "new=$(python docs/version.py --version=${GITHUB_REF_NAME} --action=is-new)" >> $GITHUB_OUTPUT
echo "replaced=$(python docs/version.py --version=${GITHUB_REF_NAME} --action=get-replaced)" >> $GITHUB_OUTPUT
replaced-docs:
needs: [upload_packages, manage-versions]
if: github.event_name == 'release' && github.event.action == 'published' && needs.manage-versions.outputs.version-new == 'True'
uses: ./.github/workflows/docs.yml
with:
publish: true
version: ${{ needs.manage-versions.outputs.version-replaced }}
secrets: inherit
docs:
needs: upload_packages
uses: ./.github/workflows/docs.yml
with:
publish: ${{ github.event_name == 'release' && github.event.action == 'published' }}
version: ${{ github.ref_name }}
secrets: inherit