Skip to content

split and modify mmg conda YAML#98

Open
chemiskyy wants to merge 4 commits intomainfrom
update_mmg_conda
Open

split and modify mmg conda YAML#98
chemiskyy wants to merge 4 commits intomainfrom
update_mmg_conda

Conversation

@chemiskyy
Copy link
Member

No description provided.

@kmarchais
Copy link
Member

I understand that the previous single file was not ideal but I am wondering if it doesn't impact the maintainability to have four different files for this.

Maybe we could refactor the single file to be more maintainable?
Here is an example generated by a LLM.

name: Create conda package for mmg

on:
  workflow_dispatch:

jobs:
  build_and_upload:
    name: Build on ${{ matrix.os }} (${{ matrix.conda_platform }})
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        include:
          - os: ubuntu-latest
            conda_platform: linux-64
          - os: macos-13
            conda_platform: osx-64
          - os: macos-latest
            conda_platform: osx-arm64
          - os: windows-latest
            conda_platform: win-64

    steps:
      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Setup Miniconda
        uses: conda-incubator/setup-miniconda@v3
        with:
          miniconda-version: "latest"
          activate-environment: packaging

      - name: Install dependencies and login to Anaconda
        run: |
          conda install python=3.9 conda-build anaconda-client --yes --quiet
          anaconda logout
          anaconda login --username ${{ secrets.ANACONDA_USERNAME }} --password ${{ secrets.ANACONDA_PASSWORD }}

      - name: Build conda package
        run: |
          conda-build mmg.recipe -c conda-forge -c set3mah --output-folder .

      - name: Upload conda package
        run: |
          anaconda upload ${{ matrix.conda_platform }}/*.tar.bz2 --force

@chemiskyy
Copy link
Member Author

You are right we can generate a matrix, I will update the file accordingly

Remove separate OS-specific packaging workflows and replace them with a single matrix-based mmg-packaging.yml. Deleted mmg-osx-arm64.yml, mmg-packaging-linux.yml, mmg-packaging-osx-64.yml, and mmg-windows.yml and added matrix entries for Linux, macOS x64, macOS ARM64, and Windows. Unified Conda setup (setup-miniconda@v3), conditional CONDA_SUBDIR configuration, dependency installation, conda-build invocation, and artifact upload using ANACONDA_API_TOKEN and matrix.subdir to reduce duplication and centralize packaging logic.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants