Skip to content

Commit

Permalink
Use ramber-build for building conda packages
Browse files Browse the repository at this point in the history
  • Loading branch information
mittagessen committed Apr 21, 2024
1 parent 1c6186a commit adaec33
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 46 deletions.
68 changes: 34 additions & 34 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
python-version: [3.8, 3.9, '3.10', '3.11']

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies and kraken
Expand All @@ -39,11 +39,11 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Build a binary wheel and a source tarball
Expand All @@ -68,55 +68,55 @@ jobs:
if: startsWith(github.ref, 'refs/tags/')

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: conda-incubator/setup-miniconda@v2
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: 3.9
miniforge-variant: Mambaforge
- name: install dependencies build
shell: bash -l {0}
run: mamba install "conda-build>=3.20" colorama pip ruamel ruamel.yaml rich jsonschema conda-verify anaconda-client mamba
run: mamba install colorama pip ruamel ruamel.yaml rich jsonschema conda-verify anaconda-client
# Runs the action with the following inputs or defaults if not specified.
- name: install boa
shell: bash -l {0}
run: pip install https://github.com/mamba-org/boa/archive/refs/tags/0.14.0.zip
- name: validate recipe
shell: bash -l {0}
id: conda_validation
run: |
PACKAGE_PATHS=$(conda mambabuild . --output --check -c conda-forge | tail -n 1)
echo "package_paths=$PACKAGE_PATHS" >> $GITHUB_OUTPUT
- name: run build
shell: bash -l {0}
run: conda mambabuild . -c conda-forge
- name: convert packages
shell: bash -l {0}
run: |
conda convert -p osx-arm64 -p osx-64 -o conda_convert ${{ steps.conda_validation.outputs.package_paths }}
mkdir conda_convert/linux-64
cp -f ${{ steps.conda_validation.outputs.package_paths }} conda_convert/linux-64
- name: upload to anaconda
shell: bash -l {0}
run: anaconda -t ${{ secrets.ANACONDA_TOKEN }} upload --no-progress --force conda_convert/*/*
- name: Build linux-64 conda package
uses: prefix-dev/[email protected]
with:
recipe-path: "conda/recipe.yaml"
build-args: "--experimental --target-platform linux-64"
- name: Build osx-64 conda package
uses: prefix-dev/[email protected]
with:
recipe-path: "conda/recipe.yaml"
build-args: "--experimental --target-platform osx-64"
- name: Build osx-arm64 conda package
uses: prefix-dev/[email protected]
with:
recipe-path: "conda/recipe.yaml"
build-args: "--experimental --target-platform osx-arm64"
- name: Upload conda package
- run: |
for pkg in $(find output -type f \( -name "*.conda" -o -name "*.tar.bz2" \) ); do
echo "Uploading ${pkg}"
rattler-build upload anaconda -o mittagessen -a ${{ secrets.ANACONDA_TOKEN }} "${pkg}"
done
- name: Upload conda artifacts to GH storage
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: conda_packages
path: conda_convert/*/*.tar.bz2
path: output/*/*.conda

autodraft-gh-release:
name: Create github release
needs: [build-n-publish-anaconda, build-n-publish-pypi]
runs-on: ubuntu-latest

steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: conda_packages
path: conda
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: pypi_packages
path: pypi
Expand All @@ -138,11 +138,11 @@ jobs:
startsWith(github.ref, 'refs/tags/')
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.9
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install sphinx-multiversion
Expand Down
1 change: 0 additions & 1 deletion conda/build.sh

This file was deleted.

4 changes: 0 additions & 4 deletions conda/conda_build_config.yaml

This file was deleted.

28 changes: 21 additions & 7 deletions conda/meta.yaml → conda/recipe.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
context:
git_url: .
git_tag: ${{ git.latest_tag(git_url) }}

package:
name: kraken
version: {{ GIT_DESCRIBE_TAG }}
version: ${{ git_tag }}

source:
git_url: ..
git: ${{ git_url }}
tag: ${{ git_tag }}

build:
script: pip install --no-deps .

requirements:
build:
- python
- setuptools
- pbr
- python>=3.8,<3.12
- setuptools
- pbr
host:
- python>=3.8,<3.12
run:
- python>=3.8,<3.12
- python-bidi
- lxml
- regex
Expand All @@ -35,7 +46,10 @@ requirements:
- conda-forge::threadpoolctl~=3.4.0
- albumentations
- rich

about:
home: https://kraken.re
license: APACHE
homepage: https://kraken.re
license: Apache-2.0
summary: 'OCR/HTR engine for all the languages'
repository: https://github.com/mittagessen/kraken
documentation: https://kraken.re

0 comments on commit adaec33

Please sign in to comment.