From 13f5ec998b1ae7c03f1429be0c71391e38bd69a3 Mon Sep 17 00:00:00 2001 From: Diego Prada-Gracia Date: Thu, 12 Oct 2023 00:06:36 -0600 Subject: [PATCH] =?UTF-8?q?Primera=20versi=C3=B3n=20de=20la=20automatizaci?= =?UTF-8?q?=C3=B3n=20de=20la=20distribuci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../build_and_upload_conda_packages.yaml | 62 +++++++++++++++++++ devtools/build_env.yaml | 7 +++ devtools/conda-build/build.sh | 3 + devtools/conda-build/meta.yaml | 27 ++++++++ 4 files changed, 99 insertions(+) create mode 100644 .github/workflows/build_and_upload_conda_packages.yaml create mode 100644 devtools/build_env.yaml create mode 100644 devtools/conda-build/build.sh create mode 100644 devtools/conda-build/meta.yaml diff --git a/.github/workflows/build_and_upload_conda_packages.yaml b/.github/workflows/build_and_upload_conda_packages.yaml new file mode 100644 index 0000000..05974c4 --- /dev/null +++ b/.github/workflows/build_and_upload_conda_packages.yaml @@ -0,0 +1,62 @@ +name: Build and upload conda packages + +on: + release: + types: ['released', 'prereleased'] + + workflow_dispatch: + +jobs: + conda_deployment_with_new_tag: + name: Conda deployment of package with Python ${{ matrix.python-version }} + runs-on: ubuntu-latest + strategy: + fail-fast: false # do not cancel all in-progress jobs if any job variation fails + matrix: + #os: ubuntu-latest #[macOS-latest, ubuntu-latest] + python-version: ["3.8", "3.9", "3.10"] # 3.10 with errors + + steps: + + - uses: actions/checkout@v3 + with: + fetch-depth: 0 + + - name: Additional info about the build + shell: bash + run: | + uname -a + + - name: Setup conda env + uses: mamba-org/setup-micromamba@v1 + with: + environment-file: devtools/build_env.yaml + environment-name: build + condarc: | + channels: + - uibcdf + - conda-forge + - defaults + channel_priority: strict + + create-args: >- + python=${{ matrix.python-version }} + + - name: Info conda + shell: bash -l {0} + run: | + micromamba info + micromamba list + + - name: Build and upload the conda packages + uses: uibcdf/action-build-and-upload-conda-packages@v1.2.0 + with: + meta_yaml_dir: devtools/conda-build + python-version: ${{ matrix.python-version }} # Values previously defined in `matrix` + mambabuild: false + user: uibcdf + label: auto + platform_linux-64: true + platform_osx-64: true + platform_win-64: false + token: ${{ secrets.ANACONDA_UIBCDF_TOKEN }} # Replace with the right name of your secret diff --git a/devtools/build_env.yaml b/devtools/build_env.yaml new file mode 100644 index 0000000..2ab2049 --- /dev/null +++ b/devtools/build_env.yaml @@ -0,0 +1,7 @@ +channels: +- uibcdf +- conda-forge +- defaults +dependencies: +- anaconda-client +- conda-build diff --git a/devtools/conda-build/build.sh b/devtools/conda-build/build.sh new file mode 100644 index 0000000..e85061c --- /dev/null +++ b/devtools/conda-build/build.sh @@ -0,0 +1,3 @@ +echo "Building" +$PYTHON -m pip install --no-deps . +echo "Done" diff --git a/devtools/conda-build/meta.yaml b/devtools/conda-build/meta.yaml new file mode 100644 index 0000000..d5ef0c0 --- /dev/null +++ b/devtools/conda-build/meta.yaml @@ -0,0 +1,27 @@ +package: + name: cosmicmuffin + version: "{{ environ['GIT_DESCRIBE_TAG'] }}" +source: + path: ../../ +build: + number: 1 +requirements: + build: + - python + - pip + - setuptools >=61.0 + - versioningit~=2.0 + run: + - python + - pip + - setuptools >=61.0 + - versioningit~=2.0 +about: + home: https://uibcdf.org + license: MIT License + summary: '' + description: 'This is a test library + + ' + dev_url: https://github.com/uibcdf/CosmicMuffin + doc_url: https://uibcdf.org/CosmicMuffin