Skip to content

Commit 0d52b5d

Browse files
authored
Merge pull request #15 from kc-vl/kc-vl/publish-sonatype-debugging
fix: remove double $ and replace genrule with run_binary
2 parents 186e1f6 + 3c2a05f commit 0d52b5d

File tree

3 files changed

+15
-8
lines changed

3 files changed

+15
-8
lines changed

.github/workflows/publish.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v4
1414
- uses: bazelbuild/setup-bazelisk@v3
15+
with:
16+
bazelisk-cache: true
17+
repository-cache: true
1518
- name: Mount bazel cache
1619
uses: actions/cache@v4
1720
with:

rules/publishing/publish_sonatype.bzl

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
load("@aspect_bazel_lib//lib:expand_template.bzl", "expand_template_rule")
2-
load("@bazel_skylib//rules:run_binary.bzl", "run_binary")
2+
load("@aspect_bazel_lib//lib:run_binary.bzl", "run_binary")
33
load("@rules_pkg//pkg:mappings.bzl", "pkg_files")
44
load("@rules_pkg//pkg/private/zip:zip.bzl", "pkg_zip")
55
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
@@ -157,16 +157,19 @@ def _sign(
157157
out = "{}.asc".format(name)
158158
name = "{}_asc".format(name)
159159

160-
native.genrule(
160+
run_binary(
161161
name = name,
162+
tool = "//rules/publishing:pgp_signer",
162163
srcs = [artifact],
163164
outs = [out],
164-
cmd = """
165-
MAVEN_SIGNING_TOSIGN=$(location {}) \
166-
MAVEN_SIGNING_OUTPUT_PATH=$(location {}) \
167-
$(location //rules/publishing:pgp_signer)""".format(artifact, out),
168-
tools = ["//rules/publishing:pgp_signer"],
169-
tags = ["manual"],
165+
env = {
166+
"MAVEN_SIGNING_TOSIGN": "$(location {})".format(artifact),
167+
"MAVEN_SIGNING_OUTPUT_PATH": "$(location {})".format(out),
168+
},
169+
use_default_shell_env = True,
170+
tags = [
171+
"manual",
172+
],
170173
)
171174

172175
def _calculate_hashes(

rules/publishing/upload.sh.tpl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ fi
88
SONATYPE_TOKEN=$({ECHO} -n $SONATYPE_USERNAME:$SONATYPE_PASSWORD | {BASE64} -w0)
99

1010
{CURL} \
11+
--fail-with-body \
1112
--request POST \
1213
--silent \
1314
--header 'Authorization: Bearer ${SONATYPE_TOKEN}' \

0 commit comments

Comments
 (0)