diff --git a/.github/workflows/prebuilts-deploy.yml b/.github/workflows/prebuilts-deploy.yml new file mode 100644 index 000000000..e9c06f360 --- /dev/null +++ b/.github/workflows/prebuilts-deploy.yml @@ -0,0 +1,32 @@ +name: Build and deploy tools +run-name: Build and deploy tools +on: [push] +jobs: + build-deploy-tools: + runs-on: ubuntu-latest + permissions: + pull-requests: read + steps: + - name: Check out repository code + uses: actions/checkout@v4 + - name: Get changed files + id: changed-files + uses: tj-actions/changed-files@v39 + - name: Refresh prebuilts if affected files changed + run: | + for file in ${{ steps.changed-files.outputs.all_changed_files }}; do + echo "$file was changed" + label=$(bazel query "$file" || true) + if [[ ! -z $label ]]; then + bazel query "kind(java_binary, rdeps(//private/tools/java/..., $label))" >> /tmp/affected_targets + fi + done + if [[ $(wc -l /tmp/affected_targets) -ne 0 ]]; then + bazelisk run //scripts:refresh-prebuilts + fi + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: outdated_deploy.jar + path: bazel-bin/private/tools/java/com/github/bazelbuild/rules_jvm_external/maven/outdated_deploy.jar + retention-days: 5 diff --git a/private/tools/java/com/github/bazelbuild/rules_jvm_external/Coordinates.java b/private/tools/java/com/github/bazelbuild/rules_jvm_external/Coordinates.java index 391b83aac..21b851782 100644 --- a/private/tools/java/com/github/bazelbuild/rules_jvm_external/Coordinates.java +++ b/private/tools/java/com/github/bazelbuild/rules_jvm_external/Coordinates.java @@ -28,6 +28,7 @@ public Coordinates(String coordinates) { groupId = Objects.requireNonNull(parts[0]); artifactId = Objects.requireNonNull(parts[1]); + if (parts.length == 2) { extension = "jar"; classifier = "";