diff --git a/.ci/scripts/check_click_for_mypy.py b/.ci/scripts/check_click_for_mypy.py index a905be7..408a7c6 100755 --- a/.ci/scripts/check_click_for_mypy.py +++ b/.ci/scripts/check_click_for_mypy.py @@ -1,9 +1,12 @@ #!/bin/env python3 -import click -from packaging.version import parse +from importlib import metadata -if parse(click.__version__) < parse("8.1.1") or parse(click.__version__) >= parse("8.2"): - print("🚧 Linting with mypy is currently only supported with click~=8.1.1. 🚧") - print("🔧 Please run `pip install click~=8.1.1` first. 🔨") - exit(1) +from packaging.version import Version + +if __name__ == "__main__": + click_version = Version(metadata.version("click")) + if click_version < Version("8.1.1"): + print("🚧 Linting with mypy is currently only supported with click>=8.1.1. 🚧") + print("🔧 Please run `pip install click>=8.1.1` first. 🔨") + exit(1) diff --git a/.github/dependabot.yml b/.github/dependabot.yml deleted file mode 100644 index 6c114b0..0000000 --- a/.github/dependabot.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -version: 2 -updates: -- package-ecosystem: "pip" - directory: "/" - schedule: - interval: "daily" - commit-message: - prefix: "[PIP] " - open-pull-requests-limit: 10 -- package-ecosystem: "pip" - directory: "/pulp-glue-maven" - schedule: - interval: "daily" - commit-message: - prefix: "[PIP] " - open-pull-requests-limit: 10 -- package-ecosystem: "github-actions" - directory: "/" - schedule: - interval: "weekly" - commit-message: - prefix: "[GHA] " - open-pull-requests-limit: 10 -... diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b594b0c..76f9d6c 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -19,7 +19,7 @@ jobs: - name: "Set up Python" uses: "actions/setup-python@v6" with: - python-version: "3.11" + python-version: "3.14" - name: "Install python dependencies" run: | pip install build setuptools wheel diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index d61a41c..b1dacdf 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -20,12 +20,12 @@ jobs: - name: "Checkout repository" uses: "actions/checkout@v5" - name: "Initialize CodeQL" - uses: "github/codeql-action/init@v4" + uses: "github/codeql-action/init@v3" with: languages: "python" - name: "Perform CodeQL Analysis" - uses: "github/codeql-action/analyze@v4" + uses: "github/codeql-action/analyze@v3" with: category: "/language:python" ... diff --git a/.github/workflows/collect_changes.yml b/.github/workflows/collect_changes.yml index 33d38c1..12da36c 100644 --- a/.github/workflows/collect_changes.yml +++ b/.github/workflows/collect_changes.yml @@ -14,7 +14,7 @@ jobs: fetch-depth: 0 - uses: "actions/setup-python@v6" with: - python-version: "3.11" + python-version: "3.x" - name: "Setup git" run: | git config user.name pulpbot @@ -25,10 +25,18 @@ jobs: python3 .ci/scripts/collect_changes.py - name: "Create Pull Request" uses: "peter-evans/create-pull-request@v7" + id: "create_pr" with: token: "${{ secrets.RELEASE_TOKEN }}" title: "Update Changelog" body: "" branch: "update_changes" delete-branch: true + - name: "Mark PR automerge" + run: | + gh pr merge --rebase --auto "${{ steps.create_pr.outputs.pull-request-number }}" + if: "steps.create_pr.outputs.pull-request-number" + env: + GH_TOKEN: "${{ secrets.RELEASE_TOKEN }}" + continue-on-error: true ... diff --git a/.github/workflows/cookiecutter.yml b/.github/workflows/cookiecutter.yml index f733beb..9f41dff 100644 --- a/.github/workflows/cookiecutter.yml +++ b/.github/workflows/cookiecutter.yml @@ -2,6 +2,8 @@ name: "Update CI from cookiecutter" on: workflow_dispatch: + schedule: + - cron: "30 20 * * 0" defaults: run: @@ -22,7 +24,7 @@ jobs: - name: "Set up Python" uses: "actions/setup-python@v6" with: - python-version: "3.11" + python-version: "3.x" - name: "Setup git" run: | git config user.name pulpbot @@ -55,4 +57,51 @@ jobs: env: GH_TOKEN: "${{ secrets.RELEASE_TOKEN }}" continue-on-error: true + update-dependencies: + runs-on: "ubuntu-latest" + steps: + - uses: "actions/checkout@v5" + with: + repository: "pulp/pulp-cli" + path: "pulp-cli" + - uses: "actions/checkout@v5" + with: + token: "${{ secrets.RELEASE_TOKEN }}" + path: "pulp-cli-maven" + - name: "Set up Python" + uses: "actions/setup-python@v6" + with: + python-version: "3.x" + - name: "Setup git" + run: | + git config user.name pulpbot + git config user.email pulp-infra@redhat.com + - name: "Install python dependencies" + run: | + pip install packaging tomlkit + - name: "Apply cookiecutter templates" + run: | + ../pulp-cli/cookiecutter/update_pulp_cli.py + if [ "$(git status --porcelain)" ] + then + git add . + git commit -m "Update CLI and GLUE" + fi + - name: "Create Pull Request" + uses: "peter-evans/create-pull-request@v7" + id: "create_pr" + with: + token: "${{ secrets.RELEASE_TOKEN }}" + title: "Update CLI and GLUE" + body: "" + branch: "update_cli" + delete-branch: true + path: "pulp-cli-maven" + - name: "Mark PR automerge" + run: | + gh pr merge --rebase --auto "${{ steps.create_pr.outputs.pull-request-number }}" + if: "steps.create_pr.outputs.pull-request-number" + env: + GH_TOKEN: "${{ secrets.RELEASE_TOKEN }}" + continue-on-error: true ... diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index bd4c50d..1c3ef64 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -12,7 +12,7 @@ jobs: matrix: python: - "3.11" - - "3.13" + - "3.14" steps: - uses: "actions/checkout@v5" - uses: "actions/cache@v4" diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index d623688..41d8d7f 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -32,7 +32,7 @@ jobs: - name: "Set up Python" uses: "actions/setup-python@v6" with: - python-version: "3.11" + python-version: "3.x" - name: "Install python dependencies" run: | pip install toml pygithub diff --git a/.github/workflows/pr_checks.yml b/.github/workflows/pr_checks.yml index 86f4932..0d3a228 100644 --- a/.github/workflows/pr_checks.yml +++ b/.github/workflows/pr_checks.yml @@ -24,7 +24,7 @@ jobs: fetch-depth: 0 - uses: "actions/setup-python@v6" with: - python-version: "3.12" + python-version: "3.x" - name: "Determine PR labels" run: | pip install GitPython==3.1.42 diff --git a/.github/workflows/release_branch.yml b/.github/workflows/release_branch.yml index e0d841b..be0c5e5 100644 --- a/.github/workflows/release_branch.yml +++ b/.github/workflows/release_branch.yml @@ -13,7 +13,7 @@ jobs: - name: "Set up Python" uses: "actions/setup-python@v6" with: - python-version: "3.11" + python-version: "3.x" - name: "Setup git" run: | git config user.name pulpbot @@ -26,12 +26,20 @@ jobs: .ci/scripts/create_release_branch.sh - name: "Create Pull Request" uses: "peter-evans/create-pull-request@v7" + id: "create_pr" with: token: "${{ secrets.RELEASE_TOKEN }}" title: "Bump dev-version" body: "" branch: "bump_version" delete-branch: true + - name: "Mark PR automerge" + run: | + gh pr merge --rebase --auto "${{ steps.create_pr.outputs.pull-request-number }}" + if: "steps.create_pr.outputs.pull-request-number" + env: + GH_TOKEN: "${{ secrets.RELEASE_TOKEN }}" + continue-on-error: true - name: "Add Backport Label for new Branch" uses: "actions/github-script@v8" with: diff --git a/releasing.md b/releasing.md new file mode 100644 index 0000000..20d185a --- /dev/null +++ b/releasing.md @@ -0,0 +1,20 @@ +# Releasing (for internal use) + +## Using Workflows + +### Create a new Y-Release Branch + + 1. Trigger the "Create Release Branch" workflow on the "main" branch. + 1. Watch for the "Bump Version" PR, verify that it deletes all the changes snippets present on the new release branch, approve and merge it. + +### Release from a Release Branch + + 1. Trigger the "pulp-cli Release" workflow on the corresponding release branch. + 1. Lean back and see the magic happen. + 1. Wait for the "pulp-cli Publish" workflow to succeed. + 1. Verify that a new version appeared on PyPI. + 1. Verify that the docs have been updated. + 1. [only Y-releases] Announce the release at https://discourse.pulpproject.org/c/announcements/6. + 1. Look for the "Update Changelog" PR, approve and merge it. + +If some thing goes wrong look at `.ci/scripts/create_release_branch.sh` and `.ci/scripts/release.sh` and follow the intentions encoded there.