From 32cd107edc50bf2dece5f02c455b873daa897a63 Mon Sep 17 00:00:00 2001 From: Bert Blommers Date: Sun, 3 Dec 2023 18:42:55 -0100 Subject: [PATCH] Automate release process --- .github/workflows/release.yml | 60 +++++++++++++++++++++++++++++++++++ CHANGELOG | 3 ++ 2 files changed, 63 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 00000000..5f6f35d7 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,60 @@ +name: Release + +on: + workflow_dispatch: + inputs: + version: + description: 'Version' + required: true + +jobs: + release-freezegun: + runs-on: ubuntu-latest + name: Release FreezeGun + permissions: + contents: write + id-token: write + env: + VERSION: 0.0.0 + steps: + - name: Set Env + run: | + echo "VERSION=${{ github.event.inputs.version }}" >> $GITHUB_ENV + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Set up Python 3.10 + uses: actions/setup-python@v4 + with: + python-version: "3.10" + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install wheel setuptools packaging twine build --upgrade + - name: Verify Tag does not exist + run: | + ! git rev-parse ${{ env.VERSION }} || { echo "Ensure that no tag exists for ${{ env.VERSION }}" ; exit 1; } + - name: Set version number + run: sed -i "s/__version__ =.*/__version__ = '${{ env.VERSION }}'/g" freezegun/__init__.py + - name: Build Python + run: python -m build + - name: Publish to PyPI + uses: pypa/gh-action-pypi-publish@release/v1 + - name: Tag version on Github + run: | + git tag ${{ env.VERSION }} + git push origin ${{ env.VERSION }} + - name: Create GitHub release + uses: softprops/action-gh-release@v1 + with: + name: ${{ env.VERSION }} + tag_name: ${{ env.VERSION }} + files: dist/* + - name: Increase patch version number + if: ${{ inputs.current_release }} + run: | + git config --local user.email "6058517+bblommers@users.noreply.github.com" + git config --local user.name "FreezeGun Admin" + git add freezegun/__init__.py + git commit -m "Increase version number" + git push diff --git a/CHANGELOG b/CHANGELOG index 43fab75a..cec8cd3f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,6 +6,9 @@ Freezegun Changelog * Fixed `asyncio` support to avoid `await asyncio.sleep(1)` hanging forever. +* Added support for Python 3.12 + + 1.2.2 -----