Skip to content

Commit

Permalink
Merge branch 'main' into 1.0.0_alpha
Browse files Browse the repository at this point in the history
  • Loading branch information
jcapriot committed Oct 24, 2024
2 parents c66f892 + 40501f0 commit ab960ed
Show file tree
Hide file tree
Showing 84 changed files with 3,094 additions and 2,561 deletions.
55 changes: 29 additions & 26 deletions .ci/azure/deploy.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,18 @@
jobs:
- job:
displayName: "Deploy Docs and source"
displayName: "Deploy Docs"
pool:
vmImage: ubuntu-latest

steps:
# No need to checkout the repo here!
- checkout: none

# Just download all of the items already built
- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: 'wheels'
targetPath: 'dist'

- task: DownloadPipelineArtifact@2
inputs:
buildType: 'current'
artifactName: 'source_dist'
targetPath: 'dist'
- bash: |
echo $IS_TAG
echo $IS_MAIN
echo $BRANCH_NAME
displayName: Report branch parameters
- task: DownloadPipelineArtifact@2
inputs:
Expand All @@ -27,8 +21,8 @@ jobs:
targetPath: 'html'

- bash: |
ls -l dist
ls -l html
displayName: Report downloaded cache contents.
- bash: |
git config --global user.name ${GH_NAME}
Expand All @@ -39,25 +33,34 @@ jobs:
GH_NAME: $(gh.name)
GH_EMAIL: $(gh.email)
# upload documentation to discretize-docs gh-pages on tags
- bash: |
twine upload --skip-existing dist/*
displayName: Deploy source and wheels
git clone -q --branch gh-pages --depth 1 https://${GH_TOKEN}@github.com/simpeg/discretize-docs.git
displayName: Checkout doc repository
env:
TWINE_USERNAME: $(twine.username)
TWINE_PASSWORD: $(twine.password)
GH_TOKEN: $(gh.token)
# upload documentation to discretize-docs gh-pages on tags
- bash: |
git clone --depth 1 https://${GH_TOKEN}@github.com/simpeg/discretize-docs.git
cd discretize-docs
git gc --prune=now
git remote prune origin
rm -rf en/main/*
cp -r html/* en/main/
rm -rf "en/$BRANCH_NAME"
mv ../html "en/$BRANCH_NAME"
touch .nojekyll
git add .
displayName: Set Doc Folder
- bash: |
# Update latest symlink
cd discretize-docs
rm -f en/latest
ln -s "en/$BRANCH_NAME" en/latest
displayName: Point Latest to tag
condition: eq(variables.IS_TAG, true)
- bash: |
# Commit and push
cd discretize-docs
git add --all
git commit -am "Azure CI commit ref $(Build.SourceVersion)"
git push
displayName: Push documentation to discretize-docs
env:
GH_TOKEN: $(gh.token)
GH_TOKEN: $(gh.token)
4 changes: 2 additions & 2 deletions .ci/azure/docs.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
jobs:
- job:
- job: BuildDocs
displayName: "Build Documentation"
pool:
vmImage: ubuntu-latest
Expand Down Expand Up @@ -33,4 +33,4 @@ jobs:
inputs:
targetPath: 'docs/_build/html'
artifact: 'html_docs'
parallel: true
parallel: true
1 change: 0 additions & 1 deletion .ci/azure/setup_env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ do_doc=$(echo "${DOC_BUILD:-false}" | tr '[:upper:]' '[:lower:]')

if ${is_azure}
then
conda update --yes -n base conda
if ${do_doc}
then
.ci/setup_headless_display.sh
Expand Down
15 changes: 15 additions & 0 deletions .ci/azure/setup_miniconda_macos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/bash
set -ex #echo on and exit if any line fails

echo "arch is $ARCH"
if [[ $ARCH == "X64" ]]; then
MINICONDA_ARCH_LABEL="x86_64"
else
MINICONDA_ARCH_LABEL="arm64"
fi
echo $MINICONDA_ARCH_LABEL
mkdir -p ~/miniconda3
curl https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-$MINICONDA_ARCH_LABEL.sh -o ~/miniconda3/miniconda.sh
bash ~/miniconda3/miniconda.sh -b -u -p ~/miniconda3
rm ~/miniconda3/miniconda.sh
echo "##vso[task.setvariable variable=CONDA;]${HOME}/miniconda3"
9 changes: 5 additions & 4 deletions .ci/azure/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,16 @@ jobs:
vmImage: $(image)
variables:
varOS: $(Agent.OS)
ARCH: $(Agent.OSArchitecture)
steps:
- bash: .ci/azure/setup_miniconda_macos.sh
displayName: Install miniconda on mac
condition: eq(variables.varOS, 'Darwin')

- bash: echo "##vso[task.prependpath]$CONDA/bin"
displayName: Add conda to PATH
condition: ne(variables.varOS, 'Windows_NT')

- bash: sudo chown -R $USER $CONDA
displayName: Take ownership of conda directory
condition: eq(variables.varOS, 'Darwin')

- powershell: Write-Host "##vso[task.prependpath]$env:CONDA\Scripts"
displayName: Add conda to PATH
condition: eq(variables.varOS, 'Windows_NT')
Expand Down
63 changes: 0 additions & 63 deletions .ci/azure/wheels.yml

This file was deleted.

6 changes: 4 additions & 2 deletions .ci/environment_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,23 @@ channels:
dependencies:
- numpy>=1.22.4
- scipy>=1.8

# optionals
- vtk>=6
- pyvista
- omf
- matplotlib

# documentation
- sphinx
- pydata-sphinx-theme==0.13.3
- pydata-sphinx-theme==0.15.4
- sphinx-gallery>=0.1.13
- numpydoc>=1.5
- jupyter
- graphviz
- pymatsolver>=0.1.2
- pillow
- pooch

# testing
- sympy
- pytest
Expand Down
67 changes: 67 additions & 0 deletions .github/workflows/build_distributions.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Build Distribution artifacts

on: [push, pull_request]

jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
# macos-13 is an intel runner, macos-14 is apple silicon
os: [ubuntu-latest, windows-latest, macos-13, macos-14]

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Build wheels
uses: pypa/[email protected]
# env:
# CIBW_SOME_OPTION: value
# ...
# with:
# package-dir: .
# output-dir: wheelhouse
# config-file: "{package}/pyproject.toml"

- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl

build_sdist:
name: Build source distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Build sdist
run: pipx run build --sdist

- uses: actions/upload-artifact@v4
with:
name: cibw-sdist
path: dist/*.tar.gz

upload_pypi:
needs: [build_wheels, build_sdist]
runs-on: ubuntu-latest
environment: pypi
permissions:
id-token: write
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
steps:
- uses: actions/download-artifact@v4
with:
# unpacks all CIBW artifacts into dist/
pattern: cibw-*
path: dist
merge-multiple: true

- uses: pypa/gh-action-pypi-publish@release/v1
# with:
# To test: repository-url: https://test.pypi.org/legacy/
27 changes: 8 additions & 19 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ pr:
exclude:
- '*no-ci*'

variables:
BRANCH_NAME: $(Build.SourceBranchName)
IS_TAG: $[startsWith(variables['Build.SourceBranch'], 'refs/tags/')]
IS_MAIN: $[eq(variables['Build.SourceBranch'], 'refs/heads/main')]

stages:
- stage: StyleChecks
displayName: "Style Checks"
Expand All @@ -31,28 +36,12 @@ stages:
jobs:
- template: .ci/azure/docs.yml

- stage: BuildWheels
dependsOn:
- Testing
- DocBuild
displayName: "Build Wheels"
jobs:
- template: .ci/azure/wheels.yml

- stage: BuildSource
- stage: Deploy
displayName: "Deploy Docs"
dependsOn:
- Testing
- DocBuild
displayName: "Build Source distribution"
jobs:
- template: .ci/azure/sdist.yml

- stage: Deploy
displayName: "Deploy Source, Wheels, and Docs"
dependsOn:
- BuildWheels
- BuildSource
condition: and(succeeded(), startsWith(variables['build.sourceBranch'], 'refs/tags/'))
condition: and(succeeded(), or(eq(variables.IS_TAG, true), eq(variables.IS_MAIN, true)))
jobs:
- template: .ci/azure/deploy.yml

Expand Down
Loading

0 comments on commit ab960ed

Please sign in to comment.