diff --git a/.ci/.package.yaml b/.ci/.package.yaml deleted file mode 100644 index 915d741ef7..0000000000 --- a/.ci/.package.yaml +++ /dev/null @@ -1,8 +0,0 @@ ---- -OSS: - - "darwin" - - "linux" - -PLATFORM: - - "386" - - "amd64" diff --git a/.ci/Jenkinsfile b/.ci/Jenkinsfile index 24c775b59d..ec80a6dfce 100644 --- a/.ci/Jenkinsfile +++ b/.ci/Jenkinsfile @@ -221,18 +221,17 @@ pipeline { deleteDir() unstash 'source' dir("${BASE_DIR}") { - script { - def matrix = readYaml(file: '.ci/.package.yaml') - def parallelTasks = [:] - matrix['OSS'].each { oss -> - matrix['PLATFORM'].each { platform -> - parallelTasks["${oss}-${platform}"] = generateStep(oss: "${oss}", platform: "${platform}") - } - } - parallel(parallelTasks) + setEnvVar("GITHUB_TOKEN", getGithubToken()) + retryWithSleep(retries: 2, seconds: 5, backoff: true) { + sh(label: 'Release binaries with gorelease', script: 'curl -sL https://git.io/goreleaser | bash -s -- --rm-dist', returnStatus: true) } } } + post { + always { + archiveArtifacts allowEmptyArchive: true, artifacts: "${BASE_DIR}/cli/dist/**" + } + } } } } @@ -279,27 +278,6 @@ def doNotifyBuildResult(boolean slackNotify) { notifyBuildResult(analyzeFlakey: true, jobName: getFlakyJobName(withBranch: "${env.JOB_BASE_NAME}"), prComment: true, slackHeader: header, slackChannel: "${channels}", slackComment: true, slackNotify: slackNotify) } - -def generateStep(Map args = [:]){ - def oss = args.get('oss') - def platform = args.get('platform') - return { - withNode(labels: 'ubuntu-18.04 && immutable && docker', sleepMax: 20, forceWorkspace: true){ - try { - deleteDir() - unstash 'source' - dir("${BASE_DIR}/cli") { - withEnv(["GOOS=${oss}", "GOARCH=${platform}"]) { - sh script: 'make build', label: 'Create releases' - } - } - } finally { - archiveArtifacts allowEmptyArchive: true, artifacts: "${BASE_DIR}/cli/.github/releases/download/**" - } - } - } -} - def generateFunctionalTestStep(Map args = [:]){ def platform = args.get('platform') def suite = args.get('suite') diff --git a/.goreleaser.yml b/.goreleaser.yml index 9d658ea8b4..ad0a24fbc3 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -35,3 +35,30 @@ changelog: exclude: - '^docs:' - '^test:' + +# https://goreleaser.com/customization/release/ +release: + # Repo in which the release will be created. + # Default is extracted from the origin remote URL or empty if its private hosted. + # Note: it can only be one: either github, gitlab or gitea + github: + owner: elastic + name: e2e-testing + + # If set to true, will not auto-publish the release. + # Default is false. + draft: true + + # If set to auto, will mark the release as not ready for production + # in case there is an indicator for this in the tag e.g. v1.0.0-rc1 + # If set to true, will mark the release as not ready for production. + # Default is false. + prerelease: auto + + # You can change the name of the release. + # Default is `{{.Tag}}` + name_template: "{{.Tag}}" + + # You can disable this pipe in order to not upload any artifacts. + # Defaults to false. + disable: false