-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add github action for building packages
copied from pydqed, see: https://github.com/ReactionMechanismGenerator/PyDQED/blob/9377ec27f08a124ada3ef2cb701d48f2383e6693/.github/workflows/build_package.yml
- Loading branch information
1 parent
7766886
commit 4cb219c
Showing
1 changed file
with
74 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
name: Build Package | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
on: | ||
pull_request: | ||
workflow_dispatch: | ||
push: | ||
branches: | ||
- stable | ||
jobs: | ||
build: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-13, macos-latest] | ||
numpy-version: ["1.21", "1.22", "1.23", "1.24", "1.25", "1.26", "2.0"] | ||
python-version: ["3.9", "3.10", "3.11", "3.12"] | ||
exclude: | ||
- numpy-version: "1.21" | ||
python-version: "3.10" | ||
- numpy-version: "1.21" | ||
python-version: "3.11" | ||
- numpy-version: "1.22" | ||
python-version: "3.11" | ||
- numpy-version: "1.21" | ||
python-version: "3.12" | ||
- numpy-version: "1.22" | ||
python-version: "3.12" | ||
- numpy-version: "1.23" | ||
python-version: "3.12" | ||
- numpy-version: "1.24" | ||
python-version: "3.12" | ||
- numpy-version: "1.25" | ||
python-version: "3.12" | ||
runs-on: ${{ matrix.os }} | ||
name: Build ${{ matrix.os }} Python ${{ matrix.python-version }} Numpy ${{ matrix.numpy-version }} | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Setup Conda | ||
uses: conda-incubator/setup-miniconda@v3 | ||
with: | ||
auto-update-conda: false | ||
conda-solver: libmamba | ||
auto-activate-base: true | ||
activate-environment: "" | ||
- name: Install Build Tools | ||
run: conda install python anaconda-client conda-build | ||
- name: Configure Auto-Upload | ||
if: github.ref == 'refs/heads/stable' | ||
run: | | ||
conda config --set anaconda_upload yes | ||
- name: Build Binary | ||
run: | | ||
# set a default value to the conda_token if needed (like from forks) | ||
: "${CONDA_TOKEN:=${{ secrets.ANACONDA_TOKEN }}}" | ||
: "${CONDA_TOKEN:=default_value}" | ||
echo "CONDA_TOKEN=$CONDA_TOKEN" >> $GITHUB_ENV | ||
conda config --add channels conda-forge | ||
CONDA_NPY=${{ matrix.numpy-version }} CONDA_PY=${{ matrix.python-version }} conda build --token $CONDA_TOKEN --user rmg . | ||
result: | ||
if: ${{ always() }} | ||
runs-on: ubuntu-latest | ||
name: Final Results | ||
needs: [build] | ||
steps: | ||
- run: exit 1 | ||
# see https://github.com/orgs/community/discussions/26822?sort=new#discussioncomment-8285141 | ||
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }} |