Merge pull request #258 from cyrillemidingoyi/newb #226
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: build_publish_anaconda | |
on: | |
push: | |
branches: [ master ] | |
pull_request: | |
branches: [ master ] | |
jobs: | |
build-and-publish: | |
name: ${{ matrix.os }}, Python 3.${{ matrix.python-minor-version }} for conda deployment | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
max-parallel: 3 | |
matrix: | |
os: [ macos-13, windows-latest, ubuntu-latest] | |
python-minor-version: [7, 8, 9] | |
isMaster: | |
- ${{ github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/dev') }} | |
exclude: | |
- isMaster: false | |
os: ubuntu-latest | |
python-minor-version: 8 | |
- isMaster: false | |
os: ubuntu-latest | |
python-minor-version: 9 | |
- isMaster: false | |
os: macos-13 | |
python-minor-version: 8 | |
- isMaster: false | |
os: macos-13 | |
python-minor-version: 9 | |
- isMaster: false | |
os: windows-latest | |
python-minor-version: 8 | |
- isMaster: false | |
os: windows-latest | |
python-minor-version: 9 | |
steps: | |
- name: Chekout | |
uses: actions/checkout@v3 | |
- name: Determine publish | |
uses: haya14busa/action-cond@v1 | |
id: publish | |
with: | |
cond: ${{ contains(github.ref, 'master') || startsWith(github.ref, 'refs/heads/v') }} | |
if_true: 'true' | |
if_false: 'false' | |
- name: Determine NumPy Version | |
id: set-numpy | |
run: | | |
if [[ "${{ matrix.python-minor-version }}" == "3.7" ]]; then | |
echo "numpy-version=1.16.6" >> $GITHUB_ENV | |
elif [[ "${{ matrix.python-minor-version }}" == "3.8" ]]; then | |
echo "numpy-version=1.22.4" >> $GITHUB_ENV | |
elif [[ "${{ matrix.python-minor-version }}" == "3.9" ]]; then | |
echo "numpy-version=2.0.2" >> $GITHUB_ENV | |
else | |
echo "Unsupported Python version" | |
exit 1 | |
fi | |
- name: Build and Publish | |
uses: openalea/action-build-publish-anaconda@main | |
with: | |
conda: conda | |
mamba: true | |
numpy: ${{ env.numpy-version }} | |
python: ${{ matrix.python-minor-version }} | |
channels: amei, openalea3, conda-forge | |
token: ${{ secrets.ANACONDA_TOKEN }} | |
publish: ${{ steps.publish.outputs.value }} | |
label: main |