Skip to content

Commit 283b18e

Browse files
committed
Merge branch 'master' of https://github.com/Loop3D/loopprojectfile into fix/linting_actions
2 parents 785b0cc + 540e136 commit 283b18e

6 files changed

Lines changed: 196 additions & 139 deletions

File tree

.github/workflows/publish_conda.yml

Lines changed: 0 additions & 53 deletions
This file was deleted.

.github/workflows/release.yml

Lines changed: 177 additions & 85 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
1-
on: [push, pull_request]
21
name: release-please
2+
on: [push, pull_request]
3+
4+
permissions:
5+
contents: write
6+
pull-requests: write
7+
38
jobs:
49
linting:
510
name: Linting
@@ -28,138 +33,225 @@ jobs:
2833
with:
2934
commit_message: "style: style fixes by ruff and autoformatting by black"
3035

31-
continuous-integration:
32-
name: Continuous integration ${{ matrix.os }} python ${{ matrix.python-version }}
36+
pip-build-sdist:
37+
name: Build SDist
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v4
41+
42+
- name: Build SDist
43+
run: |
44+
pip install build
45+
python -m build
46+
47+
- uses: actions/upload-artifact@v4
48+
with:
49+
name: loopprojectfile-dist
50+
path: dist/*.tar.gz
51+
compression-level: 0
52+
53+
pip-test-sdist:
54+
name: Test sdist
55+
needs: pip-build-sdist
56+
runs-on: ubuntu-latest
57+
steps:
58+
- name: Download sdist from artifacts
59+
uses: actions/download-artifact@v4
60+
with:
61+
name: loopprojectfile-dist
62+
path: dist
63+
64+
- name: Build LPF from sdist and install test dependencies
65+
shell: bash
66+
run: |
67+
python -m pip install --upgrade pip
68+
pip install --no-cache dist/*.tar.gz
69+
pip install netCDF4>=1.5.4 numpy pandas pytest
70+
pip list
71+
72+
pip-build-wheels:
73+
needs: pip-test-sdist
74+
name: Build Wheels
3375
runs-on: ${{ matrix.os }}
3476
strategy:
3577
fail-fast: false
3678
matrix:
37-
os: ${{ fromJSON(vars.BUILD_OS)}}
38-
python-version: ${{ fromJSON(vars.PYTHON_VERSIONS)}}
79+
os:
80+
- ubuntu-latest
81+
3982
steps:
4083
- uses: actions/checkout@v4
41-
- uses: conda-incubator/setup-miniconda@v3
4284

43-
with:
44-
python-version: ${{ matrix.python-version }}
45-
- name: Installing dependencies
46-
shell: bash -l {0}
47-
run: |
48-
conda install -c conda-forge -c loop3d --file requirements.txt -y
49-
- name: Building and install
50-
shell: bash -l {0}
85+
- name: Build Wheels
5186
run: |
52-
pip install . --user
53-
# - name: Test verification
54-
# shell: bash -l {0}
55-
# run: |
56-
# pytest
87+
python -m pip install --upgrade pip
88+
pip install netCDF4>=1.5.4 --only-binary :all:
89+
pip install build numpy pandas pytest
90+
python -m build --wheel
5791
58-
release-please:
59-
runs-on: ubuntu-latest
60-
if: github.ref == 'refs/heads/master'
61-
steps:
62-
- uses: actions/checkout@v4
63-
with:
64-
fetch-depth: 0 # Fetch all history for all tags and branches
65-
- uses: GoogleCloudPlatform/release-please-action@v4
66-
id: release
92+
- uses: actions/upload-artifact@v4
6793
with:
68-
release-type: python
69-
package-name: LoopProjectFile
70-
version-file: LoopProjectFile/version.py
71-
outputs:
72-
release_created: ${{ steps.release.outputs.release_created }}
73-
# if a release is created then run the deploy scripts for github.io, conda, pypi and docker
74-
75-
conda-deploy:
76-
name: Building conda package for python ${{ matrix.os }})
77-
needs: "continuous-integration"
78-
runs-on: ${{matrix.os}}
94+
name: loopprojectfile-wheels-${{ matrix.os }}
95+
path: dist/*.whl
96+
compression-level: 0
97+
98+
pip-test-wheels:
99+
name: Test wheels on ${{ matrix.os }} (Python ${{ matrix.python-version }})
100+
needs: pip-build-wheels
101+
runs-on: ${{ matrix.os }}
79102
strategy:
80103
fail-fast: false
81104
matrix:
82-
os: ["ubuntu-latest"]
83-
python-version: ${{ fromJSON(vars.PYTHON_VERSIONS)}}
105+
os:
106+
- ubuntu-latest
107+
python-version: ["3.9", "3.10", "3.11", "3.12"]
108+
include:
109+
- os: "ubuntu-latest"
110+
artifact: loopprojectfile-wheels-ubuntu-latest
84111
steps:
85-
- uses: conda-incubator/setup-miniconda@v3
112+
- name: Checkout
113+
uses: actions/checkout@v4
114+
115+
- name: Set up Python
116+
uses: actions/setup-python@v5
86117
with:
87-
auto-update-conda: true
88118
python-version: ${{ matrix.python-version }}
119+
allow-prereleases: true
120+
121+
- name: Upgrade pip
122+
run: |
123+
python -m pip install --upgrade pip
124+
125+
- name: Download wheels from artifacts
126+
uses: actions/download-artifact@v4
127+
with:
128+
name: ${{ matrix.artifact }}
129+
path: dist
130+
131+
- name: Install dependencies and LoopProjectFile wheel
132+
shell: bash
133+
run: |
134+
pip install --upgrade pip
135+
pip install netCDF4>=1.5.4 --only-binary :all:
136+
pip install numpy pandas pytest
137+
pip install --no-cache --pre --no-index --find-links dist loopprojectfile
138+
pip list
89139
140+
conda-build:
141+
name: Conda Build-Deploy ${{ matrix.os }} - Python Version-${{ matrix.python-version }}
142+
runs-on: ${{ matrix.os }}
143+
strategy:
144+
fail-fast: false
145+
matrix:
146+
os:
147+
- ubuntu-latest
148+
- macos-latest
149+
- windows-latest
150+
python-version: ["3.9", "3.10", "3.11", "3.12"]
151+
152+
steps:
90153
- uses: actions/checkout@v4
154+
155+
- name: Setup Miniforge
156+
uses: conda-incubator/setup-miniconda@v3
157+
with:
158+
miniforge-version: latest
159+
activate-environment: anaconda-client-env
160+
use-only-tar-bz2: true
161+
162+
# need to add cygwin action to remove cygpath warnings
163+
164+
- name: Installing Dependencies
165+
shell: bash -l {0}
166+
run: |
167+
conda install -c conda-forge conda-build anaconda-client conda-verify -y
168+
conda install -c conda-forge -c loop3d --file requirements.txt -y
169+
170+
- name: Building and install
171+
shell: bash -l {0}
172+
run: |
173+
pip install . --user
174+
91175
- name: update submodules
92-
# shell: bash -l {0}
176+
shell: bash
93177
run: |
94-
git submodule update --init --recursive
95-
- name: Conda build
178+
git submodule update --init --recursive
179+
180+
- name: Conda Build
96181
env:
97182
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
183+
path: ~/conda_pkgs_dir
98184
shell: bash -l {0}
99185
run: |
100-
conda install --solver=classic -c conda-forge conda-build anaconda-client conda-libmamba-solver -y
101-
conda build -c anaconda -c conda-forge -c loop3d --output-folder conda conda --python ${{ matrix.python-version }}
102-
conda convert -p all conda/linux-64/*.tar.bz2 -f -o conda
103-
conda install anaconda-client -y
186+
conda build -c anaconda -c conda-forge -c loop3d --output-folder conda conda --python ${{ matrix.python-version }}
187+
104188
- name: upload artifacts
105189
uses: actions/upload-artifact@v4
106190
with:
107-
name: conda-${{ matrix.os }}-${{ matrix.python-version }}
191+
name: loopprojectfile-conda-${{ matrix.os }}-${{ matrix.python-version }}
108192
path: conda
109193

110-
make_sdist:
111-
needs: "continuous-integration"
112-
name: Make SDist
194+
release-please:
195+
needs: [pip-test-wheels, conda-build]
113196
runs-on: ubuntu-latest
197+
if: github.ref == 'refs/heads/master'
114198
steps:
115199
- uses: actions/checkout@v4
116-
117-
- name: Build SDist
118-
run: |
119-
pip install build
120-
python -m build
121-
122-
- uses: actions/upload-artifact@v4
200+
- uses: googleapis/release-please-action@v4
201+
id: release
123202
with:
124-
name: dist
125-
path: dist/
203+
config-file: 'release-please-config.json'
204+
manifest-file: '.release-please-manifest.json'
205+
outputs:
206+
release_created: ${{ steps.release.outputs.release_created }}
207+
#if a release is created then run the deploy scripts for github.io, conda, pypi and docker
126208

127-
upload_to_conda:
128-
needs: ["release-please", "conda-deploy"]
209+
conda-upload:
210+
needs: [release-please, conda-build]
129211
runs-on: ${{matrix.os}}
130212
strategy:
131213
fail-fast: false
132214
matrix:
133-
os: ["ubuntu-latest"]
134-
python-version: ${{ fromJSON(vars.PYTHON_VERSIONS)}}
215+
os:
216+
- ubuntu-latest
217+
- macos-latest
218+
- windows-latest
219+
python-version: ["3.9", "3.10", "3.11", "3.12"]
135220
if: ${{ needs.release-please.outputs.release_created }}
136221
steps:
137222
- uses: actions/download-artifact@v4
138223
with:
139-
name: conda-${{ matrix.os }}-${{ matrix.python-version }}
224+
name: loopprojectfile-conda-${{ matrix.os }}-${{ matrix.python-version }}
140225
path: conda
141226
- uses: conda-incubator/setup-miniconda@v3
142227
- name: upload all files to conda-forge
143228
shell: bash -l {0}
144229
env:
145230
ANACONDA_API_TOKEN: ${{ secrets.ANACONDA_TOKEN }}
231+
with:
232+
skip-existing: true
233+
verbose: true
146234
run: |
147235
conda install -c anaconda anaconda-client -y
148236
anaconda upload --label main conda/*/*.tar.bz2
149-
150-
upload_to_pypi:
151-
runs-on: "ubuntu-latest"
152-
needs: ["release-please", "conda-deploy"]
153-
if: ${{ needs.release-please.outputs.release_created }}
154-
permissions:
155-
# IMPORTANT: this permission is mandatory for trusted publishing
156-
id-token: write
157-
steps:
158-
- uses: actions/download-artifact@v4
159-
with:
160-
name: dist
161-
path: dist
162-
- uses: pypa/gh-action-pypi-publish@release/v1
163-
with:
164-
skip-existing: true
165-
verbose: true
237+
238+
pypi-upload:
239+
needs: [release-please, pip-test-wheels]
240+
runs-on:
241+
- ubuntu-latest
242+
- macos-latest
243+
- windows-latest
244+
245+
if: ${{ needs.release-please.outputs.release_created }}
246+
permissions:
247+
# IMPORTANT: this permission is mandatory for trusted publishing
248+
id-token: write
249+
steps:
250+
- uses: actions/download-artifact@v4
251+
with:
252+
name: loopprojectfile-dist
253+
path: dist/
254+
- uses: pypa/gh-action-pypi-publish@release/v1
255+
with:
256+
skip-existing: true
257+
verbose: true

.release-please-manifest.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"LoopProjectFile": "0.1.4"
3+
}

conda/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,4 @@ about:
3333

3434
extra:
3535
recipe-maintainers:
36-
- roythomson
36+
- rabii-chaarani

0 commit comments

Comments
 (0)