From e6aad5c0bd2d8a4dabb9b6490b7ceccd9cf93eff Mon Sep 17 00:00:00 2001 From: Samuele Maci Date: Sat, 13 Jul 2024 13:49:05 +0100 Subject: [PATCH 1/5] Bump github actions --- .github/workflows/bump-releases.yaml | 2 +- .github/workflows/codeql-analysis.yml | 2 +- .github/workflows/publish.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bump-releases.yaml b/.github/workflows/bump-releases.yaml index 9b88674..12e0d0d 100644 --- a/.github/workflows/bump-releases.yaml +++ b/.github/workflows/bump-releases.yaml @@ -29,7 +29,7 @@ jobs: - name: Create Pull Request id: cpr if: ${{ env.GIT_SHA != github.sha }} - uses: peter-evans/create-pull-request@v3 + uses: peter-evans/create-pull-request@v6 with: token: ${{ secrets.REPO_TOKEN }} title: '[Automated PR] Bump KTLint and/or Google Java Formatter' diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 623e031..5d2b71e 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -20,7 +20,7 @@ jobs: steps: - name: Checkout repository - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Initialize CodeQL uses: github/codeql-action/init@v2 diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index fb503fe..6d453b4 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -22,6 +22,6 @@ jobs: - name: Create a Wheel file and source distribution run: python setup.py sdist bdist_wheel - name: Publish distribution package to PyPI - uses: pypa/gh-action-pypi-publish@v1.8.14 + uses: pypa/gh-action-pypi-publish@release/v1 with: password: ${{ secrets.pypi_password }} From d8bdaf6fc0b04f32cd39f7fb4dd6925f4748acbd Mon Sep 17 00:00:00 2001 From: Samuele Maci Date: Sat, 13 Jul 2024 14:09:48 +0100 Subject: [PATCH 2/5] Remove no longer supported configurations from rust setup --- .github/workflows/build.yaml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index a847505..99a8c22 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -41,9 +41,7 @@ jobs: - name: Setup Rust uses: actions-rust-lang/setup-rust-toolchain@v1 with: - profile: minimal toolchain: ${{ matrix.rust_version }} - override: true components: rustfmt - name: Setup Java uses: actions/setup-java@v4 From 4c0f9b0b8e2f8cddf76b98db32a254a9cbd6d7b4 Mon Sep 17 00:00:00 2001 From: Samuele Maci Date: Sat, 13 Jul 2024 13:58:56 +0100 Subject: [PATCH 3/5] Update golang version and remove no longer supported java version --- .github/workflows/build.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 99a8c22..dae71a8 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -16,8 +16,8 @@ jobs: matrix: os: [macos-latest, ubuntu-latest, windows-latest] - golang_version: [1.22.1] - java_version: ['15', '21'] + golang_version: [1.22.5] + java_version: ['21'] python_version: ['3.8', '3.10', '3.12'] rust_version: [stable] From fb61cd8246a0012e60a4aa5816e025ed9059a313 Mon Sep 17 00:00:00 2001 From: Samuele Maci Date: Sat, 13 Jul 2024 13:55:09 +0100 Subject: [PATCH 4/5] Update bump-releases action to fix PR message and assignee --- .github/workflows/bump-releases.yaml | 6 ++---- .github/workflows/bump_external_releases.py | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/bump-releases.yaml b/.github/workflows/bump-releases.yaml index 12e0d0d..bcc8eb1 100644 --- a/.github/workflows/bump-releases.yaml +++ b/.github/workflows/bump-releases.yaml @@ -32,12 +32,10 @@ jobs: uses: peter-evans/create-pull-request@v6 with: token: ${{ secrets.REPO_TOKEN }} - title: '[Automated PR] Bump KTLint and/or Google Java Formatter' + title: '[Automated PR] Bump external tools (KTLint, Google Java Formatter, ktfmt, Pantlir)' body: | - Bump KTLint and/or Google Java Formatter - *Auto-generated* by [bump-releases](https://github.com/macisamuele/language-formatters-pre-commit-hooks/actions/workflows/bump-releases.yaml) - reviewers: cortinico,macisamuele + reviewers: macisamuele branch: create-pull-request/bump-releases delete-branch: true draft: false diff --git a/.github/workflows/bump_external_releases.py b/.github/workflows/bump_external_releases.py index 5ba808d..c915798 100644 --- a/.github/workflows/bump_external_releases.py +++ b/.github/workflows/bump_external_releases.py @@ -29,7 +29,7 @@ def bump_release(github_project, tool_name): with tool_name_version_path.open(mode="w") as f: f.write(f"{latest_version}\n") - message = f"Bump {tool_name} to version {latest_version}" + message = f"Bump {tool_name}: {default_version} => {latest_version}" print(message) def call(*args): From 30e5e2a4645d9e9c27bec75ba28abd1de943b8b3 Mon Sep 17 00:00:00 2001 From: Samuele Maci Date: Sat, 13 Jul 2024 14:27:16 +0100 Subject: [PATCH 5/5] Improve bump external releases tool to properly support palantir palantir-cli releases respect to all the other tools have a name that is more human like and less automation friendly. Still, releases (also for prior tools) are based on tags that are automation friendly. In here, we switch over from using the name of the release to use the name of the tag associated to the release --- .github/workflows/bump_external_releases.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bump_external_releases.py b/.github/workflows/bump_external_releases.py index c915798..9fbe7ad 100644 --- a/.github/workflows/bump_external_releases.py +++ b/.github/workflows/bump_external_releases.py @@ -12,9 +12,10 @@ def bump_release(github_project, tool_name): + print(f"Checking for {tool_name} updates") try: with urlopen(f"https://api.github.com/repos/{github_project}/releases/latest") as request: # nosec: disable=B310 - latest_version = json.load(request)["name"].lstrip("v") + latest_version = json.load(request)["tag_name"].lstrip("v") except: # noqa: E722 (allow usage of bare 'except') traceback.print_exc() return False @@ -23,6 +24,7 @@ def bump_release(github_project, tool_name): with tool_name_version_path.open(mode="r") as f: default_version = f.readline().split()[0] + print(f"Latest version: {latest_version}, repository version: {default_version}") if default_version == latest_version: return False @@ -30,7 +32,6 @@ def bump_release(github_project, tool_name): f.write(f"{latest_version}\n") message = f"Bump {tool_name}: {default_version} => {latest_version}" - print(message) def call(*args): print(f"Executing: {args}") @@ -71,7 +72,7 @@ def bump_google_java_formatter(): def bump_palantir_java_formatter(): return bump_release( github_project="jsonschema2dataclass/palantir-cli", - tool_name="palantir-cli", + tool_name="palantir", )