Skip to content

Commit deaba14

Browse files
committed
Add release keys
1 parent b3ac612 commit deaba14

File tree

3 files changed

+8
-26
lines changed

3 files changed

+8
-26
lines changed

.github/workflows/main.yml

+2
Original file line numberDiff line numberDiff line change
@@ -189,4 +189,6 @@ jobs:
189189
env:
190190
GH_TOKEN: ${{ secrets.GH_TOKEN }}
191191
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
192+
GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_TOKEN }}
193+
CARGO_REGISTRY_TOKEN: ${{ secrets.CARGO_REGISTRY_TOKEN }}
192194
run: TASK=${{ matrix.task }} ./build.sh

tooling/src/hypothesistooling/projects/conjecturerust.py

+3-13
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
import hypothesistooling as tools
2020
from hypothesistooling import installers as install, releasemanagement as rm
21-
from hypothesistooling.junkdrawer import in_dir, unlink_if_present, unquote_string
21+
from hypothesistooling.junkdrawer import in_dir, unquote_string
2222

2323
PACKAGE_NAME = "conjecture-rust"
2424

@@ -98,16 +98,6 @@ def current_version():
9898
def upload_distribution():
9999
"""Upload the built package to crates.io."""
100100
tools.assert_can_release()
101-
102-
# Yes, cargo really will only look in this file. Yes this is terrible.
103-
# This only runs in CI, so we may be assumed to own it, but still.
104-
unlink_if_present(CARGO_CREDENTIALS)
105-
106-
# symlink so that the actual secret credentials can't be leaked via the
107-
# cache.
108-
os.symlink(tools.CARGO_API_KEY, CARGO_CREDENTIALS)
109-
110-
# Give the key the right permissions.
111-
os.chmod(CARGO_CREDENTIALS, int("0600", 8))
112-
101+
# Credentials are supplied by the CARGO_REGISTRY_TOKEN envvar, which in turn
102+
# is set from the repository secrets by GitHub Actions.
113103
cargo("publish")

tooling/src/hypothesistooling/projects/hypothesisruby.py

+3-13
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import hypothesistooling.installers as install
2222
import hypothesistooling.projects.conjecturerust as cr
2323
import hypothesistooling.releasemanagement as rm
24-
from hypothesistooling.junkdrawer import in_dir, once, unlink_if_present
24+
from hypothesistooling.junkdrawer import in_dir, once
2525

2626
PACKAGE_NAME = "hypothesis-ruby"
2727

@@ -157,18 +157,8 @@ def ensure_bundler():
157157
def upload_distribution():
158158
"""Upload the built package to rubygems."""
159159
tools.assert_can_release()
160-
161-
# Yes, rubygems really will only look in this file. Yes this is terrible.
162-
# This only runs on Travis, so we may be assumed to own it, but still.
163-
unlink_if_present(RUBYGEMS_CREDENTIALS)
164-
165-
# symlink so that the actual secret credentials can't be leaked via the
166-
# cache.
167-
os.symlink(tools.RUBYGEMS_API_KEY, RUBYGEMS_CREDENTIALS)
168-
169-
# Give the key the right permissions.
170-
os.chmod(RUBYGEMS_CREDENTIALS, int("0600", 8))
171-
160+
# Credentials are supplied by the GEM_HOST_API_KEY envvar, which in turn
161+
# is set from the repository secrets by GitHub Actions.
172162
subprocess.check_call(
173163
[install.GEM_EXECUTABLE, "push", *glob("hypothesis-specs-*.gem")]
174164
)

0 commit comments

Comments
 (0)