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

Automate release #1642

Merged
merged 1 commit into from
Dec 14, 2022
Merged

Automate release #1642

merged 1 commit into from
Dec 14, 2022

Conversation

wpbonelli
Copy link
Member

@wpbonelli wpbonelli commented Dec 2, 2022

Release automation

Adds a workflow release.yml to make FloPy releases. There are some manual steps that must be completed before initiating the automatic release, as before (steps 1-5 in docs/make_release.md).

Approach

The approach is similar to that introduced in modflow6 PR 1069: the release.yml workflow is triggered by pushing a release branch named e.g. v3.3.6rc or v3.3.6. If the branch name ends with rc, it's a dry run and the workflow ends after updating version files, recreating plugin classes, updating the changelog, and running tests and notebooks. If the branch name doesn't end with rc the release is considered approved and production-ready, and after the preceding steps a draft PR is created from the candidate branch into master. Merging this PR triggers a job to draft a release. The release post's content is the changelog since the last release. Publishing the release triggers a final job to publish the Python package to PyPI. Opening a PR to update conda-forge/flopy-feedstock was considered but does not seem necessary as there seems to be a bot which auto-detects package updates and creates PRs for us.

Refactoring

A version.txt file is added in the project root. Functionality from scripts/make-release.py and scripts/update-version_changes.py is consolidated in scripts/update_version.py, which acquires a file lock and updates version numbers and timestamps, first in version.txt then in other files including flopy/version.py, README.md, etc. Sample usage:

python scripts/update_version.py -v 3.3.6 --approve

Changelogs are generated with git-cliff via orhun/git-cliff-action in the release workflow, and changes for each new release are automatically prepended to docs/version_changes.md, so code in scripts/update-version_changes.py is removed. A cliff.toml config file is added in the project root. The format of docs/version_changes.md is standardized. The updated procedure is described in docs/make_release.md.

get-modflow

  • Fix extension handling issues I introduced in fix(get-modflow): fix code.json handling #1641
  • Restore previous --subset matching behavior to include *dbl variants
  • Split get-modflow script test cases by valid/invalid options for finer-grained debugging
  • Ignore code.json for modflow6 and modflow6-nightly-build repos since they use a different format than executables

The first two items are a result of my jumping the gun in #1641 and "fixing" a test that was only failing due to temporary state of the executables repo releases.

Miscellanous

  • sort etc/environment.yml
  • lint autotest files and notebook utilities
  • add pytest-dotenv as a testing dependency (allows defining environment variables e.g. GITHUB_TOKEN in a .env file)

@codecov
Copy link

codecov bot commented Dec 2, 2022

Codecov Report

Merging #1642 (62c8a2d) into develop (3131e97) will increase coverage by 0.0%.
The diff coverage is 100.0%.

@@           Coverage Diff           @@
##           develop   #1642   +/-   ##
=======================================
  Coverage     72.8%   72.8%           
=======================================
  Files          251     251           
  Lines        54517   54515    -2     
=======================================
+ Hits         39689   39719   +30     
+ Misses       14828   14796   -32     
Impacted Files Coverage Δ
flopy/utils/get_modflow.py 63.9% <100.0%> (+6.5%) ⬆️
flopy/utils/parse_version.py 55.5% <0.0%> (-0.4%) ⬇️
flopy/utils/gridintersect.py 78.9% <0.0%> (+0.5%) ⬆️

@wpbonelli wpbonelli force-pushed the automate-release branch 6 times, most recently from fe4200f to 8865b8b Compare December 14, 2022 13:05
@wpbonelli wpbonelli marked this pull request as ready for review December 14, 2022 13:10
@wpbonelli wpbonelli changed the title refactor(scripts/ci): refactor dist scripts, automate release Automate release Dec 14, 2022
@wpbonelli wpbonelli merged commit 0c71721 into modflowpy:develop Dec 14, 2022
@wpbonelli wpbonelli deleted the automate-release branch December 14, 2022 15:09
wpbonelli added a commit to wpbonelli/flopy that referenced this pull request Dec 14, 2022
wpbonelli added a commit to wpbonelli/flopy that referenced this pull request Dec 14, 2022
wpbonelli added a commit to wpbonelli/flopy that referenced this pull request Dec 14, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants