Skip to content

Commit 4b2f304

Browse files
authored
Merge pull request #11614 from owncloud/fix/ocisdev-266
fix: [OCISDEV 266] CI, fix release jobs on artifact copy
2 parents a1f0ac5 + 1317076 commit 4b2f304

File tree

1 file changed

+22
-7
lines changed

1 file changed

+22
-7
lines changed

.drone.star

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1970,6 +1970,26 @@ def binaryRelease(ctx, arch, build_type, target, depends_on = []):
19701970
"target": target,
19711971
}
19721972

1973+
# [OCISDEV-266] Avoid cross-pipeline races on GitHub Release assets by:
1974+
# - Uploading only OS-scoped files from each pipeline
1975+
# - Copying and uploading the shared EULA only from the linux pipeline
1976+
artifacts = []
1977+
if arch == "linux":
1978+
artifacts = [
1979+
"ocis/dist/release/*-linux-*",
1980+
"ocis/dist/release/End-User-License-Agreement-for-ownCloud-Infinite-Scale.pdf",
1981+
]
1982+
elif arch == "darwin":
1983+
artifacts = [
1984+
"ocis/dist/release/*-darwin-*",
1985+
]
1986+
1987+
finish_commands = [
1988+
"make -C ocis release-finish",
1989+
]
1990+
if arch == "linux":
1991+
finish_commands.append("cp assets/End-User-License-Agreement-for-ownCloud-Infinite-Scale.pdf ocis/dist/release/")
1992+
19731993
return {
19741994
"kind": "pipeline",
19751995
"type": "docker",
@@ -1993,10 +2013,7 @@ def binaryRelease(ctx, arch, build_type, target, depends_on = []):
19932013
"name": "finish",
19942014
"image": OC_CI_GOLANG,
19952015
"environment": DRONE_HTTP_PROXY_ENV,
1996-
"commands": [
1997-
"make -C ocis release-finish",
1998-
"cp assets/End-User-License-Agreement-for-ownCloud-Infinite-Scale.pdf ocis/dist/release/",
1999-
],
2016+
"commands": finish_commands,
20002017
"when": {
20012018
"ref": [
20022019
"refs/heads/master",
@@ -2037,9 +2054,7 @@ def binaryRelease(ctx, arch, build_type, target, depends_on = []):
20372054
"api_key": {
20382055
"from_secret": "github_token",
20392056
},
2040-
"files": [
2041-
"ocis/dist/release/*",
2042-
],
2057+
"files": artifacts,
20432058
"title": ctx.build.ref.replace("refs/tags/v", ""),
20442059
"note": "ocis/dist/CHANGELOG.md",
20452060
"overwrite": True,

0 commit comments

Comments
 (0)