Skip to content

Commit

Permalink
ci(release): remove post-release reset step (#1856)
Browse files Browse the repository at this point in the history
  • Loading branch information
wpbonelli committed Jun 29, 2023
1 parent b8dffbc commit 4e873e0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 72 deletions.
70 changes: 0 additions & 70 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -237,73 +237,3 @@ jobs:

- name: Publish to PyPI
run: python -m twine upload dist/*

reset:
name: Draft reset PR
if: ${{ github.event_name == 'release' }}
runs-on: ubuntu-22.04
permissions:
contents: write
pull-requests: write
defaults:
run:
shell: bash -l {0}
steps:

- name: Checkout master branch
uses: actions/checkout@v3
with:
ref: master

- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.8
cache: 'pip'
cache-dependency-path: pyproject.toml

- name: Install Python dependencies
run: |
pip install --upgrade pip
pip install build twine
pip install .
pip install ".[lint, test, optional]"
- name: Get release tag
uses: oprypin/find-latest-tag@v1
id: latest_tag
with:
repository: ${{ github.repository }}
releases-only: true

- name: Draft pull request
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
# create reset branch from master
reset_branch="post-release-${{ steps.latest_tag.outputs.tag }}-reset"
git switch -c $reset_branch
# update version string (append '+' to indicate development status)
version=$(cat version.txt)
version="$version+"
python scripts/update_version.py -v "$version"
# lint Python files
python scripts/pull_request_prepare.py
# commit and push reset branch
git config core.sharedRepository true
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add -A
git commit -m "ci(release): update to version $version"
git push -u origin $reset_branch
# create PR into develop
body='
# Reinitialize for development
Updates the `develop` branch from `master` following a successful release.
'
gh pr create -B "develop" -H "$reset_branch" --title "Reinitialize develop branch" --draft --body "$body"
4 changes: 2 additions & 2 deletions docs/make_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ If the branch name does not end with `rc`, the workflow will proceed to open a P

**Note:** the PR should be merged, not squashed. Squashing removes the commit history from the `master` branch and causes `develop` and `master` to diverge, which can cause future PRs updating `master` to replay commits from previous releases.

Publishing the release triggers jobs to publish the `flopy` package to PyPI and open a PR updating `develop` from `master`. This PR also updates version numbers to the just-released version, and appends "+" to the end of the version string to indicate development status.
Publishing the release triggers a final job to publish the `flopy` package to PyPI.

##### Trusted publishing

Expand Down Expand Up @@ -109,7 +109,7 @@ As described above, making a release manually involves the following steps:

1. Merge the `master` branch into the `develop` branch.

2. Set the version as appropriate: `python scripts/update_version.py -v <semver>`.
2. Set the development version as appropriate: `python scripts/update_version.py -v <version>`. The version number must comply with [PEP 440](https://peps.python.org/pep-0440/).

3. Lint Python files: `python scripts/pull_request_prepare.py`

Expand Down

0 comments on commit 4e873e0

Please sign in to comment.