Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gha for release notes - #543 #604

Merged
merged 7 commits into from
Jun 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
jGaboardi marked this conversation as resolved.
Show resolved Hide resolved
- 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose that this will conflict with Create GitHub Release above

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suppose that this will conflict with Create GitHub Release above

Yeah, more than likely. We will have to work that out iteratively seems like.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need one or the other. Also note that removing the one above will break the last one which uses steps.create_release.outputs.upload_url. In any case, actions/create-release is archived so we shall find a new way of doing things.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I actually think things are more simple than I thought. We can simply prune down the current momepy action to get our desired result. That final step

We can see in the v0.7.0 release there are 3 assets there.

  • momepy-0.7.0.tar.gz
  • Source code (zip)
  • Source code (tar.gz)

However, momepy-0.7.0.tar.gz and Source code (tar.gz) are the exact same thing, just different names - that's what Upload Release Asset (sdist) to GitHub is doing (and it's not needed).

I'm going to make some adjustments and push up (what I hope is) the fix.

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
Loading