From fb9a69e35e9627bb5323f13c80884d21168d9cea Mon Sep 17 00:00:00 2001 From: Joshua Date: Fri, 11 Aug 2023 09:45:13 -0500 Subject: [PATCH 1/3] Add release workflow --- .github/workflows/release.yml | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..da8a4d6 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,36 @@ +name: Release Package + +on: + push: + tags: ["release-*"] + +permissions: + contents: read + +jobs: + build_package: + name: Build Package + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - name: Build sdist and wheel + run: pipx run build --sdist --wheel + - uses: actions/upload-artifact@v3 + with: + path: dist + + pypi-publish: + needs: [build_package] + name: Upload release to PyPI + runs-on: ubuntu-latest + environment: + name: pypi + permissions: + id-token: write + steps: + - uses: actions/download-artifact@v3 + with: + name: artifact + path: dist + - name: Publish package distributions to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 From 00cf027449d7d85133059c8cd3adfa8177e26713 Mon Sep 17 00:00:00 2001 From: Joshua Date: Fri, 11 Aug 2023 09:49:24 -0500 Subject: [PATCH 2/3] Fix errors --- README.md | 22 ++++++++++++---------- setup.py | 4 ++-- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index b6ef115..30c3614 100644 --- a/README.md +++ b/README.md @@ -9,6 +9,7 @@ Improved colored diff Download the [latest](https://github.com/jeffkaufman/icdiff/tags) `icdiff` and put it on your PATH. Alternatively, install with packaging tools: + ``` # pip pip install icdiff @@ -35,6 +36,7 @@ icdiff [options] left_file right_file Show differences between files in a two column view. ### Options + ``` --version show program's version number and exit -h, --help show this help message and exit @@ -146,17 +148,17 @@ pip install -r requirements-dev.txt ## Making a release -* Update ChangeLog with all the changes since the last release -* Update `__version__` in `icdiff` -* Run tests, make sure they pass -* `git commit -a -m "release ${version}"` -* `git push` -* `git tag release-${version}` -* `git push origin release-${version}` -* `./prepare-release.sh ${prev-version} ${version}` -* `python3 -m twine upload icdiff-${version}.tar.gz --user "__token__" --password "$TOKEN"` +- Update ChangeLog with all the changes since the last release +- Update `__version__` in `icdiff` +- Run tests, make sure they pass +- `git commit -a -m "release ${version}"` +- `git push` +- `git tag release-${version}` +- `git push origin release-${version}` +- `./prepare-release.sh ${prev-version} ${version}` +- `python3 -m twine upload icdiff-${version}.tar.gz --user "__token__" --password "$TOKEN"` ## License This file is derived from `difflib.HtmlDiff` which is under [license](https://www.python.org/download/releases/2.6.2/license/). -I release my changes here under the same license. This is GPL compatible. +I release my changes here under the same license. This is GPL compatible. diff --git a/setup.py b/setup.py index 1825333..2b0c517 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,4 @@ -from distutils.util import convert_path -from setuptools import setup, find_packages +from setuptools import setup from icdiff import __version__ setup( @@ -16,6 +15,7 @@ author_email="jeff@jefftk.com", description="improved colored diff", long_description=open('README.md').read(), + long_description_content_type='text/markdown', scripts=['git-icdiff'], py_modules=['icdiff'], entry_points={ From d3b8fbce23c294e4930dd23b1b41398028660824 Mon Sep 17 00:00:00 2001 From: Joshua Date: Fri, 11 Aug 2023 09:54:38 -0500 Subject: [PATCH 3/3] Remove old instructions --- README.md | 3 +-- prepare-release.sh | 28 ---------------------------- 2 files changed, 1 insertion(+), 30 deletions(-) delete mode 100755 prepare-release.sh diff --git a/README.md b/README.md index 30c3614..fa5aba3 100644 --- a/README.md +++ b/README.md @@ -155,8 +155,7 @@ pip install -r requirements-dev.txt - `git push` - `git tag release-${version}` - `git push origin release-${version}` -- `./prepare-release.sh ${prev-version} ${version}` -- `python3 -m twine upload icdiff-${version}.tar.gz --user "__token__" --password "$TOKEN"` +- A GitHub Action should be triggered due to the release tag being pushed, and will upload to PyPI. ## License diff --git a/prepare-release.sh b/prepare-release.sh deleted file mode 100755 index d7ebba9..0000000 --- a/prepare-release.sh +++ /dev/null @@ -1,28 +0,0 @@ -# I don't know what I'm doing, I just want to get a release out. - -if [[ "$#" != 2 ]]; then - echo "usage: $0 " - echo "ex: $0 2.0.3 2.0.4" - exit 1 -fi - -PREV="$1" -VERSION="$2" - -GITDIR="$(dirname "$0")" -PREVDIR="icdiff-$PREV" -OUTDIR="icdiff-$VERSION" -OUTTAR="$OUTDIR.tar.gz" - -rm -r "$OUTDIR" || true -cp -r "$PREVDIR" "$OUTDIR" - -for x in icdiff.py README.md git-icdiff LICENSE; do - cp "$GITDIR/$x" "$OUTDIR/$x" -done - -sed "s/Version: $PREV/Version: $VERSION/" "$OUTDIR/PKG-INFO" \ - > "$OUTDIR/PKG-INFO.2" -mv "$OUTDIR/PKG-INFO.2" "$OUTDIR/PKG-INFO" -cp "$OUTDIR/PKG-INFO" "$OUTDIR/icdiff.egg-info/" -tar -cvzf "$OUTTAR" "$OUTDIR/"*