-
-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
6 additions
and
65 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,24 +76,6 @@ jobs: | |
with: | ||
python-version: "3.11" | ||
architecture: "x64" | ||
- name: Generate release changelog | ||
run: | | ||
pip install "python-semantic-release==7.32.2" | ||
semantic-release changelog -v DEBUG > RELEASE_CHANGELOG | ||
env: | ||
GH_TOKEN: ${{ secrets.GH_PAT }} | ||
- name: Archive release changelog | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: changelog | ||
path: | | ||
RELEASE_CHANGELOG | ||
- name: Remove release changelog | ||
run: rm -f RELEASE_CHANGELOG | ||
- name: Python semantic release | ||
uses: relekang/python-semantic-release@master | ||
with: | ||
github_token: ${{ secrets.GH_PAT }} | ||
release: | ||
runs-on: ubuntu-latest | ||
needs: prepare_release | ||
|
@@ -112,51 +94,9 @@ jobs: | |
- name: Display dist | ||
run: ls -R | ||
working-directory: dist | ||
- name: Capture package version | ||
id: package_version | ||
run: | | ||
tar xvzf dist/*.tar.gz --no-anchored --strip=1 PKG-INFO | ||
VERSION=$(grep "^Version" PKG-INFO | tr -d ' ' | cut -d: -f2) | ||
rm -f PKG-INFO | ||
echo "Package version: $VERSION" | ||
echo "package_version=v$VERSION" >> $GITHUB_ENV | ||
- name: Capture current commit tag | ||
id: git_tag | ||
run: | | ||
TAG_VERSION=$(git tag --points-at HEAD) | ||
echo "Current tag: $TAG_VERSION" | ||
echo "current_tag=$TAG_VERSION" >> $GITHUB_ENV | ||
- name: Capture release version | ||
id: release_version | ||
run: | | ||
pip install "python-semantic-release==7.32.2" | ||
s=$(semantic-release version --noop 2>&1 | grep "Should have bumped from") | ||
RELEASE_VERSION= | ||
if [[ "$s" =~ ^.*to' '(.+?)$ ]]; then | ||
RELEASE_VERSION=${BASH_REMATCH[1]} | ||
fi | ||
echo "release_version=$RELEASE_VERSION" >> $GITHUB_ENV | ||
- name: Download release changelog | ||
uses: actions/download-artifact@v2 | ||
if: github.event_name == 'push' && env.release_version != env.package_version | ||
with: | ||
name: changelog | ||
- name: Create release | ||
id: create_release | ||
if: github.event_name == 'push' && env.release_version != env.package_version | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
body_path: RELEASE_CHANGELOG | ||
draft: false | ||
name: Release ${{ env.release_version }} | ||
prerelease: false | ||
tag_name: ${{ env.release_version }} | ||
token: ${{ secrets.GH_PAT }} | ||
- name: Delete RELEASE_CHANGELOG | ||
run: rm -f RELEASE_CHANGELOG | ||
- name: Upload to PyPI | ||
if: github.event_name == 'push' && env.release_version != env.package_version | ||
uses: pypa/gh-action-pypi-publish@master | ||
- name: Python semantic release | ||
uses: relekang/[email protected] | ||
with: | ||
user: __token__ | ||
password: ${{ secrets.PYPI_TOKEN }} | ||
github_token: ${{ secrets.GH_PAT }} | ||
repository_username: __token__ | ||
repository_password: ${{ secrets.PYPI_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