From ba865005f3f9be685298a5518f4222119d592225 Mon Sep 17 00:00:00 2001 From: Brendan Date: Tue, 21 Nov 2023 16:03:50 +0100 Subject: [PATCH 1/2] Better publishing --- .github/workflows/publish.yml | 40 ++++++++++++----------------------- 1 file changed, 13 insertions(+), 27 deletions(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 460effc5..ccc6a51d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,4 +1,5 @@ -name: Build and Upload HydroMT-Wflow to PyPI +--- +name: Build and Upload HydroMT to PyPI on: release: @@ -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 From 9d0fb338e92a7cba6f53e0b43a3c2e79ba55b746 Mon Sep 17 00:00:00 2001 From: Brendan Date: Tue, 21 Nov 2023 16:09:27 +0100 Subject: [PATCH 2/2] Adjusted name --- .github/workflows/publish.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index ccc6a51d..a00c0f2b 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -1,5 +1,5 @@ --- -name: Build and Upload HydroMT to PyPI +name: Build and Upload HydroMT-Wflow to PyPI on: release: