Refactor data compilation logic and optimize imports #18
This file contains 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: Publish to Conda | |
on: | |
push: | |
branches: | |
- '**' | |
workflow_dispatch: | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
shell: bash -l {0} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Set up Conda | |
uses: conda-incubator/setup-miniconda@v2 | |
with: | |
python-version: "3.10" | |
channels: conda-forge,defaults | |
channel-priority: strict | |
activate-environment: build-env | |
- name: Install dependencies | |
run: | | |
conda install conda-build anaconda-client boa -c conda-forge | |
conda info | |
conda list | |
- name: Create conda recipe | |
run: | | |
mkdir -p conda-recipe | |
cat > conda-recipe/meta.yaml << 'EOF' | |
{% set name = "micromet" %} | |
{% set version = "0.5.0" %} | |
package: | |
name: {{ name|lower }} | |
version: {{ version }} | |
source: | |
path: .. | |
build: | |
number: 0 | |
noarch: python | |
script: "{{ PYTHON }} -m pip install . --no-deps -vv" | |
requirements: | |
host: | |
- python >=3.8 | |
- pip | |
run: | |
- python >=3.8 | |
- numpy | |
# Add other dependencies here | |
about: | |
home: https://github.com/yourusername/MicroMet | |
license: MIT | |
summary: 'MicroMet package' | |
EOF | |
- name: Build conda package | |
run: | | |
GIT_HASH=$(git rev-parse --short HEAD) | |
echo "GIT_HASH=$GIT_HASH" >> $GITHUB_ENV | |
conda mambabuild conda-recipe --output-folder ./conda-dist/ | |
- name: Publish to Conda | |
if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' | |
env: | |
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} | |
run: | | |
anaconda upload --force ./conda-dist/**/*.tar.bz2 |