Skip to content

Commit

Permalink
Update build
Browse files Browse the repository at this point in the history
  • Loading branch information
hoxbro committed Jun 21, 2024
1 parent 8e201eb commit 553d79b
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 52 deletions.
80 changes: 28 additions & 52 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ env:
PACKAGE: "geoviews"
PYTHON_VERSION: "3.11"
NODE_VERSION: "20"
MPLBACKEND: "Agg"
SETUPTOOLS_ENABLE_FEATURES: "legacy-editable"

jobs:
waiting_room:
Expand All @@ -33,36 +31,29 @@ jobs:
steps:
- run: echo "All builds have finished, have been approved, and ready to publish"

pixi_lock:
name: Pixi lock
runs-on: ubuntu-latest
steps:
- uses: holoviz-dev/holoviz_tasks/pixi_lock@pixi

conda_build:
name: Build Conda
needs: [pixi_lock]
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: "100"
- name: Fetch unshallow
run: git fetch --prune --tags --unshallow -f
- uses: conda-incubator/setup-miniconda@v3
with:
miniconda-version: "latest"
- uses: actions/setup-node@v4
- uses: holoviz-dev/holoviz_tasks/pixi_install@pixi
with:
node-version: ${{ env.NODE_VERSION }}
- name: conda setup
run: |
conda install -y conda-build build pyct
environments: "build"
install: false
download-data: false
- name: conda build
run: |
source ./scripts/conda/build.sh
echo "CONDA_FILE="$CONDA_PREFIX/conda-bld/noarch/$PACKAGE-$VERSION-py_0.tar.bz2"" >> $GITHUB_ENV
echo "CONDA_CORE_FILE="$CONDA_PREFIX/conda-bld/noarch/$PACKAGE-core-$VERSION-py_0.tar.bz2"" >> $GITHUB_ENV
run: pixi run -e build build-conda
- uses: actions/upload-artifact@v4
if: always()
with:
name: conda
path: |
${{ env.CONDA_FILE }}
${{ env.CONDA_CORE_FILE }}
path: dist/*.tar.bz2
if-no-files-found: error

conda_publish:
Expand Down Expand Up @@ -99,24 +90,16 @@ jobs:
pip_build:
name: Build PyPI
needs: [pixi_lock]
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: "100"
- name: Fetch unshallow
run: git fetch --prune --tags --unshallow -f
- uses: actions/setup-python@v5
- uses: holoviz-dev/holoviz_tasks/pixi_install@pixi
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Install build
run: |
python -m pip install build
environments: "build"
install: false
download-data: false
- name: Build package
run: python -m build .
run: pixi run -e build build-pip
- uses: actions/upload-artifact@v4
if: always()
with:
Expand Down Expand Up @@ -160,35 +143,28 @@ jobs:

npm_build:
name: Build NPM
needs: [pixi_lock]
runs-on: "ubuntu-latest"
steps:
- uses: actions/checkout@v4
with:
fetch-depth: "100"
- uses: actions/setup-python@v5
- uses: holoviz-dev/holoviz_tasks/pixi_install@pixi
with:
python-version: ${{ env.PYTHON_VERSION }}
- uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}
- name: Fetch unshallow
run: git fetch --prune --tags --unshallow -f
- name: package install
run: |
python -m pip install -ve .
environments: "build"
download-data: false
- name: npm build
run: |
cd ${{ env.PACKAGE }}
TARBALL=$(npm pack .)
TARBALL=$(pixi run build-npm)
echo "TARBALL=$TARBALL" >> $GITHUB_ENV
- name: npm publish dry-run
run: |
cd $PACKAGE
npm publish --dry-run $TARBALL
cd ..
- uses: actions/upload-artifact@v4
if: always()
with:
name: npm
if-no-files-found: error
path: ${{ env.PACKAGE }}/${{ env.TARBALL }}
path: ./${{ env.PACKAGE }}/${{ env.TARBALL }}

npm_publish:
name: Publish NPM
Expand Down
1 change: 1 addition & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ conda-build = "*"
[feature.build.tasks]
build-conda = 'bash scripts/conda/build.sh'
build-pip = 'python -m build .'
build-npm = { cmd = "npm pack .", cwd = "geoviews" }

# =============================================
# =================== LINT ====================
Expand Down

0 comments on commit 553d79b

Please sign in to comment.