mirror of
https://github.com/jspsych/jsPsych.git
synced 2025-05-10 11:10:54 +00:00
Fix asset uploading in release workflow
This commit is contained in:
parent
a6367c7440
commit
997ba3cd74
12
.github/workflows/release.yml
vendored
12
.github/workflows/release.yml
vendored
@ -55,9 +55,10 @@ jobs:
|
|||||||
const distFile = "dist.zip";
|
const distFile = "dist.zip";
|
||||||
|
|
||||||
let errorMessage;
|
let errorMessage;
|
||||||
for (const { name: tag, version } of publishedPackages) {
|
for (const { name, version } of publishedPackages) {
|
||||||
|
const tag = `${name}@${version}`;
|
||||||
// Only upload the dist archive for the chore package, plugins, and extensions
|
// Only upload the dist archive for the chore package, plugins, and extensions
|
||||||
if (tag.startsWith("jspsych@") || tag.includes("/plugin-") || tag.includes("/extension-")) {
|
if (name.startsWith("jspsych@") || name.includes("/plugin-") || name.includes("/extension-")) {
|
||||||
console.log(`Uploading dist archive release asset for ${tag}`);
|
console.log(`Uploading dist archive release asset for ${tag}`);
|
||||||
try {
|
try {
|
||||||
// https://docs.github.com/en/rest/reference/repos#get-a-release-by-tag-name
|
// https://docs.github.com/en/rest/reference/repos#get-a-release-by-tag-name
|
||||||
@ -74,12 +75,7 @@ jobs:
|
|||||||
owner,
|
owner,
|
||||||
repo,
|
repo,
|
||||||
release_id: releaseId,
|
release_id: releaseId,
|
||||||
|
name: `${name.replace("@jspsych/", "jspsych-")}-${version}-dist.zip`,
|
||||||
// Tag to filename transformation:
|
|
||||||
// * jspsych@1.2.3 => jspsych-1.2.3-dist.zip
|
|
||||||
// * @jspsych/plugin-test@1.2.3 => jspsych-plugin-test-1.2.3-dist.zip
|
|
||||||
name: `${tag.replace("@jspsych/", "jspsych-").replace("@", "-")}-dist.zip`,
|
|
||||||
|
|
||||||
label: "Dist archive (zip)",
|
label: "Dist archive (zip)",
|
||||||
headers: {
|
headers: {
|
||||||
"content-type": "application/zip",
|
"content-type": "application/zip",
|
||||||
|
Loading…
Reference in New Issue
Block a user