Commit 3aad2909 authored by Addshore's avatar Addshore 🏄
Browse files

CI: Avoid uploading release artifacts in CI

This is a workaround for
https://phabricator.wikimedia.org/T292372
Encountered first in
https://gitlab.wikimedia.org/releng/cli/-/merge_requests/47
parent c0e54f9f
...@@ -100,13 +100,21 @@ release-build: ...@@ -100,13 +100,21 @@ release-build:
needs: [build] needs: [build]
cache: {} cache: {}
image: docker-registry.wikimedia.org/golang:1.13-3 image: docker-registry.wikimedia.org/golang:1.13-3
artifacts: # artifacts:
paths: # paths:
- _release/ # - _release/
script: script:
# Ideally make would not be needed, only release? But it is needed to install deps currently? # Ideally make would not be needed, only release? But it is needed to install deps currently?
- make - make
- make release VERSION=${CI_COMMIT_TAG:-$CI_COMMIT_BRANCH} - make release VERSION=${CI_COMMIT_TAG:-$CI_COMMIT_BRANCH}
# This next part should be in release-upload, but https://phabricator.wikimedia.org/T292372
- >
if [ -n "$CI_COMMIT_TAG" ]; then
for release_path in $(find ./_release -type f); do
release_file=$(echo $release_path | sed "s/.*\///")
curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ${release_path} "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/mwcli/${CI_COMMIT_TAG}/${release_file}"
done
fi
release-upload: release-upload:
only: only:
...@@ -121,11 +129,12 @@ release-upload: ...@@ -121,11 +129,12 @@ release-upload:
- apk add curl - apk add curl
# https://docs.gitlab.com/ee/user/packages/generic_packages/#publish-a-generic-package-by-using-cicd # https://docs.gitlab.com/ee/user/packages/generic_packages/#publish-a-generic-package-by-using-cicd
script: script:
- > - echo "Placeholder job, as a conditional upload currently happens as part of release-build awaiting decision on https://phabricator.wikimedia.org/T292372"
for release_path in $(find ./_release -type f); do # - >
release_file=$(echo $release_path | sed "s/.*\///") # for release_path in $(find ./_release -type f); do
curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ${release_path} "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/mwcli/${CI_COMMIT_TAG}/${release_file}" # release_file=$(echo $release_path | sed "s/.*\///")
done # curl --header "JOB-TOKEN: $CI_JOB_TOKEN" --upload-file ${release_path} "${CI_API_V4_URL}/projects/${CI_PROJECT_ID}/packages/generic/mwcli/${CI_COMMIT_TAG}/${release_file}"
# done
release-publish: release-publish:
only: only:
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment