Merge pull request #22 from maxiv-science/rocky8-runner #186
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Python Package using Conda (Miniforge + Rocky Linux) | |
| on: [push] | |
| jobs: | |
| build-linux-oldglibc: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - name: Prepare output folder | |
| run: mkdir -p ${{ github.workspace }}/conda-bld | |
| - name: Build conda package inside Rocky Linux 8 container | |
| run: | | |
| docker run --rm \ | |
| -v ${{ github.workspace }}:/workdir \ | |
| -w /workdir \ | |
| rockylinux:8 /bin/bash -c " | |
| dnf install -y epel-release && \ | |
| dnf install -y git wget bzip2 make gcc gcc-c++ python3 python3-pip && \ | |
| wget https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh -O miniconda.sh && \ | |
| bash miniconda.sh -b -p /opt/conda && \ | |
| rm miniconda.sh && \ | |
| export PATH=/opt/conda/bin:\$PATH && \ | |
| conda config --remove channels defaults || true && \ | |
| conda config --add channels conda-forge && \ | |
| conda config --set channel_priority strict && \ | |
| conda install -y mamba conda-build boa setuptools_scm git && \ | |
| export SETUPTOOLS_SCM_PRETEND_VERSION=\$(python -m setuptools_scm) && \ | |
| echo \"Version: \$SETUPTOOLS_SCM_PRETEND_VERSION\" && \ | |
| conda mambabuild conda-recipe --output-folder=/workdir/conda-bld | |
| " | |
| - name: Upload built Linux packages | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: package-linux-oldglibc | |
| path: | | |
| ${{ github.workspace }}/conda-bld/**/azint*.bz2 | |
| ${{ github.workspace }}/conda-bld/**/azint*.conda | |
| build-win: | |
| runs-on: windows-2022 | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - uses: ilammy/msvc-dev-cmd@v1 | |
| - uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| miniforge-version: latest | |
| channels: conda-forge | |
| channel-priority: strict | |
| conda-remove-defaults: true | |
| - name: Configure conda channels | |
| shell: pwsh | |
| run: | | |
| conda config --remove channels defaults || echo "No defaults channel found" | |
| conda config --add channels defaults | |
| conda config --add channels conda-forge | |
| conda config --set channel_priority strict | |
| - name: Install conda-build and dependencies | |
| shell: pwsh | |
| run: conda install -y mamba conda-build setuptools_scm boa git | |
| - name: Build package | |
| shell: pwsh | |
| run: | | |
| $env:SETUPTOOLS_SCM_PRETEND_VERSION = $(python -m setuptools_scm) | |
| Write-Host "Version: $env:SETUPTOOLS_SCM_PRETEND_VERSION" | |
| conda mambabuild "$env:GITHUB_WORKSPACE/conda-recipe" --output-folder="$env:GITHUB_WORKSPACE" | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: package-win | |
| path: | | |
| ${{ github.workspace }}/**/*.bz2 | |
| ${{ github.workspace }}/**/*.conda | |
| build-macos: | |
| runs-on: macos-14 | |
| timeout-minutes: 30 | |
| strategy: | |
| matrix: | |
| arch: [x86_64, arm64] | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 0 | |
| - uses: conda-incubator/setup-miniconda@v3 | |
| with: | |
| miniforge-version: latest | |
| architecture: ${{ matrix.arch }} | |
| channels: conda-forge | |
| channel-priority: strict | |
| conda-remove-defaults: true | |
| - name: Configure conda channels | |
| shell: bash -l {0} | |
| run: | | |
| conda config --remove channels defaults || true | |
| conda config --add channels defaults | |
| conda config --add channels conda-forge | |
| conda config --set channel_priority strict | |
| - name: Install conda-build | |
| shell: bash -l {0} | |
| run: conda install -y mamba conda-build setuptools_scm boa git | |
| - name: Build package | |
| shell: bash -l {0} | |
| run: | | |
| export SETUPTOOLS_SCM_PRETEND_VERSION=$(python -m setuptools_scm) | |
| echo "Version: $SETUPTOOLS_SCM_PRETEND_VERSION" | |
| conda mambabuild $GITHUB_WORKSPACE/conda-recipe --output-folder=$GITHUB_WORKSPACE | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: package-macos-${{ matrix.arch }} | |
| path: | | |
| ${{ github.workspace }}/**/*.bz2 | |
| ${{ github.workspace }}/**/*.conda |