From 4dce1466865d616fabba18f7b5b888c3be5d077d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20Ma=C5=82ek?= Date: Thu, 22 Apr 2021 17:43:32 +0200 Subject: [PATCH] Fix CI to actually produce artifacts for tags --- .circleci/config.yml | 86 ++++++++++++-------------------------------- 1 file changed, 23 insertions(+), 63 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 60ab6f6af2aa..ee00700bb0ed 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -30,15 +30,15 @@ commands: files: type: string default: | - bin/otelcontribcol_darwin_amd64 - bin/otelcontribcol_linux_arm64 - bin/otelcontribcol_linux_amd64 - bin/otelcontribcol_windows_amd64.exe - dist/otel-contrib-collector-*.arm64.rpm - dist/otel-contrib-collector_*_amd64.deb - dist/otel-contrib-collector-*.x86_64.rpm - dist/otel-contrib-collector_*_arm64.deb - dist/otel-contrib-collector-*amd64.msi + bin/otelcontribcol_darwin_amd64 + bin/otelcontribcol_linux_arm64 + bin/otelcontribcol_linux_amd64 + bin/otelcontribcol_windows_amd64.exe + dist/otel-contrib-collector-*.arm64.rpm + dist/otel-contrib-collector_*_amd64.deb + dist/otel-contrib-collector-*.x86_64.rpm + dist/otel-contrib-collector_*_arm64.deb + dist/otel-contrib-collector-*amd64.msi steps: - run: name: Check if distribution files exist @@ -160,36 +160,16 @@ workflows: stability-tests: when: << pipeline.parameters.run-stability-tests >> jobs: - - checkout-commit: - filters: - branches: - only: /.*/ - tags: - only: /.*/ + - checkout-commit - setup: requires: - checkout-commit - filters: - branches: - only: /.*/ - tags: - only: /.*/ - cross-compile: requires: - setup - filters: - branches: - only: /.*/ - tags: - only: /.*/ - run-stability-tests: requires: - cross-compile - filters: - branches: - only: /.*/ - tags: - only: /.*/ - publish-dev: requires: - run-stability-tests @@ -208,14 +188,6 @@ workflows: only: /.*/ tags: only: /.*/ - - publish-stable: - requires: - - run-tracing-tests - filters: - branches: - ignore: /.*/ - tags: - only: /.*/ build-publish: @@ -276,11 +248,6 @@ workflows: - windows-msi - deb-package - rpm-package - filters: - branches: - only: /.*/ - tags: - only: /.*/ - publish-stable: requires: - lint @@ -296,29 +263,18 @@ workflows: branches: ignore: /.*/ tags: - ignore: /.*/ - - publish-dev: + only: /^v[0-9]+\.[0-9]+\.[0-9]+.*/ + - spawn-stability-tests-job: requires: - lint - unit-tests - - integration-tests - - cross-compile - loadtest - windows-test - - windows-msi - - deb-package - - rpm-package - filters: - branches: - ignore: /.*/ - tags: - ignore: /.*/ - - spawn-stability-tests-job: - requires: - - publish-check + - integration-tests + - cross-compile filters: branches: - only: /.*/ + only: /main|release|tracing\/.+/ tags: only: /.*/ - integration-tests: @@ -481,12 +437,16 @@ jobs: - publish_docker_images: repo: opentelemetry-collector tag: ${CIRCLE_TAG:1} + - run: + name: Prepare release artifacts + command: | + cp bin/* dist/ - run: name: Calculate checksums - command: cd bin && shasum -a 256 * > checksums.txt + command: cd dist && shasum -a 256 * > checksums.txt - run: name: Create Github release and upload artifacts - command: ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME --replace $CIRCLE_TAG bin/ + command: ghr -t $GITHUB_TOKEN -u $CIRCLE_PROJECT_USERNAME -r $CIRCLE_PROJECT_REPONAME --replace $CIRCLE_TAG dist/ publish-dev: executor: golang @@ -509,8 +469,8 @@ jobs: - run: name: Trigger stability tests job command: | - PARAM='"branch": "'"${CIRLCE_BRANCH}"'"' - if [ -z "$CIRLCE_BRANCH" ]; then + PARAM='"branch": "'"${CIRCLE_BRANCH}"'"' + if [ -z "$CIRCLE_BRANCH" ]; then PARAM='"tag": "'"${CIRCLE_TAG}"'"' fi curl -f -X POST "https://circleci.com/api/v2/project/github/SumoLogic/${CIRCLE_PROJECT_REPONAME}/pipeline" \