Skip to content

Commit

Permalink
Merge branch 'master' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
aleaf committed Oct 19, 2024
2 parents bf2ba6f + 1f5a2f2 commit 1f37e0d
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 139 deletions.
158 changes: 19 additions & 139 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,142 +3,14 @@ on:
push:
branches:
- master
- v[0-9]+.[0-9]+.[0-9]+*
# branchname trigger if we had the ability to auto-prep release PRs
# (turned off for doi-usgs org)
#- v[0-9]+.[0-9]+.[0-9]+*
release:
types:
- published

jobs:
prep:
name: Prepare release
runs-on: ubuntu-latest
if: ${{ github.event_name == 'push' && github.ref_name != 'master' }}
permissions:
contents: write
defaults:
run:
shell: bash
steps:

- name: Checkout release branch
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get latest release version number
id: get_version
uses: battila7/get-version-action@v2

- name: Setup Micromamba
uses: mamba-org/setup-micromamba@v1
with:
environment-file: ci/test_environment.yml
cache-environment: true
cache-downloads: true
create-args: >-
python=${{ matrix.python-version }}
init-shell: >-
bash
- name: Conda info
shell: bash -l {0}
run: micromamba info

- name: Install dependencies
shell: bash -l {0}
run: |
if [[ ! -d "$HOME/.local/bin" ]]; then
mkdir -p "$HOME/.local/bin";
fi
# copy modflow bins to local dir to add to PATH later
if [ "$RUNNER_OS" == "Windows" ]; then
d="win"
elif [ "$RUNNER_OS" == "macOS" ]; then
d="mac"
elif [ "$RUNNER_OS" == "Linux" ]; then
d="linux"
else
d="unexpectedos"
exit 1
fi
echo bin/$d/. >> $GITHUB_PATH
echo $GITHUB_PATH
- name: Test install from git
shell: bash -l {0}
run: |
pip install git+https://github.com/doi-usgs/sfrmaker@develop
cd ..
python -c "import sfrmaker"
cd sfrmaker
- name: Install SFRmaker and ipykernel
shell: bash -l {0}
run: |
pip install -e .
python -m ipykernel install --user --name sfrmaker_ci --display-name "sfrmaker_ci"
- name: Test with latest PyPI flopy
shell: bash -l {0}
if: ${{ matrix.python-version == 3.11}}
run: pip install flopy --force-reinstall

- name: Conda list
shell: bash -l {0}
run: |
micromamba list
pip list
- name: Run tests and upload coverage
shell: bash -l {0}
timeout-minutes: 60
run: |
coverage run -m pytest -v --durations=20 --timeout=120
- name: Upload coverage
shell: bash -l {0}
run: |
coverage report -m
codecov
- name: Push release branch
run: |
git config core.sharedRepository true
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git commit -m --allow-empty "ci(release): Version ${{ steps.get_version.outputs.version }}"
git push origin "${{ github.ref_name }}"
pr:
name: Draft release PR
needs: prep
if: ${{ github.event_name == 'push' && !(contains(github.ref_name, 'rc')) }}
runs-on: ubuntu-latest #ubuntu-22.04
permissions:
contents: write
pull-requests: write
defaults:
run:
shell: bash -l {0}
steps:

- name: Checkout release branch
uses: actions/checkout@v4
with:
ref: ${{ github.ref_name }}

- name: Draft pull request
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
ref="${{ github.ref_name }}"
ver="${ref#"v"}"
title="Release $ver"
body='
# SFRmaker '$ver'
The release can be approved by merging this pull request into `master`. This will trigger a final job to publish the release to PyPI.
'
gh pr create -B "master" -H "$ref" --title "$title" --draft --body "$body"

release:
name: Create Release
Expand All @@ -153,17 +25,23 @@ jobs:
uses: actions/checkout@v4
with:
ref: master
- name: Bump version and push tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
tag_name: ${{ steps.tag_version.outputs.new_tag }}
release_name: Release ${{ steps.tag_version.outputs.new_tag }}
body: |
Changes in this Release:
draft: false
Changes in this Release:
${{ steps.tag_version.outputs.changelog }}
draft: true
prerelease: false

docs:
Expand All @@ -173,9 +51,11 @@ jobs:

steps:
- name: Checkout source
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
persist-credentials: false
ref: master
fetch-tags: true

- name: Get latest release version number
id: get_version
Expand Down Expand Up @@ -244,6 +124,7 @@ jobs:
publish:
name: Publish package
# runs only after release is published (manually promoted from draft)
# (allows editing of release notes, etc.)
if: ${{ github.event_name == 'release' }}
runs-on: ubuntu-latest #ubuntu-22.04
permissions:
Expand All @@ -259,6 +140,7 @@ jobs:
uses: actions/checkout@v4
with:
ref: master
fetch-tags: true

- name: Setup Python
uses: actions/setup-python@v5
Expand All @@ -270,9 +152,7 @@ jobs:
- name: Install Python dependencies
run: |
pip install --upgrade pip
pip install build twine
pip install .
pip install ".[lint, test, optional]"
pip install build twine
- name: Build package
run: python -m build
Expand Down
5 changes: 5 additions & 0 deletions docs/source/release-history.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
Release History
===============

Version 0.11.3 (2024-10-18)
---------------------------
* fix issue where SFR reach slopes were not being updated when streambed top elevations were resampled from a DEM
* fix issue with utils.assign_layers where a 2D array of the model bottom elevations was being returned instead of a 3D array of all layer bottom elevations.

Version 0.11.2 (2024-01-15)
---------------------------
* fix issue with line_id dtypes, so that NHDPlus Hi-Res COMIDs (which require 64-bits as integers) work more robustly on Windows.
Expand Down

0 comments on commit 1f37e0d

Please sign in to comment.