From 349eb86b644cca0cac175ce6c860865c2a1e626d Mon Sep 17 00:00:00 2001 From: robbievanleeuwen Date: Wed, 27 Nov 2024 10:32:48 +0000 Subject: [PATCH 1/2] Bump version to v0.2.0 --- .github/release-drafter.yml | 66 +++++++++++++++++++++++++++++++++ .github/workflows/release.yml | 70 +++++++++++++++++++++++++++++++++++ pyproject.toml | 2 +- 3 files changed, 137 insertions(+), 1 deletion(-) create mode 100644 .github/release-drafter.yml create mode 100644 .github/workflows/release.yml diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml new file mode 100644 index 0000000..c66aa8e --- /dev/null +++ b/.github/release-drafter.yml @@ -0,0 +1,66 @@ +categories: + - title: ":boom: Breaking Changes" + label: "breaking" + + - title: ":rocket: Features" + label: "enhancement" + + - title: ":fire: Removals and Deprecations" + label: "removal" + + - title: ":bug: Fixes" + label: "bug" + + - title: ":racehorse: Performance" + label: "performance" + + - title: ":rotating_light: Testing" + label: "testing" + + - title: ":construction_worker: Continuous Integration" + label: "ci" + + - title: ":books: Documentation" + label: "documentation" + + - title: ":hammer: Refactoring" + label: "refactoring" + + - title: ":lipstick: Style" + label: "style" + + - title: ":package: Dependencies" + labels: + - "dependencies" + - "build" + +category-template: "### $TITLE" +name-template: "v$RESOLVED_VERSION" +tag-template: "v$RESOLVED_VERSION" + +version-resolver: + major: + labels: + - "major" + minor: + labels: + - "minor" + patch: + labels: + - "patch" + default: patch + +# Custom text at start of release +header: > + + Initial release. + +template: | + + ## What's Changed + + $CHANGES + +footer: | + + **Full changelog:** [$PREVIOUS_TAG...v$RESOLVED_VERSION](https://github.com/robbievanleeuwen/upgrade-dependencies/compare/$PREVIOUS_TAG...v$RESOLVED_VERSION) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..0c43555 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,70 @@ +name: Release + +on: + push: + branches: + - master + +env: + UV_VERSION: 0.5.4 + DEFAULT_PYTHON_VERSION: '3.13' + +jobs: + release: + name: Release + runs-on: ubuntu-latest + permissions: + id-token: write + contents: write + + steps: + - name: Check out the repository + uses: actions/checkout@v4 + with: + fetch-depth: 2 + + - name: Install uv version ${{ env.UV_VERSION }} + uses: astral-sh/setup-uv@v3 + with: + version: ${{ env.UV_VERSION }} + + - name: Install python ${{ env.DEFAULT_PYTHON_VERSION }} using uv + run: uv python install ${{ env.DEFAULT_PYTHON_VERSION }} + + - name: Get previous commit SHA + run: echo "sha=$(git rev-parse --verify --quiet HEAD^)" >> $GITHUB_ENV + + - name: Detect and tag new version + id: check-version + if: ${{ env.sha }} + uses: salsify/action-detect-and-tag-new-version@v2 + with: + version-command: echo $(grep "^version =" pyproject.toml | sed 's/version + = "\(.*\)"/\1/') + + - name: Bump version for dev release + if: '! steps.check-version.outputs.tag' + run: | + VERSION=$(grep "^version =" pyproject.toml | sed 's/version = "\(.*\)"/\1/') + uvx --from=toml-cli toml set --toml-path=pyproject.toml project.version $VERSION.dev.$(date +%s) + + - name: Build package + run: uv build + + - name: Publish package on PyPI + if: steps.check-version.outputs.tag + uses: pypa/gh-action-pypi-publish@release/v1 + + - name: Publish package on TestPyPI + if: '! steps.check-version.outputs.tag' + uses: pypa/gh-action-pypi-publish@release/v1 + with: + repository-url: https://test.pypi.org/legacy/ + + - name: Publish the release notes + uses: release-drafter/release-drafter@v6 + with: + publish: ${{ steps.check-version.outputs.tag != '' }} + tag: ${{ steps.check-version.outputs.tag }} + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/pyproject.toml b/pyproject.toml index ac70a3a..8d68a17 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "upgrade-dependencies" -version = "0.1.0" +version = "0.2.0" description = "Creates PRs for dependency updates in python projects" readme = "README.md" license = {file = "LICENSE"} From fabc8e93f2cfdee7f3bdc30d390ec31af843daf3 Mon Sep 17 00:00:00 2001 From: robbievanleeuwen Date: Wed, 27 Nov 2024 10:33:39 +0000 Subject: [PATCH 2/2] Update uv.lock --- uv.lock | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/uv.lock b/uv.lock index 04c928b..744c419 100644 --- a/uv.lock +++ b/uv.lock @@ -1328,7 +1328,7 @@ wheels = [ [[package]] name = "upgrade-dependencies" -version = "0.1.0" +version = "0.2.0" source = { editable = "." } dependencies = [ { name = "httpx" },