Skip to content

Commit

Permalink
GHA: gha for release notes - #543 (#604)
Browse files Browse the repository at this point in the history
* starting #543

* Update .github/release.yml

Co-authored-by: Martin Fleischmann <martin@martinfleischmann.net>

* remove log, update docs, adjust labels

* adjust labels again

* add api and depr labels

* streamlined release workflow

---------

Co-authored-by: Martin Fleischmann <martin@martinfleischmann.net>
  • Loading branch information
jGaboardi and martinfleis committed Jun 16, 2024
1 parent e6b0abf commit 24cba44
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 280 deletions.
25 changes: 25 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
changelog:
exclude:
labels:
- ignore-for-release
authors:
- dependabot
- pre-commit-ci
categories:
- title: API Changes
labels: api
- title: Enhancements
labels:
- enhancement
- title: Bug Fixes
labels:
- bug
- title: Deprecations
labels:
- deprecation
- title: Documentation
labels:
- documentation
- title: Other Changes
labels:
- "*"
41 changes: 14 additions & 27 deletions .github/workflows/release_to_pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetch all history for all branches and tags.

- name: Set up Python
uses: actions/setup-python@v5
Expand All @@ -20,40 +22,25 @@ jobs:

- name: Build source and wheel distributions
run: |
python -m pip install --upgrade pip
python -m pip install --upgrade build twine
python -m build
twine check --strict dist/*
- name: Create Release Notes
uses: actions/github-script@v7
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
await github.request(`POST /repos/${{ github.repository }}/releases`, {
tag_name: "${{ github.ref }}",
generate_release_notes: true
});
- name: Publish distribution to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.pypi_password }}

- name: Create GitHub Release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
with:
tag_name: ${{ github.ref }}
release_name: Version ${{ github.ref }}
draft: false
prerelease: false

- name: Get Asset name
run: |
export PKG=$(ls dist/ | grep tar)
set -- $PKG
echo "name=$1" >> $GITHUB_ENV
- name: Upload Release Asset (sdist) to GitHub
id: upload-release-asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: dist/${{ env.name }}
asset_name: ${{ env.name }}
asset_content_type: application/zip

251 changes: 0 additions & 251 deletions CHANGELOG.md

This file was deleted.

1 change: 0 additions & 1 deletion docs/changelog.rst

This file was deleted.

2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ Documentation contents
examples/index
API reference <api>
Contributing <contributing>
changelog
Changelog <https://github.com/pysal/momepy/releases>
references


Expand Down

0 comments on commit 24cba44

Please sign in to comment.