Skip to content

conda-meta-yaml

conda-meta-yaml #57

Workflow file for this run

---
name: Ska3 conda meta.yaml
on:
repository_dispatch:
types: [conda-meta-yaml]
jobs:
generate-json:
runs-on: ${{ matrix.os }}-latest
name: Generate ${{ matrix.os }} json files
if: ${{ github.event.client_payload.version && github.event.client_payload.skare3_branch && github.event.client_payload.channel && github.event.client_payload.python_version }}
strategy:
fail-fast: false
matrix:
os: ["ubuntu", "macos", "windows"]
steps:
- name: Setup Conda Environment
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
python-version: ${{ github.event.client_payload.python_version }}
activate-environment: conda-build
- name: Set Conda Channels
# for some reason, defaults is added when we add our channel
run: |
conda config --add channels https://ska:${{ secrets.CONDA_PASSWORD }}@cxc.cfa.harvard.edu/mta/ASPECT/ska3-conda/${{ github.event.client_payload.channel }}
conda config --add channels conda-forge
conda config --remove channels defaults
conda config --show-sources
- name: Checkout Skare3
uses: actions/checkout@v2
with:
repository: sot/skare3
ref: ${{ github.event.client_payload.skare3_branch }}
path: skare3
- name: ska3-core
shell: bash -l -e {0}
run: |
conda info
conda env update -f skare3/pkg_defs/ska3-core-latest/base_environment.yml
python ./skare3/pkg_defs/ska3-core-latest/install_from_scratch.py
conda list --json > ska3-core-${ARCH}.json
- name: ska3-flight
shell: bash -l -e {0}
run: |
conda info
python ./skare3/pkg_defs/ska3-flight-latest/install_from_scratch.py --ska-channel ${{ github.event.client_payload.channel }}
conda list --json > ska3-flight-${ARCH}.json
- name: ska3-perl
if: ${{ matrix.os != 'windows' }}
shell: bash -l -e {0}
run: |
conda list
conda info
mamba install -y ska3-perl-latest
conda list --json > ska3-perl-${ARCH}.json
- name: patches
shell: bash -l -e {0}
# this fetches only patch instructions, not packages, and does not zip them
run: ./skare3/conda_fetch.py --no-zip --no-packages -o patch_instructions-${ARCH}
- name: Save
uses: actions/upload-artifact@v4
with:
name: json-files-${{ matrix.os }}
path: |
patch_instructions-${{ matrix.os }}/**/*json
ska3-*.json
env:
ARCH: ${{ matrix.os }}
CONDA_PASSWORD: ${{ secrets.CONDA_PASSWORD }}
combine-arch:
runs-on: ubuntu-latest
name: Combine Arch
needs: [generate-json]
steps:
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Checkout Skare3
uses: actions/checkout@v2
with:
repository: sot/skare3
ref: ${{ github.event.client_payload.skare3_branch }}
path: skare3
- name: Get json files
uses: actions/download-artifact@v4.1.7
with:
pattern: json-files-*
path: json
- name: pip
run: python -m pip install jinja2 PyYAML
- name: move
run: |
mv json/json-files-*/* json/
rmdir json/json-files-*
- name: ska3-core
run: |
./skare3/combine_arch_meta.py --name ska3-core --version ${SKA3_VERSION} \
--out pkg_defs/ska3-core/meta.yaml \
--env linux=json/ska3-flight-ubuntu.json \
--env osx=json/ska3-flight-macos.json \
--env win=json/ska3-flight-windows.json \
--not-in skare3/pkg_defs/ska3-flight-latest/meta.yaml \
--exclude ska3-flight
- name: ska3-flight
run: |
./skare3/combine_arch_meta.py --name ska3-flight --version ${SKA3_VERSION} \
--out pkg_defs/ska3-flight/meta.yaml \
--env linux=json/ska3-flight-ubuntu.json \
--env osx=json/ska3-flight-macos.json \
--env win=json/ska3-flight-windows.json \
--in skare3/pkg_defs/ska3-flight-latest/meta.yaml \
--include ska3-core \
--build "noarch: generic"
- name: ska3-perl
run: |
./skare3/combine_arch_meta.py --name ska3-perl --version ${SKA3_VERSION} \
--out pkg_defs/ska3-perl/meta.yaml \
--env linux=json/ska3-perl-ubuntu.json \
--env osx=json/ska3-perl-macos.json \
--subtract-env linux=json/ska3-flight-ubuntu.json \
--subtract-env osx=json/ska3-flight-macos.json \
--build "skip: True # [win]"
- name: patches
shell: bash -l -e {0}
run: |
ls -R json
pip install requests urllib3 tqdm
./skare3/conda_fetch.py --merge-patches --no-zip json/patch_instructions-* \
-o patch_instructions/noarch
cp -fr json/patch_instructions-*/linux-64 patch_instructions/
cp -fr json/patch_instructions-*/osx-arm64 patch_instructions/
cp -fr json/patch_instructions-*/win-64 patch_instructions/
ls -R patch_instructions
- name: Save patches
uses: actions/upload-artifact@v4
with:
name: json-files
path: patch_instructions
- name: Save package
uses: actions/upload-artifact@v4
with:
name: conda-meta-yaml
path: pkg_defs
env:
SKA3_VERSION: ${{ github.event.client_payload.version }}
build-conda:
runs-on: ${{ matrix.os }}-latest
name: Build ${{ matrix.os }} conda meta-packages
needs: [combine-arch]
strategy:
fail-fast: false
matrix:
os: ["ubuntu", "macos", "windows"]
steps:
- name: Get yaml files
uses: actions/download-artifact@v4.1.7
with:
name: conda-meta-yaml
path: pkg_defs
- name: Setup Conda Environment
uses: conda-incubator/setup-miniconda@v3
with:
miniforge-version: latest
python-version: ${{ github.event.client_payload.python_version }}
- name: Checkout Skare3
uses: actions/checkout@v2
with:
repository: sot/skare3
ref: ${{ github.event.client_payload.skare3_branch }}
path: skare3
- name: Setup build environment
shell: bash -l -e {0}
run: |
conda env update -n conda-build -f ./skare3/build-environment.yml
- name: Copy yaml files
shell: bash -l -e {0}
run: |
cp ./pkg_defs/ska3-core/meta.yaml ./skare3/pkg_defs/ska3-core/meta.yaml
cp ./pkg_defs/ska3-flight/meta.yaml ./skare3/pkg_defs/ska3-flight/meta.yaml
cp ./pkg_defs/ska3-perl/meta.yaml ./skare3/pkg_defs/ska3-perl/meta.yaml
- name: Build ska3-flight
shell: bash -l -e {0}
working-directory: ./skare3
run: >
python ./ska_builder.py ska3-flight
- name: Build ska3-core and ska3-perl
shell: bash -l -e {0}
working-directory: ./skare3
run: |
python ./ska_builder.py ska3-core
python ./ska_builder.py ska3-perl
- name: Gather packages
shell: bash -l -e {0}
working-directory: ./skare3
run: |
rm -f builds/*/*json builds/*/*repodata* builds/*/index*
mkdir -p builds/osx-arm64 builds/win-64 builds/linux-64 conda_packages
mv builds/noarch builds/osx-arm64 builds/win-64 builds/linux-64 conda_packages
- name: Save conda packages
uses: actions/upload-artifact@v4
with:
name: conda-package-${{ matrix.os }}
path: skare3/conda_packages