v30.3-roots.1 · Commit 63: [PATCH 63/68] fix(release): restore signed five-platform CI releases
ci/test/test_prepare_release.py
Before: ci/test/test_prepare_release.py · After: ci/test/test_prepare_release.py
File metadata
index 7e75c554da77596fffbeb962346d367b25860858..5291ba5e9172891476f960294528c670a765daf6 100755
Download original patch · Release notes
Diff rows 1–47 of 47. Line numbers refer to the original before/after files.
+ Added− RemovedUnmarked lines are context.
Scroll the code area horizontally to read long lines. The two line-number columns refer to before and after.
ci/test/test_prepare_release.py
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import hashlib
|
|
7
7
|
import io
|
|
8
8
|
import os
|
|
9
|
+
import shutil
|
|
9
10
|
from pathlib import Path
|
|
10
11
|
import subprocess
|
|
11
12
|
import tarfile
|
|
@@ -119,7 +120,7 @@ class PrepareReleaseTest(unittest.TestCase):
|
|
|
119
120
|
subprocess.run(["python3", ARCHIVE_TOOL, "validate", archive, root.name,
|
|
120
121
|
"--copying", ROOT / "COPYING"], check=True)
|
|
121
122
|
|
|
122
|
-
def test_actual_unix_workflow_intermediate_repacks_and_prepares(self):
|
|
123
|
+
def test_actual_unix_workflow_stages_notices_and_prepares(self):
|
|
123
124
|
lines = (ROOT / ".github/workflows/release.yml").read_text().splitlines()
|
|
124
125
|
def packaging_block(name):
|
|
125
126
|
start = lines.index(f" - name: {name}")
|
|
@@ -137,7 +138,7 @@ class PrepareReleaseTest(unittest.TestCase):
|
|
|
137
138
|
out = work / "out"
|
|
138
139
|
out.mkdir()
|
|
139
140
|
environment = {**os.environ, "RUNNER_TEMP": str(work / "runner"),
|
|
140
|
-
"BASE_OUTDIR": str(out), "ARTIFACT_NAME": f"bitcoin-roots-{platform}",
|
|
141
|
+
"BASE_OUTDIR": str(out), "BASE_BUILD_DIR": str(work / "runner"), "ARTIFACT_NAME": f"bitcoin-roots-{platform}",
|
|
141
142
|
"RELEASE_TAG": "v30.3-roots.1", "GITHUB_WORKSPACE": str(work)}
|
|
142
143
|
if platform.startswith("linux"):
|
|
143
144
|
(out / "payload").write_bytes(b"binary fixture")
|
|
@@ -148,6 +149,8 @@ class PrepareReleaseTest(unittest.TestCase):
|
|
|
148
149
|
with zipfile.ZipFile(deploy / "Bitcoin-Roots.zip", mode="w") as package:
|
|
149
150
|
package.writestr("Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt", b"binary fixture")
|
|
150
151
|
block = packaging_block("Stage release package")
|
|
152
|
+
descriptor = notice_fixtures.ReleaseNoticesTest().descriptor(work, platform)
|
|
153
|
+
notice_fixtures.NOTICES.collect(platform, descriptor, work / "runner/release-notices/notices")
|
|
151
154
|
subprocess.run(["bash", "-c", block], cwd=ROOT, env=environment, check=True)
|
|
152
155
|
archive = next((work / "runner/release-packages").iterdir())
|
|
153
156
|
member = "bitcoin-roots-30.3-roots.1/COPYING"
|
|
@@ -160,13 +163,12 @@ class PrepareReleaseTest(unittest.TestCase):
|
|
|
160
163
|
notice = package.read(member)
|
|
161
164
|
self.assertEqual(package.read("bitcoin-roots-30.3-roots.1/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt"), b"binary fixture")
|
|
162
165
|
self.assertEqual(notice, (ROOT / "COPYING").read_bytes())
|
|
163
|
-
descriptor = notice_fixtures.ReleaseNoticesTest().descriptor(work, platform)
|
|
164
|
-
notice_fixtures.NOTICES.collect(platform, descriptor, work / "notice-inputs")
|
|
166
|
+
subprocess.run(["python3", ROOT / "ci/release/notices.py", "validate", archive,
|
|
167
|
+
"bitcoin-roots-30.3-roots.1", platform], check=True)
|
|
165
168
|
downloads = work / "assembled-downloads"
|
|
166
169
|
downloads.mkdir()
|
|
167
170
|
assembled = downloads / archive.name
|
|
168
|
-
subprocess.run(["python3", notice_fixtures.REPACK_TOOL, archive, assembled,
|
|
169
|
-
"bitcoin-roots-30.3-roots.1", work / "notice-inputs/index.json", platform], check=True)
|
|
171
|
+
shutil.copyfile(archive, assembled)
|
|
170
172
|
(downloads / "series.patch").write_text("patch\n")
|
|
171
173
|
subprocess.run([SCRIPT, downloads, work / "release-assets", PUBLIC_KEY,
|
|
172
174
|
"v30.3-roots.1", "1"], check=True)
|