From 98a54640b49c88f018ce785bb92020ccd9feadc8 Mon Sep 17 00:00:00 2001 From: David Turner Date: Mon, 4 Apr 2022 13:47:50 -0400 Subject: [PATCH 1/9] small change to test CI on master. --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 2aa348d3..5af4ff67 100644 --- a/setup.py +++ b/setup.py @@ -23,6 +23,7 @@ long_description = f.read() + ext_modules = [ Extension( 'brainiak.factoranalysis.tfa_extension', From 52719e775f387691d36282bb6ae9d810ccd80e4b Mon Sep 17 00:00:00 2001 From: David Turner Date: Mon, 4 Apr 2022 14:38:03 -0400 Subject: [PATCH 2/9] Update main.yml run workflow on push --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 24cec168..d34cbbe8 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,4 +1,4 @@ -on: [pull_request] +on: [pull_request, push] jobs: pypi: env: From d243fb5b432826ec7c3b1ebbd7ae4468a8466fbd Mon Sep 17 00:00:00 2001 From: Dave Turner Date: Tue, 26 Nov 2024 11:48:30 -0500 Subject: [PATCH 3/9] pip install the anaconda client. --- .github/workflows/cd.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 718c4c26..9d7fd94d 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -181,7 +181,7 @@ jobs: permissions: id-token: write runs-on: ubuntu-latest - if: github.event_name == 'release' && github.event.action == 'published' +# if: github.event_name == 'release' && github.event.action == 'published' steps: - uses: actions/download-artifact@v4 @@ -193,6 +193,9 @@ jobs: - name: List files in artifact run: find conda-packages -type f -name "*.tar.bz2" + - name: Install Anaconda CLI + run: pip install anaconda-client + - name: Upload to Anaconda run: | export ANACONDA_API_TOKEN=${{ secrets.ANACONDA_TOKEN }} From fa8643c044a199ce237542f406c48d0976b3dc69 Mon Sep 17 00:00:00 2001 From: Dave Turner Date: Tue, 26 Nov 2024 11:51:29 -0500 Subject: [PATCH 4/9] Fix upload script. --- .github/workflows/cd.yml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 9d7fd94d..3a5c54a6 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -198,6 +198,10 @@ jobs: - name: Upload to Anaconda run: | + set -e # Exit immediately if any command exits with a non-zero status export ANACONDA_API_TOKEN=${{ secrets.ANACONDA_TOKEN }} - find conda-packages -type f -name "*.tar.bz2" -exec anaconda upload {} \; + for file in $(find conda-packages -type f -name "*.tar.bz2"); do + echo "Uploading $file" + anaconda upload "$file" + done From f56a7c29e5b5ed460e9ec861d9e2edaf999c542d Mon Sep 17 00:00:00 2001 From: Dave Turner Date: Tue, 26 Nov 2024 11:57:12 -0500 Subject: [PATCH 5/9] Disable stuff to test upload on my fork. --- .github/workflows/cd.yml | 187 ++++++++++++++++++++------------------- 1 file changed, 97 insertions(+), 90 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 3a5c54a6..0dcd382a 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -1,13 +1,17 @@ name: wheels and conda on: - workflow_dispatch: - release: - types: - - published pull_request: - paths: - - .github/workflows/cd.yml + push: + +#on: +# workflow_dispatch: +# release: +# types: +# - published +# pull_request: +# paths: +# - .github/workflows/cd.yml concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -35,66 +39,66 @@ jobs: name: cibw-sdist path: dist/*.tar.gz - build_wheels: - name: Wheel on ${{ matrix.os }} - runs-on: ${{ matrix.os }} - strategy: - matrix: - os: [ubuntu-latest, windows-latest, macos-13, macos-14] - fail-fast: true - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - # Use intel mpi on windows - - uses: mpi4py/setup-mpi@v1 - if: ${{ contains(matrix.os, 'windows') }} - with: - mpi: msmpi - - # Else, use the default for the OS and setup-mpi action - - uses: mpi4py/setup-mpi@v1 - if: ${{ !contains(matrix.os, 'windows') }} - - - name: Checkout LLVM on macOS - if: runner.os == 'macOS' - uses: actions/checkout@v4 - with: - repository: llvm/llvm-project - ref: release/18.x - path: llvm-project - - - name: Build OpenMP on macOS - if: runner.os == 'macOS' - env: - MACOSX_DEPLOYMENT_TARGET: "10.9" - working-directory: llvm-project - run: | - cmake \ - -DCMAKE_BUILD_TYPE=Release \ - -DCMAKE_INSTALL_PREFIX=$(brew --prefix) \ - -DCMAKE_INSTALL_NAME_DIR=$(brew --prefix)/lib \ - -DCMAKE_C_COMPILER=clang \ - -DCMAKE_CXX_COMPILER=clang++ \ - -DLIBOMP_INSTALL_ALIASES=OFF \ - -S openmp \ - -B build - cmake --build build --parallel - cmake --install build - - - uses: actions/setup-python@v5 - - - name: Install cibuildwheel - run: python -m pip install cibuildwheel - - - name: Build wheels - run: python -m cibuildwheel --output-dir wheelhouse - - - uses: actions/upload-artifact@v4 - with: - name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} - path: ./wheelhouse/*.whl +# build_wheels: +# name: Wheel on ${{ matrix.os }} +# runs-on: ${{ matrix.os }} +# strategy: +# matrix: +# os: [ubuntu-latest, windows-latest, macos-13, macos-14] +# fail-fast: true +# steps: +# - uses: actions/checkout@v4 +# with: +# fetch-depth: 0 +# +# # Use intel mpi on windows +# - uses: mpi4py/setup-mpi@v1 +# if: ${{ contains(matrix.os, 'windows') }} +# with: +# mpi: msmpi +# +# # Else, use the default for the OS and setup-mpi action +# - uses: mpi4py/setup-mpi@v1 +# if: ${{ !contains(matrix.os, 'windows') }} +# +# - name: Checkout LLVM on macOS +# if: runner.os == 'macOS' +# uses: actions/checkout@v4 +# with: +# repository: llvm/llvm-project +# ref: release/18.x +# path: llvm-project +# +# - name: Build OpenMP on macOS +# if: runner.os == 'macOS' +# env: +# MACOSX_DEPLOYMENT_TARGET: "10.9" +# working-directory: llvm-project +# run: | +# cmake \ +# -DCMAKE_BUILD_TYPE=Release \ +# -DCMAKE_INSTALL_PREFIX=$(brew --prefix) \ +# -DCMAKE_INSTALL_NAME_DIR=$(brew --prefix)/lib \ +# -DCMAKE_C_COMPILER=clang \ +# -DCMAKE_CXX_COMPILER=clang++ \ +# -DLIBOMP_INSTALL_ALIASES=OFF \ +# -S openmp \ +# -B build +# cmake --build build --parallel +# cmake --install build +# +# - uses: actions/setup-python@v5 +# +# - name: Install cibuildwheel +# run: python -m pip install cibuildwheel +# +# - name: Build wheels +# run: python -m cibuildwheel --output-dir wheelhouse +# +# - uses: actions/upload-artifact@v4 +# with: +# name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} +# path: ./wheelhouse/*.whl build_conda: name: Conda on ${{ matrix.os }} with Python ${{ matrix.python-version }} @@ -104,8 +108,10 @@ jobs: shell: bash -leo pipefail {0} strategy: matrix: - os: [ ubuntu-latest, macos-13, macos-latest ] - python-version: [ '3.9', '3.10', '3.11', '3.12' ] +# os: [ ubuntu-latest, macos-13, macos-latest ] +# python-version: [ '3.9', '3.10', '3.11', '3.12' ] + os: [ ubuntu-latest ] + python-version: [ '3.11'] fail-fast: false steps: - uses: actions/checkout@v4 @@ -152,31 +158,32 @@ jobs: name: conda-package-${{ matrix.os }}-${{ matrix.python-version }} path: conda-package - publish_pypi: - name: Publish to PyPI - needs: [ build_wheels, build_conda, make_sdist ] - environment: - name: pypi - url: https://pypi.org/p/brainiak - permissions: - id-token: write - runs-on: ubuntu-latest - if: github.event_name == 'release' && github.event.action == 'published' - steps: - - uses: actions/download-artifact@v4 - with: - pattern: cibw-* - path: dist - merge-multiple: true - - - name: List files in artifact(s) - run: ls -l dist - - - uses: pypa/gh-action-pypi-publish@release/v1 +# publish_pypi: +# name: Publish to PyPI +# needs: [ build_wheels, build_conda, make_sdist ] +# environment: +# name: pypi +# url: https://pypi.org/p/brainiak +# permissions: +# id-token: write +# runs-on: ubuntu-latest +# if: github.event_name == 'release' && github.event.action == 'published' +# steps: +# - uses: actions/download-artifact@v4 +# with: +# pattern: cibw-* +# path: dist +# merge-multiple: true +# +# - name: List files in artifact(s) +# run: ls -l dist +# +# - uses: pypa/gh-action-pypi-publish@release/v1 publish_conda: name: Publish to Anaconda - needs: [ build_conda, build_wheels, make_sdist ] +# needs: [ build_conda, build_wheels, make_sdist ] + needs: [ build_conda, make_sdist ] environment: anaconda permissions: id-token: write From c2299b1709c3ff1d3d38eb11541edce15c29f98e Mon Sep 17 00:00:00 2001 From: Dave Turner Date: Tue, 26 Nov 2024 12:17:13 -0500 Subject: [PATCH 6/9] Install anaconda client with conda. --- .github/workflows/cd.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 0dcd382a..081a42df 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -201,7 +201,7 @@ jobs: run: find conda-packages -type f -name "*.tar.bz2" - name: Install Anaconda CLI - run: pip install anaconda-client + run: conda install anaconda-client - name: Upload to Anaconda run: | From 8d514251d5b9097a55c2f4e3bc9ba3c4b538f0e7 Mon Sep 17 00:00:00 2001 From: Dave Turner Date: Tue, 26 Nov 2024 12:18:22 -0500 Subject: [PATCH 7/9] Fix CI badge url on README. --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 1ae08821..562aa02f 100644 --- a/README.rst +++ b/README.rst @@ -1,7 +1,7 @@ Brain Imaging Analysis Kit ========================== -.. image:: https://github.com/brainiak/brainiak/actions/workflows/main.yml/badge.svg +.. image:: https://github.com/brainiak/brainiak/actions/workflows/ci.yml/badge.svg :alt: Status of GitHub Actions workflow :target: https://github.com/brainiak/brainiak/actions From 33f68a4d0a46128ade86749b26da9eb1511ac795 Mon Sep 17 00:00:00 2001 From: Dave Turner Date: Tue, 26 Nov 2024 12:50:25 -0500 Subject: [PATCH 8/9] Fix anaconda upload. --- .github/workflows/cd.yml | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 081a42df..390b1014 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -190,6 +190,10 @@ jobs: runs-on: ubuntu-latest # if: github.event_name == 'release' && github.event.action == 'published' + defaults: + run: + shell: bash -leo pipefail {0} + steps: - uses: actions/download-artifact@v4 with: @@ -200,12 +204,17 @@ jobs: - name: List files in artifact run: find conda-packages -type f -name "*.tar.bz2" - - name: Install Anaconda CLI - run: conda install anaconda-client + - name: Setup micromamba and boa + uses: mamba-org/setup-micromamba@v1 + with: + environment-name: test-env + create-args: >- + anaconda-client + init-shell: >- + bash - name: Upload to Anaconda run: | - set -e # Exit immediately if any command exits with a non-zero status export ANACONDA_API_TOKEN=${{ secrets.ANACONDA_TOKEN }} for file in $(find conda-packages -type f -name "*.tar.bz2"); do echo "Uploading $file" From 16eff8e7af7e5d79f90f392cecd8fad10bfa9540 Mon Sep 17 00:00:00 2001 From: Dave Turner Date: Tue, 26 Nov 2024 13:01:53 -0500 Subject: [PATCH 9/9] Re-enable PyPI and other stuff. Things (minus authentication) seem to be working now. --- .github/workflows/cd.yml | 191 +++++++++++++++++++-------------------- 1 file changed, 92 insertions(+), 99 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 390b1014..714f1911 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -1,17 +1,13 @@ name: wheels and conda on: + workflow_dispatch: + release: + types: + - published pull_request: - push: - -#on: -# workflow_dispatch: -# release: -# types: -# - published -# pull_request: -# paths: -# - .github/workflows/cd.yml + paths: + - .github/workflows/cd.yml concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -39,66 +35,66 @@ jobs: name: cibw-sdist path: dist/*.tar.gz -# build_wheels: -# name: Wheel on ${{ matrix.os }} -# runs-on: ${{ matrix.os }} -# strategy: -# matrix: -# os: [ubuntu-latest, windows-latest, macos-13, macos-14] -# fail-fast: true -# steps: -# - uses: actions/checkout@v4 -# with: -# fetch-depth: 0 -# -# # Use intel mpi on windows -# - uses: mpi4py/setup-mpi@v1 -# if: ${{ contains(matrix.os, 'windows') }} -# with: -# mpi: msmpi -# -# # Else, use the default for the OS and setup-mpi action -# - uses: mpi4py/setup-mpi@v1 -# if: ${{ !contains(matrix.os, 'windows') }} -# -# - name: Checkout LLVM on macOS -# if: runner.os == 'macOS' -# uses: actions/checkout@v4 -# with: -# repository: llvm/llvm-project -# ref: release/18.x -# path: llvm-project -# -# - name: Build OpenMP on macOS -# if: runner.os == 'macOS' -# env: -# MACOSX_DEPLOYMENT_TARGET: "10.9" -# working-directory: llvm-project -# run: | -# cmake \ -# -DCMAKE_BUILD_TYPE=Release \ -# -DCMAKE_INSTALL_PREFIX=$(brew --prefix) \ -# -DCMAKE_INSTALL_NAME_DIR=$(brew --prefix)/lib \ -# -DCMAKE_C_COMPILER=clang \ -# -DCMAKE_CXX_COMPILER=clang++ \ -# -DLIBOMP_INSTALL_ALIASES=OFF \ -# -S openmp \ -# -B build -# cmake --build build --parallel -# cmake --install build -# -# - uses: actions/setup-python@v5 -# -# - name: Install cibuildwheel -# run: python -m pip install cibuildwheel -# -# - name: Build wheels -# run: python -m cibuildwheel --output-dir wheelhouse -# -# - uses: actions/upload-artifact@v4 -# with: -# name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} -# path: ./wheelhouse/*.whl + build_wheels: + name: Wheel on ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-13, macos-14] + fail-fast: true + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + # Use intel mpi on windows + - uses: mpi4py/setup-mpi@v1 + if: ${{ contains(matrix.os, 'windows') }} + with: + mpi: msmpi + + # Else, use the default for the OS and setup-mpi action + - uses: mpi4py/setup-mpi@v1 + if: ${{ !contains(matrix.os, 'windows') }} + + - name: Checkout LLVM on macOS + if: runner.os == 'macOS' + uses: actions/checkout@v4 + with: + repository: llvm/llvm-project + ref: release/18.x + path: llvm-project + + - name: Build OpenMP on macOS + if: runner.os == 'macOS' + env: + MACOSX_DEPLOYMENT_TARGET: "10.9" + working-directory: llvm-project + run: | + cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DCMAKE_INSTALL_PREFIX=$(brew --prefix) \ + -DCMAKE_INSTALL_NAME_DIR=$(brew --prefix)/lib \ + -DCMAKE_C_COMPILER=clang \ + -DCMAKE_CXX_COMPILER=clang++ \ + -DLIBOMP_INSTALL_ALIASES=OFF \ + -S openmp \ + -B build + cmake --build build --parallel + cmake --install build + + - uses: actions/setup-python@v5 + + - name: Install cibuildwheel + run: python -m pip install cibuildwheel + + - name: Build wheels + run: python -m cibuildwheel --output-dir wheelhouse + + - uses: actions/upload-artifact@v4 + with: + name: cibw-wheels-${{ matrix.os }}-${{ strategy.job-index }} + path: ./wheelhouse/*.whl build_conda: name: Conda on ${{ matrix.os }} with Python ${{ matrix.python-version }} @@ -108,10 +104,8 @@ jobs: shell: bash -leo pipefail {0} strategy: matrix: -# os: [ ubuntu-latest, macos-13, macos-latest ] -# python-version: [ '3.9', '3.10', '3.11', '3.12' ] - os: [ ubuntu-latest ] - python-version: [ '3.11'] + os: [ ubuntu-latest, macos-13, macos-latest ] + python-version: [ '3.9', '3.10', '3.11', '3.12' ] fail-fast: false steps: - uses: actions/checkout@v4 @@ -158,37 +152,36 @@ jobs: name: conda-package-${{ matrix.os }}-${{ matrix.python-version }} path: conda-package -# publish_pypi: -# name: Publish to PyPI -# needs: [ build_wheels, build_conda, make_sdist ] -# environment: -# name: pypi -# url: https://pypi.org/p/brainiak -# permissions: -# id-token: write -# runs-on: ubuntu-latest -# if: github.event_name == 'release' && github.event.action == 'published' -# steps: -# - uses: actions/download-artifact@v4 -# with: -# pattern: cibw-* -# path: dist -# merge-multiple: true -# -# - name: List files in artifact(s) -# run: ls -l dist -# -# - uses: pypa/gh-action-pypi-publish@release/v1 + publish_pypi: + name: Publish to PyPI + needs: [ build_wheels, build_conda, make_sdist ] + environment: + name: pypi + url: https://pypi.org/p/brainiak + permissions: + id-token: write + runs-on: ubuntu-latest + if: github.event_name == 'release' && github.event.action == 'published' + steps: + - uses: actions/download-artifact@v4 + with: + pattern: cibw-* + path: dist + merge-multiple: true + + - name: List files in artifact(s) + run: ls -l dist + + - uses: pypa/gh-action-pypi-publish@release/v1 publish_conda: name: Publish to Anaconda -# needs: [ build_conda, build_wheels, make_sdist ] - needs: [ build_conda, make_sdist ] + needs: [ build_conda, build_wheels, make_sdist ] environment: anaconda permissions: id-token: write runs-on: ubuntu-latest -# if: github.event_name == 'release' && github.event.action == 'published' + if: github.event_name == 'release' && github.event.action == 'published' defaults: run: @@ -204,7 +197,7 @@ jobs: - name: List files in artifact run: find conda-packages -type f -name "*.tar.bz2" - - name: Setup micromamba and boa + - name: Setup micromamba and anaconda-client uses: mamba-org/setup-micromamba@v1 with: environment-name: test-env