Skip to content

Commit d92e5be

Browse files
[no ci] allow redeploy with custom artifacts origin
1 parent 9c89553 commit d92e5be

2 files changed

Lines changed: 28 additions & 9 deletions

File tree

.github/workflows/main.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,12 @@ on:
99
channel:
1010
type: string
1111
default: release
12+
findBy:
13+
type: string
14+
default: ""
1215
version:
1316
type: string
14-
default: "0.8.2"
17+
default: "1.2.0"
1518
changelog:
1619
type: string
1720
default: ""
@@ -63,6 +66,7 @@ jobs:
6366
secrets: inherit
6467
with:
6568
channel: ${{ inputs.channel }}
69+
findBy: ${{ inputs.findBy }}
6670

6771
update-version:
6872
if: "!failure() && !cancelled() && !inputs.redeploy && inputs.channel == 'release'"

.github/workflows/update-repo.yml

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,10 @@ on:
231231
"nightly": 2,
232232
"release": 5
233233
}
234+
findBy:
235+
# findBy of artifacts action as json
236+
type: string
237+
default: ""
234238
secrets:
235239
GPG_PRIVATE_KEY: {}
236240
jobs:
@@ -281,24 +285,35 @@ jobs:
281285
console.log("Previous index is unavailable");
282286
}
283287
const artifactClient = new artifact.DefaultArtifactClient()
288+
var findByData = JSON.parse(${{ tojson(inputs.findBy || 'null') }});
289+
if(findByData && !findByData.token) {
290+
findByData.token = ${{ tojson(github.token) }};
291+
}
284292
const listArtifactResponse = await artifactClient.listArtifacts({
285-
latest: true
293+
latest: true,
294+
findBy: findByData
286295
})
287-
let artifacts = listArtifactResponse.artifacts
288-
296+
let artifacts = listArtifactResponse.artifacts;
297+
298+
console.log(JSON.stringify(artifacts))
289299
for(var repo of config) {
290300
try {
291301
const path = `packages/${repo.artifact}`
292302
const options = {
293303
createArtifactFolder: false
294304
}
305+
console.log("downloading " + repo.artifact + " to " + path)
295306
296-
for(var artifactName of artifacts.map(artifact => artifact.name).filter(name => name === repo.artifact || name && name.startsWith(repo.artifact + "-"))) {
297-
298-
const downloadResponse = await artifactClient.downloadArtifact(artifactName, path, options)
307+
for(var art of artifacts.filter(a => a.name === repo.artifact || a.name && artifact.name.startsWith(a.artifact + "-"))) {
308+
try {
309+
console.log(JSON.stringify({art.name, path, options}));
310+
const downloadResponse = await artifactClient.downloadArtifact(art.name, path, options);
311+
} catch(err) {
312+
console.log(err)
313+
}
299314
}
300-
} catch {
301-
315+
} catch(err) {
316+
console.log(err)
302317
}
303318
}
304319
const globber = await glob.create("packages/**", { matchDirectories: false });

0 commit comments

Comments
 (0)