Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Better publishing #218

Merged
merged 2 commits into from
Nov 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 12 additions & 26 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
---
name: Build and Upload HydroMT-Wflow to PyPI

on:
Expand All @@ -6,7 +7,8 @@ on:
- published
push:
tags:
- 'v*'
- v*
workflow_dispatch:


jobs:
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand Down