Skip to content

Commit

Permalink
Update Release Action for Trusted Publisher (#342)
Browse files Browse the repository at this point in the history
* Update Release Action for Trusted Publisher

* Update release documentation

* 0.26 Release
  • Loading branch information
WillKoehrsen authored Feb 27, 2024
1 parent b5fda71 commit eabb34a
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 13 deletions.
20 changes: 13 additions & 7 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,19 @@ on:
release:
types: [published]

name: Release
name: Build and Release
jobs:
pypi-release:
runs-on: ubuntu-latest
# Uses trusted published from GitHub Actions. No need
# for credentials or API tokens.
# https://docs.pypi.org/trusted-publishers/using-a-publisher/
environment:
name: pypi
url: https://pypi.org/p/gridstatus
permissions:
id-token: write # IMPORTANT: mandatory for trusted publishing

steps:
- name: Check out code
uses: actions/checkout@v3
Expand All @@ -27,15 +36,12 @@ jobs:
exit 1
fi
- name: Configure Poetry for PyPI
run: |
poetry config http-basic.pypi ${{ secrets.PYPI_USERNAME }} ${{ secrets.PYPI_PASSWORD }}
- name: Install dependencies
run: poetry install

- name: Build package
run: poetry build

- name: Publish package to PyPI
run: poetry publish
# https://github.com/pypa/gh-action-pypi-publish
- name: Publish package distributions to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

## v0.26.0 - TBD

- Last release supporting pandas <2
- Add ERCOT DAM System Lambda (`ercot.get_dam_system_lambda`)
- Add ISONE solar and wind forecasts (`isone.get_solar_forecast` and `isone.get_wind_forecast`)

## v0.25.0 - Feb 20, 2024

Expand Down
2 changes: 1 addition & 1 deletion gridstatus/tests/test_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


def test_version():
assert __version__ == "0.25.0"
assert __version__ == "0.26.0"
2 changes: 1 addition & 1 deletion gridstatus/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.25.0"
__version__ = "0.26.0"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "gridstatus"
version = "0.25.0"
version = "0.26.0"
readme = "README.md"
description = "API to access energy data"
classifiers = [
Expand Down
7 changes: 4 additions & 3 deletions release.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# How to release

1. Bump version in `pyproject.toml`, `gridstatus/version.py` and `gridstatus/tests/test_version.py`
1. Bump version in `pyproject.toml`, `gridstatus/version.py`, and `gridstatus/tests/test_version.py`
2. Run `poetry run python ./docs/update_docs.py` to update methods in docs
3. Run `make test-slow' to ensure slow test that CI doesn't check are passing
3. Run `make test-slow` to ensure slow test that CI doesn't check are passing
4. Update `CHANGELOG.md` to reflect changes made since the previous release and the date of the release
5. Make release on GitHub and tag it with a matching version number
5. Make release on GitHub and tag it with a matching version number. The tag must start with `v` and be followed by the version number. For example, `v0.1.0`
a. The `release.yaml` workflow will publish the package to PyPI after the release has been published.
6. Confirm package was uploaded to [PyPi](https://pypi.org/project/gridstatus/)

0 comments on commit eabb34a

Please sign in to comment.