Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GitHub actions: fix and bump #234

Merged
merged 5 commits into from
Jul 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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]

Expand All @@ -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
Expand Down
8 changes: 3 additions & 5 deletions .github/workflows/bump-releases.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,15 +29,13 @@ 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'
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
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/bump_external_releases.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -23,14 +24,14 @@ 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

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}"
print(message)
message = f"Bump {tool_name}: {default_version} => {latest_version}"

def call(*args):
print(f"Executing: {args}")
Expand Down Expand Up @@ -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",
)


Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Loading