From 69bb5bb7af074c8e846b15146762155666db46f2 Mon Sep 17 00:00:00 2001 From: Lachlan Grose Date: Thu, 21 Nov 2024 12:53:32 +1100 Subject: [PATCH 01/10] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 056fb45..f18fabc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -78,7 +78,7 @@ jobs: - name: Build Wheels run: | python -m pip install --upgrade pip - pip install netCDF4>=1.5.4 --only-binary :all: + pip install netCDF4>=1.5.4 pip install build numpy pandas pytest python -m build --wheel From ec1ba3760b8b599c2b015f67f972b94d3996d9fd Mon Sep 17 00:00:00 2001 From: Lachlan Grose Date: Thu, 21 Nov 2024 12:54:21 +1100 Subject: [PATCH 02/10] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f18fabc..d8bb0ea 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -96,7 +96,7 @@ jobs: fail-fast: false matrix: os: - - ubuntu-latest + - ["ubuntu-latest","macosx-latest","windows-latest"] python-version: ["3.9", "3.10", "3.11", "3.12"] include: - os: "ubuntu-latest" From 5ae40b5a8d1dd17b17a8a654bf434d682bfca512 Mon Sep 17 00:00:00 2001 From: Lachlan Grose Date: Thu, 21 Nov 2024 14:39:37 +1100 Subject: [PATCH 03/10] Update release.yml --- .github/workflows/release.yml | 199 +--------------------------------- 1 file changed, 3 insertions(+), 196 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index d8bb0ea..3137ee4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,41 +26,7 @@ jobs: # commit_message: "style: style fixes by ruff and autoformatting by black" - pip-build-sdist: - name: Build SDist - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - name: Build SDist - run: | - pip install build - python -m build - - - uses: actions/upload-artifact@v4 - with: - name: loopprojectfile-dist - path: dist/*.tar.gz - compression-level: 0 - - pip-test-sdist: - name: Test sdist - needs: pip-build-sdist - runs-on: ubuntu-latest - steps: - - name: Download sdist from artifacts - uses: actions/download-artifact@v4 - with: - name: loopprojectfile-dist - path: dist - - - name: Build LPF from sdist and install test dependencies - shell: bash - run: | - python -m pip install --upgrade pip - pip install --no-cache dist/*.tar.gz - pip install netCDF4>=1.5.4 numpy pandas pytest - pip list + p pip-build-wheels: needs: pip-test-sdist @@ -70,7 +36,7 @@ jobs: fail-fast: false matrix: os: - - ubuntu-latest + - ["ubuntu-latest","macosx-latest","windows-latest"] steps: - uses: actions/checkout@v4 @@ -88,163 +54,4 @@ jobs: path: dist/*.whl compression-level: 0 - pip-test-wheels: - name: Test wheels on ${{ matrix.os }} (Python ${{ matrix.python-version }}) - needs: pip-build-wheels - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: - - ["ubuntu-latest","macosx-latest","windows-latest"] - python-version: ["3.9", "3.10", "3.11", "3.12"] - include: - - os: "ubuntu-latest" - artifact: loopprojectfile-wheels-ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: ${{ matrix.python-version }} - allow-prereleases: true - - - name: Upgrade pip - run: | - python -m pip install --upgrade pip - - - name: Download wheels from artifacts - uses: actions/download-artifact@v4 - with: - name: ${{ matrix.artifact }} - path: dist - - - name: Install dependencies and LoopProjectFile wheel - shell: bash - run: | - pip install --upgrade pip - pip install netCDF4>=1.5.4 --only-binary :all: - pip install numpy pandas pytest - pip install --no-cache --pre --no-index --find-links dist loopprojectfile - pip list - - conda-build: - name: Conda Build-Deploy ${{ matrix.os }} - Python Version-${{ matrix.python-version }} - runs-on: ${{ matrix.os }} - strategy: - fail-fast: false - matrix: - os: - - ubuntu-latest - - macos-latest - - windows-latest - python-version: ["3.9", "3.10", "3.11", "3.12"] - - steps: - - uses: actions/checkout@v4 - - - name: Setup Miniforge - uses: conda-incubator/setup-miniconda@v3 - with: - miniforge-version: latest - activate-environment: anaconda-client-env - use-only-tar-bz2: true - - # need to add cygwin action to remove cygpath warnings - - - name: Installing Dependencies - shell: bash -l {0} - run: | - conda install -c conda-forge conda-build anaconda-client conda-verify -y - conda install -c conda-forge -c loop3d --file requirements.txt -y - - - name: Building and install - shell: bash -l {0} - run: | - pip install . --user - - - name: update submodules - shell: bash - run: | - git submodule update --init --recursive - - - name: Conda Build - env: - ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} - path: ~/conda_pkgs_dir - shell: bash -l {0} - run: | - conda build -c anaconda -c conda-forge -c loop3d --output-folder conda conda --python ${{ matrix.python-version }} - - - name: upload artifacts - uses: actions/upload-artifact@v4 - with: - name: loopprojectfile-conda-${{ matrix.os }}-${{ matrix.python-version }} - path: conda - - release-please: - needs: [pip-test-wheels, conda-build] - runs-on: ubuntu-latest - if: github.ref == 'refs/heads/master' - steps: - - uses: actions/checkout@v4 - - uses: googleapis/release-please-action@v4 - id: release - with: - config-file: 'release-please-config.json' - manifest-file: '.release-please-manifest.json' - outputs: - release_created: ${{ steps.release.outputs.release_created }} -#if a release is created then run the deploy scripts for github.io, conda, pypi and docker - - conda-upload: - needs: [release-please, conda-build] - runs-on: ${{matrix.os}} - strategy: - fail-fast: false - matrix: - os: - - ubuntu-latest - - macos-latest - - windows-latest - python-version: ["3.9", "3.10", "3.11", "3.12"] - if: ${{ needs.release-please.outputs.release_created }} - steps: - - uses: actions/download-artifact@v4 - with: - name: loopprojectfile-conda-${{ matrix.os }}-${{ matrix.python-version }} - path: conda - - uses: conda-incubator/setup-miniconda@v3 - - name: upload all files to conda-forge - shell: bash -l {0} - env: - ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} - with: - skip-existing: true - verbose: true - run: | - conda install -c anaconda anaconda-client -y - anaconda upload --label main conda/*/*.tar.bz2 - - pypi-upload: - needs: [release-please, pip-test-wheels] - runs-on: - - ubuntu-latest - - macos-latest - - windows-latest - - if: ${{ needs.release-please.outputs.release_created }} - permissions: - # IMPORTANT: this permission is mandatory for trusted publishing - id-token: write - steps: - - uses: actions/download-artifact@v4 - with: - name: loopprojectfile-dist - path: dist/ - - uses: pypa/gh-action-pypi-publish@release/v1 - with: - skip-existing: true - verbose: true + From 5347a3e2d138afbb726da7bb1f27c441b63b5468 Mon Sep 17 00:00:00 2001 From: Lachlan Grose Date: Thu, 21 Nov 2024 14:40:11 +1100 Subject: [PATCH 04/10] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3137ee4..211e0e0 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,7 @@ jobs: # commit_message: "style: style fixes by ruff and autoformatting by black" - p + pip-build-wheels: needs: pip-test-sdist From ca43f68cfbc9a6d074555d6b07c6bd9bd290eb7f Mon Sep 17 00:00:00 2001 From: Lachlan Grose Date: Thu, 21 Nov 2024 14:41:10 +1100 Subject: [PATCH 05/10] Update release.yml --- .github/workflows/release.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 211e0e0..5f0ed8b 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -29,7 +29,6 @@ jobs: pip-build-wheels: - needs: pip-test-sdist name: Build Wheels runs-on: ${{ matrix.os }} strategy: From c8f51a61834696d676a91ce30e2b0bdcc98d2b82 Mon Sep 17 00:00:00 2001 From: Lachlan Grose Date: Thu, 21 Nov 2024 14:43:59 +1100 Subject: [PATCH 06/10] Update release.yml --- .github/workflows/release.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5f0ed8b..a483c1c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,8 +35,7 @@ jobs: fail-fast: false matrix: os: - - ["ubuntu-latest","macosx-latest","windows-latest"] - + - [ubuntu-latest, windows-latest,macosx-latext] steps: - uses: actions/checkout@v4 From f1bb9d74bf7dadd509d60f3b9edebca3805b485d Mon Sep 17 00:00:00 2001 From: Lachlan Grose Date: Thu, 21 Nov 2024 14:48:20 +1100 Subject: [PATCH 07/10] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a483c1c..f30cf70 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,7 +35,7 @@ jobs: fail-fast: false matrix: os: - - [ubuntu-latest, windows-latest,macosx-latext] + - [ubuntu-latest, windows-latest,macos-latext] steps: - uses: actions/checkout@v4 From d4b2a12b237189833cc7eb46ab272faf037f1afe Mon Sep 17 00:00:00 2001 From: Lachlan Grose Date: Thu, 21 Nov 2024 14:48:55 +1100 Subject: [PATCH 08/10] Update release.yml --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index f30cf70..69b5817 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,7 +35,7 @@ jobs: fail-fast: false matrix: os: - - [ubuntu-latest, windows-latest,macos-latext] + - [ubuntu-latest, windows-latest,macos-latest] steps: - uses: actions/checkout@v4 From c61f439feafff868ef841b8005c3fa714501ab06 Mon Sep 17 00:00:00 2001 From: Lachlan Grose Date: Thu, 21 Nov 2024 14:49:57 +1100 Subject: [PATCH 09/10] Update release.yml --- .github/workflows/release.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 69b5817..afdeeba 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -35,7 +35,9 @@ jobs: fail-fast: false matrix: os: - - [ubuntu-latest, windows-latest,macos-latest] + - ubuntu-latest + - windows-latest + - macos-latest steps: - uses: actions/checkout@v4 From e0e4aa53e13ba3fc795f32b36b80bb5001caa6f8 Mon Sep 17 00:00:00 2001 From: Lachlan Grose Date: Thu, 21 Nov 2024 14:53:36 +1100 Subject: [PATCH 10/10] Update release.yml --- .github/workflows/release.yml | 208 +++++++++++++++++++++++++++++++++- 1 file changed, 205 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index afdeeba..8590806 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,9 +26,44 @@ jobs: # commit_message: "style: style fixes by ruff and autoformatting by black" + pip-build-sdist: + name: Build SDist + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Build SDist + run: | + pip install build + python -m build + + - uses: actions/upload-artifact@v4 + with: + name: loopprojectfile-dist + path: dist/*.tar.gz + compression-level: 0 + pip-test-sdist: + name: Test sdist + needs: pip-build-sdist + runs-on: ubuntu-latest + steps: + - name: Download sdist from artifacts + uses: actions/download-artifact@v4 + with: + name: loopprojectfile-dist + path: dist + + - name: Build LPF from sdist and install test dependencies + shell: bash + run: | + python -m pip install --upgrade pip + pip install --no-cache dist/*.tar.gz + pip install netCDF4>=1.5.4 numpy pandas pytest + pip list pip-build-wheels: + needs: pip-test-sdist name: Build Wheels runs-on: ${{ matrix.os }} strategy: @@ -36,15 +71,16 @@ jobs: matrix: os: - ubuntu-latest - - windows-latest - macos-latest + - windows-latest + steps: - uses: actions/checkout@v4 - name: Build Wheels run: | python -m pip install --upgrade pip - pip install netCDF4>=1.5.4 + pip install netCDF4>=1.5.4 pip install build numpy pandas pytest python -m build --wheel @@ -54,4 +90,170 @@ jobs: path: dist/*.whl compression-level: 0 - + pip-test-wheels: + name: Test wheels on ${{ matrix.os }} (Python ${{ matrix.python-version }}) + needs: pip-build-wheels + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - macos-latest + - windows-latest + python-version: ["3.9", "3.10", "3.11", "3.12"] + include: + - os: "ubuntu-latest" + artifact: loopprojectfile-wheels-ubuntu-latest + - os: "macos-latest" + artifact: loopprojectfile-wheels-macos-latest + - os: "windows-latest" + artifact: loopprojectfile-wheels-windows-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + allow-prereleases: true + + - name: Upgrade pip + run: | + python -m pip install --upgrade pip + + - name: Download wheels from artifacts + uses: actions/download-artifact@v4 + with: + name: ${{ matrix.artifact }} + path: dist + + - name: Install dependencies and LoopProjectFile wheel + shell: bash + run: | + pip install --upgrade pip + pip install netCDF4>=1.5.4 + pip install numpy pandas pytest + pip install --no-cache --pre --no-index --find-links dist loopprojectfile + pip list + + conda-build: + name: Conda Build-Deploy ${{ matrix.os }} - Python Version-${{ matrix.python-version }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - macos-latest + - windows-latest + python-version: ["3.9", "3.10", "3.11", "3.12"] + + steps: + - uses: actions/checkout@v4 + + - name: Setup Miniforge + uses: conda-incubator/setup-miniconda@v3 + with: + miniforge-version: latest + activate-environment: anaconda-client-env + use-only-tar-bz2: true + + # need to add cygwin action to remove cygpath warnings + + - name: Installing Dependencies + shell: bash -l {0} + run: | + conda install -c conda-forge conda-build anaconda-client conda-verify -y + conda install -c conda-forge -c loop3d --file requirements.txt -y + + - name: Building and install + shell: bash -l {0} + run: | + pip install . --user + + - name: update submodules + shell: bash + run: | + git submodule update --init --recursive + + - name: Conda Build + env: + ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} + path: ~/conda_pkgs_dir + shell: bash -l {0} + run: | + conda build -c anaconda -c conda-forge -c loop3d --output-folder conda conda --python ${{ matrix.python-version }} + + - name: upload artifacts + uses: actions/upload-artifact@v4 + with: + name: loopprojectfile-conda-${{ matrix.os }}-${{ matrix.python-version }} + path: conda + + release-please: + needs: [pip-test-wheels, conda-build] + runs-on: ubuntu-latest + if: github.ref == 'refs/heads/master' + steps: + - uses: actions/checkout@v4 + - uses: googleapis/release-please-action@v4 + id: release + with: + config-file: 'release-please-config.json' + manifest-file: '.release-please-manifest.json' + outputs: + release_created: ${{ steps.release.outputs.release_created }} +#if a release is created then run the deploy scripts for github.io, conda, pypi and docker + + conda-upload: + needs: [release-please, conda-build] + runs-on: ${{matrix.os}} + strategy: + fail-fast: false + matrix: + os: + - ubuntu-latest + - macos-latest + - windows-latest + python-version: ["3.9", "3.10", "3.11", "3.12"] + if: ${{ needs.release-please.outputs.release_created }} + steps: + - uses: actions/download-artifact@v4 + with: + name: loopprojectfile-conda-${{ matrix.os }}-${{ matrix.python-version }} + path: conda + - uses: conda-incubator/setup-miniconda@v3 + - name: upload all files to conda-forge + shell: bash -l {0} + env: + ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }} + with: + skip-existing: true + verbose: true + run: | + conda install -c anaconda anaconda-client -y + anaconda upload --label main conda/*/*.tar.bz2 + + pypi-upload: + needs: [release-please, pip-test-wheels] + runs-on: + - ubuntu-latest + - macos-latest + - windows-latest + + if: ${{ needs.release-please.outputs.release_created }} + permissions: + # IMPORTANT: this permission is mandatory for trusted publishing + id-token: write + steps: + - uses: actions/download-artifact@v4 + with: + name: loopprojectfile-dist + path: dist/ + - uses: pypa/gh-action-pypi-publish@release/v1 + with: + skip-existing: true + verbose: true