release: prepare for v0.5.16 #1
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Release | |
on: | |
push: | |
tags: | |
- v*.*.* | |
jobs: | |
build: | |
# Build the Python SDist and wheel, performs metadata and readme linting | |
name: Build and verify package | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: hynek/build-and-inspect-python-package@v2 | |
release: | |
# Publish a GitHub release from the given git tag | |
name: Create GitHub Release | |
needs: [build] | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: softprops/action-gh-release@v2 | |
with: | |
generate_release_notes: true | |
publish: | |
# Publish the built SDist and wheel from "dist" job to PyPI | |
name: Publish to PyPI | |
needs: [build] | |
runs-on: ubuntu-latest | |
environment: | |
name: pypi | |
url: https://pypi.org/project/powerplantmatching/ | |
permissions: | |
id-token: write | |
steps: | |
- uses: actions/download-artifact@v4 | |
with: | |
name: Packages | |
path: dist | |
- uses: pypa/gh-action-pypi-publish@release/v1 | |
update-dataset: | |
name: Update powerplants.csv in repository | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
ref: master | |
- name: Fetch all history for all tags and branches (necessary for setuptools_scm) | |
run: git fetch --prune --unshallow | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- name: Install package | |
run: | | |
python -m pip install --upgrade pip | |
pip install .[dev] | |
- name: Create dataset | |
run: | | |
import powerplantmatching as pm | |
df = pm.powerplants(update=True) | |
df.to_csv("powerplants.csv", index_label="id") | |
shell: python | |
- name: Commit and push changes | |
run: | | |
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
git checkout master | |
git pull origin master | |
git add powerplants.csv | |
git commit -m '[github-actions.ci] auto update `powerplants.csv`' || exit 0 | |
git push origin master | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |