summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2021-04-14 21:23:31 +0200
committerJan Holthuis <jan.holthuis@ruhr-uni-bochum.de>2021-04-16 00:43:55 +0200
commit9ec06824171181291e99e33ca3d7ad29d1c406f9 (patch)
treea6feabe94dbb1c5111025a9cf8086052304e348b
parent9df505c3c8f56d6ff1495b1ed9001648e70e1c45 (diff)
CI: Improve file names of package artifacts
-rw-r--r--.github/workflows/build.yml4
-rw-r--r--tools/deploy.py24
2 files changed, 21 insertions, 7 deletions
diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml
index dc99adc6c4..164c92f10b 100644
--- a/.github/workflows/build.yml
+++ b/.github/workflows/build.yml
@@ -32,6 +32,7 @@ jobs:
buildenv_script: tools/debian_buildenv.sh
artifacts_name: Ubuntu 18.04 DEB
artifacts_path: build/*.deb
+ artifacts_slug: ubuntu-bionic
qt_qpa_platform: offscreen
- name: Ubuntu 20.04 (gcc)
os: ubuntu-20.04
@@ -54,6 +55,7 @@ jobs:
buildenv_script: tools/debian_buildenv.sh
artifacts_name: Ubuntu 20.04 DEB
artifacts_path: build/*.deb
+ artifacts_slug: ubuntu-focal
qt_qpa_platform: offscreen
- name: macOS 10.15
os: macos-10.15
@@ -340,7 +342,7 @@ jobs:
python3 tools/deploy.py prepare-deployment
--slug '${{ matrix.artifacts_slug }}'
--output-dir 'deploy/'
- --dest-path 'builds/{branch}/${{ runner.os }}/{filename}'
+ --dest-path 'builds/{branch}/mixxx-{describe}-{package_slug}.{ext}'
--dest-url 'https://downloads.mixxx.org'
${{ matrix.artifacts_path }}
diff --git a/tools/deploy.py b/tools/deploy.py
index 3df9b105a8..1e5ef3ed67 100644
--- a/tools/deploy.py
+++ b/tools/deploy.py
@@ -86,6 +86,13 @@ def tree(path):
yield os.path.join(relpath, filename)
+def slug(text):
+ download_slug, _, package_slug = text.partition("-")
+ if not download_slug or not package_slug:
+ raise ValueError("Failed to parse slug")
+ return download_slug, package_slug
+
+
def prepare_deployment(args):
# Get artifact and build metadata
file_stat = os.stat(args.file)
@@ -122,6 +129,7 @@ def prepare_deployment(args):
}
)
+ download_slug, package_slug = args.slug
# Build destination path scheme
print(f"Destination path pattern: {args.dest_path}")
destpath = args.dest_path.format(
@@ -130,7 +138,8 @@ def prepare_deployment(args):
branch=git_info("branch"),
commit_id=commit_id,
describe=git_info("describe"),
- slug=args.slug,
+ package_slug=package_slug,
+ download_slug=download_slug,
)
print(f"Destination path: {destpath}")
@@ -161,8 +170,10 @@ def prepare_deployment(args):
if os.getenv("CI") == "true":
# Set GitHub Actions job output
print(
- "::set-output name=artifact-{}::{}".format(
- args.slug, json.dumps(metadata)
+ "::set-output name=artifact-{}-{}::{}".format(
+ download_slug,
+ package_slug,
+ json.dumps(metadata),
)
)
@@ -178,8 +189,8 @@ def collect_manifest_data(job_data):
manifest_data = {}
for output_name, output_data in job_data["outputs"].items():
# Filter out unrelated job outputs that don't start with "artifact-".
- prefix, _, slug = output_name.partition("-")
- if prefix != "artifact" or not slug:
+ prefix, _, artifact_slug = output_name.partition("-")
+ if prefix != "artifact" or not artifact_slug:
print(f"Ignoring output '{output_name}'...")
continue
artifact_data = json.loads(output_data)
@@ -191,7 +202,7 @@ def collect_manifest_data(job_data):
if not resp.status == 200:
raise LookupError(f"Unable to find URL '{url}' on remote server")
- manifest_data[slug] = artifact_data
+ manifest_data[artifact_slug] = artifact_data
return manifest_data
@@ -267,6 +278,7 @@ def main(argv=None):
"--slug",
action="store",
required=True,
+ type=slug,
help="Artifact identifier for the website's download page",
)
artifact_parser.add_argument(