Skip to content

Commit 24cba44

Browse files
GHA: gha for release notes - pysal#543 (pysal#604)
* starting pysal#543 * Update .github/release.yml Co-authored-by: Martin Fleischmann <[email protected]> * remove log, update docs, adjust labels * adjust labels again * add api and depr labels * streamlined release workflow --------- Co-authored-by: Martin Fleischmann <[email protected]>
1 parent e6b0abf commit 24cba44

File tree

5 files changed

+40
-280
lines changed

5 files changed

+40
-280
lines changed

.github/release.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
changelog:
2+
exclude:
3+
labels:
4+
- ignore-for-release
5+
authors:
6+
- dependabot
7+
- pre-commit-ci
8+
categories:
9+
- title: API Changes
10+
labels: api
11+
- title: Enhancements
12+
labels:
13+
- enhancement
14+
- title: Bug Fixes
15+
labels:
16+
- bug
17+
- title: Deprecations
18+
labels:
19+
- deprecation
20+
- title: Documentation
21+
labels:
22+
- documentation
23+
- title: Other Changes
24+
labels:
25+
- "*"

.github/workflows/release_to_pypi.yml

+14-27
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ jobs:
1212

1313
steps:
1414
- uses: actions/checkout@v4
15+
with:
16+
fetch-depth: 0 # Fetch all history for all branches and tags.
1517

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

2123
- name: Build source and wheel distributions
2224
run: |
25+
python -m pip install --upgrade pip
2326
python -m pip install --upgrade build twine
2427
python -m build
2528
twine check --strict dist/*
2629
30+
- name: Create Release Notes
31+
uses: actions/github-script@v7
32+
with:
33+
github-token: ${{secrets.GITHUB_TOKEN}}
34+
script: |
35+
await github.request(`POST /repos/${{ github.repository }}/releases`, {
36+
tag_name: "${{ github.ref }}",
37+
generate_release_notes: true
38+
});
39+
2740
- name: Publish distribution to PyPI
2841
uses: pypa/gh-action-pypi-publish@release/v1
2942
with:
3043
user: __token__
3144
password: ${{ secrets.pypi_password }}
3245

33-
- name: Create GitHub Release
34-
id: create_release
35-
uses: actions/create-release@v1
36-
env:
37-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
38-
with:
39-
tag_name: ${{ github.ref }}
40-
release_name: Version ${{ github.ref }}
41-
draft: false
42-
prerelease: false
43-
44-
- name: Get Asset name
45-
run: |
46-
export PKG=$(ls dist/ | grep tar)
47-
set -- $PKG
48-
echo "name=$1" >> $GITHUB_ENV
49-
50-
- name: Upload Release Asset (sdist) to GitHub
51-
id: upload-release-asset
52-
uses: actions/upload-release-asset@v1
53-
env:
54-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
55-
with:
56-
upload_url: ${{ steps.create_release.outputs.upload_url }}
57-
asset_path: dist/${{ env.name }}
58-
asset_name: ${{ env.name }}
59-
asset_content_type: application/zip
46+

CHANGELOG.md

-251
This file was deleted.

docs/changelog.rst

-1
This file was deleted.

docs/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ Documentation contents
153153
examples/index
154154
API reference <api>
155155
Contributing <contributing>
156-
changelog
156+
Changelog <https://github.com/pysal/momepy/releases>
157157
references
158158

159159

0 commit comments

Comments
 (0)