From f929f42a9d321dbd074a18aab111f50ef58c0f46 Mon Sep 17 00:00:00 2001 From: dalmijn <92092029+dalmijn@users.noreply.github.com> Date: Tue, 21 Nov 2023 16:14:47 +0100 Subject: [PATCH] Better publishing (#218) * Better publishing * Adjusted name --- .github/workflows/publish.yml | 38 +++++++++++------------------------ 1 file changed, 12 insertions(+), 26 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 460effc5..a00c0f2b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,3 +1,4 @@ +--- name: Build and Upload HydroMT-Wflow to PyPI on: @@ -6,7 +7,8 @@ on: - published push: tags: - - 'v*' + - v* + workflow_dispatch: jobs: @@ -20,23 +22,18 @@ jobs: - uses: actions/setup-python@v4 name: Install Python with: - python-version: 3.8 + python-version: '3.10' - - name: Install dependencies + - name: generate env run: | - python -m pip install --upgrade pip - python -m pip install flit wheel twine + pip install tomli flit twine - - name: Build tarball and wheels + - name: Build artifacts run: | git clean -xdf git restore -SW . flit build - - - name: Check built artifacts - run: | python -m twine check dist/* - pwd - uses: actions/upload-artifact@v3 with: @@ -50,7 +47,8 @@ jobs: run: shell: bash -l {0} steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 + - uses: actions/download-artifact@v3 with: name: releases @@ -60,26 +58,14 @@ jobs: ls -ltrh ls -ltrh dist - - name: Setup environment - uses: conda-incubator/setup-miniconda@v2 + - uses: actions/setup-python@v4 with: - python-version: "3.9" - mamba-version: "*" - channels: conda-forge,defaults - channel-priority: true - environment-file: envs/hydromt-wflow-min.yml - activate-environment: hydromt-wflow-min - - - name: Conda info - run: | - conda info - conda list + python-version: '3.10' - name: Verify the built dist/wheel is valid run: | python -m pip install dist/hydromt_wflow*.whl - python -c 'from hydromt_wflow import __version__ as v; print(v)' - echo "hydromt --models" + hydromt --models upload-to-test-pypi: needs: test-built-dist