diff --git a/.github/release_workflow.md b/.github/release_workflow.md new file mode 100644 index 000000000..5308083b0 --- /dev/null +++ b/.github/release_workflow.md @@ -0,0 +1,34 @@ +# Release Workflow + +This document outlines the release workflow for publishing to PyPI and TestPyPI using GitHub Actions. + +## Creating a New Release + +To create a new release, follow these steps: + +1. **Prepare the Release:** + - Create a new branch for the release (i.e. `v24.XX`) from `develop`. + - Increment the following; + - The version number in the `pyproject.toml` file following CalVer versioning. + - The`CHANGELOG.md` version with the changes for the new version. + - Open a PR to the `main` branch. Once the PR is merged, proceed to the next step. + +2. **Tag the Release:** + - Create a new Git tag for the release. For a full release, use a tag like `v24.2`. For a release candidate, use a tag like `v24.2rc.1`. + - Push the tag to the remote repository: `git push origin `. + +3. **Create a GitHub Release:** + - Go to the "Releases" section of on GitHub. + - Click "Draft a new release." + - Enter the tag you created in the "Tag version" field. + - Fill in the release title and description. Add any major changes and link to the `CHANGELOG.md` for a list of total changes. + - If it's a pre-release (release candidate), check the "This is a pre-release" checkbox. + - Click "Publish release" to create the release. + +4. **Monitor the Workflow:** + - Go to the "Actions" tab of your repository to monitor the workflow's progress. + - The workflow will build the distribution packages and then publish them to PyPI or TestPyPI, depending on whether the release is a full release or a pre-release. + +5. **Verify the Release:** + - Check PyPI or TestPyPI to ensure that your package is available and has been updated to the new version. + - Test installing the package using `pip` to ensure everything works as expected. diff --git a/.github/workflows/release_action.yaml b/.github/workflows/release_action.yaml index 8cbaa5f4f..12a0f5204 100644 --- a/.github/workflows/release_action.yaml +++ b/.github/workflows/release_action.yaml @@ -15,7 +15,7 @@ jobs: - name: Set up Python uses: actions/setup-python@v4 with: - python-version: "3.8" + python-version: "3.12" - name: Install pypa/build run: >- python3 -m @@ -23,7 +23,7 @@ jobs: build --user - name: Build a binary wheel and a source tarball - run: python3 -m build + run: python -m build - name: Store the distribution packages uses: actions/upload-artifact@v3 with: @@ -35,9 +35,8 @@ jobs: Publish Python 🐍 distribution 📦 to PyPI if: > startsWith(github.ref, 'refs/tags/') && - !contains(github.ref, 'rc') - needs: - - build + !contains(github.ref, 'rc') && github.repository == github.event.repository + needs: build runs-on: ubuntu-latest environment: name: pypi @@ -91,7 +90,7 @@ jobs: publish-to-testpypi: name: Publish Python 🐍 distribution 📦 to TestPyPI - if: contains(github.ref, 'rc') # only publish to TestPyPI for rc tags + if: contains(github.ref, 'rc') && github.repository == github.event.repository # only publish to TestPyPI for rc tags needs: - build runs-on: ubuntu-latest diff --git a/CHANGELOG.md b/CHANGELOG.md index 283dd7e6a..1690e8130 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ ## Features +- [#215](https://github.com/pybop-team/PyBOP/pull/215) - Adds `release_workflow.md` and updates `release_action.yaml` - [#204](https://github.com/pybop-team/PyBOP/pull/204) - Splits integration, unit, examples, plots tests, update workflows. Adds pytest `--examples`, `--integration`, `--plots` args. Adds tests for coverage after removal of examples. Adds examples and integrations nox sessions. Adds `pybop.RMSE._evaluateS1()` method - [#206](https://github.com/pybop-team/PyBOP/pull/206) - Adds Python 3.12 support with corresponding github actions changes. - [#18](https://github.com/pybop-team/PyBOP/pull/18) - Adds geometric parameter fitting capability, via `model.rebuild()` with `model.rebuild_parameters`.