-
-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into pre-commit-ci-update-config
- Loading branch information
Showing
44 changed files
with
1,327 additions
and
743 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
name: Package and upload artifacts | ||
description: Package a Python project and upload the artifacts and release notes | ||
inputs: | ||
tag-name: | ||
description: 'The name of the tag for the GitHub release' | ||
required: true | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- name: Parse changelog for release notes | ||
shell: bash | ||
run: | | ||
function extract_version_content() { | ||
changelog=$1 | ||
target_version=$2 | ||
awk -v target="$target_version" ' | ||
/^## / { | ||
if (found) exit; | ||
version=$2; | ||
if (version == target) found=1; | ||
next; | ||
} | ||
found { print; } | ||
' <<< "$changelog" | ||
} | ||
changelog=$(cat "CHANGELOG.md") | ||
target_version=${{ inputs.tag-name }} | ||
echo "TAG_NAME=$target_version" >> $GITHUB_ENV | ||
content=$(extract_version_content "$changelog" "$target_version") | ||
if [ -n "$content" ]; then | ||
echo "::notice::Found release notes for ${target_version}" | ||
echo "$content" >> release-notes.md | ||
else | ||
echo "::warning::Did not find release notes for ${target_version}" | ||
touch release-notes.md | ||
fi | ||
- name: Upload release notes | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: release-notes | ||
path: release-notes.md | ||
|
||
- name: Package and upload artifacts | ||
if: ${{ env.PACKAGE == 'true' }} | ||
uses: hynek/build-and-inspect-python-package@v2 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Release | ||
description: Create a GitHub release and upload the package to PyPI | ||
inputs: | ||
pypi-api-token: | ||
description: 'PyPI API token' | ||
required: true | ||
tag-name: | ||
description: 'The name of the tag for the GitHub release' | ||
required: true | ||
|
||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Download packages built by build-and-inspect-python-package | ||
uses: actions/download-artifact@v4 | ||
with: | ||
path: artifacts | ||
|
||
- name: Download packages built by build-and-inspect-python-package | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: Packages | ||
path: dist | ||
|
||
- name: Download release notes | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: release-notes | ||
|
||
- name: Create a GitHub release | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: dist/* | ||
tag_name: "${{ env.TAG_NAME }}" | ||
body_path: release-notes.md | ||
|
||
- name: Upload package to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
password: ${{ inputs.pypi-api-token }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: checkout-and-setup-python | ||
description: 'Checkout the repository and setup Python' | ||
inputs: | ||
python-version: | ||
description: 'Python version to use' | ||
required: false | ||
default: '3.11' | ||
runs: | ||
using: 'composite' | ||
steps: | ||
- uses: actions/setup-python@v4 | ||
name: Setup Python | ||
with: | ||
python-version: ${{ inputs.python-version }} | ||
cache: 'pip' # caching pip dependencies | ||
|
||
- name: Git check | ||
run: | | ||
git config --global user.email "[email protected]" | ||
git config --global user.name "Testing Git" | ||
git --version | ||
git config --list | ||
shell: bash |
This file was deleted.
Oops, something went wrong.
File renamed without changes.
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
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
Oops, something went wrong.