Skip to content

Commit

Permalink
Changing actions to trigger on tag v* because
Browse files Browse the repository at this point in the history
release please release creation does
not trigger the workflows
  • Loading branch information
lachlangrose committed Oct 16, 2024
1 parent fe0387f commit 8f84b99
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 93 deletions.
83 changes: 42 additions & 41 deletions .github/workflows/conda.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,42 @@
name: Build conda packages

on:
release:
types: [released]
workflow_dispatch:

jobs:
build_wheels:
name: Build wheels on
runs-on: "ubuntu-latest"
strategy:
fail-fast: false
matrix:
python-version: ${{ fromJSON(vars.PYTHON_VERSIONS)}}
steps:
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}

- uses: actions/checkout@v4
- name: update submodules
# shell: bash -l {0}
run: |
git submodule update --init --recursive
- name: Conda build
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
shell: bash -l {0}
run: |
conda install -c conda-forge conda-build scikit-build-core numpy cython anaconda-client conda-libmamba-solver -y
conda build -c conda-forge -c loop3d --output-folder conda conda --python ${{matrix.python-version}}
conda convert -p all conda/linux-64/*.tar.bz2 -f -o conda
anaconda upload --label main conda/*/*.tar.bz2
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: conda-build-${{ matrix.python-version }}
path: conda
name: Build conda packages

on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:

jobs:
build_wheels:
name: Build wheels on
runs-on: "ubuntu-latest"
strategy:
fail-fast: false
matrix:
python-version: ${{ fromJSON(vars.PYTHON_VERSIONS)}}
steps:
- uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}

- uses: actions/checkout@v4
- name: update submodules
# shell: bash -l {0}
run: |
git submodule update --init --recursive
- name: Conda build
env:
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
shell: bash -l {0}
run: |
conda install -c conda-forge conda-build scikit-build-core numpy cython anaconda-client conda-libmamba-solver -y
conda build -c conda-forge -c loop3d --output-folder conda conda --python ${{matrix.python-version}}
conda convert -p all conda/linux-64/*.tar.bz2 -f -o conda
anaconda upload --label main conda/*/*.tar.bz2
- name: upload artifacts
uses: actions/upload-artifact@v4
with:
name: conda-build-${{ matrix.python-version }}
path: conda
105 changes: 53 additions & 52 deletions .github/workflows/pypi.yml
Original file line number Diff line number Diff line change
@@ -1,52 +1,53 @@
name: Build

on:
release:
types: [released]
workflow_dispatch:
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
CIBW_BUILD: ${{ vars.CIBW_BUILD }}
strategy:
matrix:
os: ${{ fromJSON(vars.BUILD_OS)}}

steps:
- uses: actions/checkout@v4

# Used to host cibuildwheel
- uses: actions/setup-python@v5

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.21.2


- name: build
run: python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
publish:
name: Publish wheels to pypi
runs-on: ubuntu-latest
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
needs: build_wheels
steps:
- uses: actions/download-artifact@v4
with:
path: wheelhouse
- name: copy to wheelhouse
run: |
mkdir wheels
cp -r wheelhouse/*/*.whl wheels
- uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
verbose: true
packages-dir: wheels/
name: Build

on:
push:
tags:
- 'v*.*.*'
workflow_dispatch:
jobs:
build_wheels:
name: Build wheels on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
env:
CIBW_BUILD: ${{ vars.CIBW_BUILD }}
strategy:
matrix:
os: ${{ fromJSON(vars.BUILD_OS)}}

steps:
- uses: actions/checkout@v4

# Used to host cibuildwheel
- uses: actions/setup-python@v5

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.21.2


- name: build
run: python -m cibuildwheel --output-dir wheelhouse
- uses: actions/upload-artifact@v4
with:
name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }}
path: ./wheelhouse/*.whl
publish:
name: Publish wheels to pypi
runs-on: ubuntu-latest
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
needs: build_wheels
steps:
- uses: actions/download-artifact@v4
with:
path: wheelhouse
- name: copy to wheelhouse
run: |
mkdir wheels
cp -r wheelhouse/*/*.whl wheels
- uses: pypa/gh-action-pypi-publish@release/v1
with:
skip-existing: true
verbose: true
packages-dir: wheels/

0 comments on commit 8f84b99

Please sign in to comment.