upload will fail if a file with the same hash is already up (#9479)

* upload will fail if a file with the same hash is already up

* compose version string for nightly releases
This commit is contained in:
gabriel klawitter 2018-09-10 17:22:34 +02:00 committed by Denis S. Soldatov aka General-Beck
parent baf5be09dc
commit eb0986c3f9

View File

@ -41,9 +41,17 @@ cache:
paths: paths:
- artifacts/ - artifacts/
.determine_version: &determine_version | .determine_version:
export VERSION=$(grep -m 1 "version =" Cargo.toml | awk '{print $3}' | tr -d '"' | tr -d "\n") before_script: &determine_version
echo "Version" $VERSION - >
VERSION="$(sed -r -n '1,/^version/s/^version = "([^"]+)".*$/\1/p' < Cargo.toml)";
if [ "${CI_COMMIT_REF_NAME}" = "nightly" ]; then
COMMIT_REF_SHORT="echo ${CI_COMMIT_REF} | grep -oE '^.{7}')";
DATE_STRING="$(date +%Y%m%d)";
export VERSION="${VERSION}-${COMMIT_REF_SHORT}-${DATE_STRING}";
fi;
export VERSION;
echo "Version: $VERSION"
#### stage: test #### stage: test
@ -169,11 +177,10 @@ build-windows-msvc-x86_64:
#### stage: package #### stage: package
package-linux-snap-amd64: &package_snap package-linux-snap-amd64: &package_snap
stage: package stage: package
only: *releaseable_branches only: *releaseable_branches
cache: {} cache: {}
before_script: before_script: *determine_version
- *determine_version
variables: variables:
CARGO_TARGET: x86_64-unknown-linux-gnu CARGO_TARGET: x86_64-unknown-linux-gnu
dependencies: dependencies:
@ -216,8 +223,7 @@ publish-linux-snap-amd64: &publish_snap
only: *publishable_branches only: *publishable_branches
image: snapcore/snapcraft:stable image: snapcore/snapcraft:stable
cache: {} cache: {}
before_script: before_script: *determine_version
- *determine_version
variables: variables:
BUILD_ARCH: amd64 BUILD_ARCH: amd64
dependencies: dependencies:
@ -229,8 +235,6 @@ publish-linux-snap-amd64: &publish_snap
publish-linux-snap-i386: publish-linux-snap-i386:
<<: *publish_snap <<: *publish_snap
before_script:
- *determine_version
variables: variables:
BUILD_ARCH: i386 BUILD_ARCH: i386
dependencies: dependencies:
@ -238,8 +242,6 @@ publish-linux-snap-i386:
publish-linux-snap-arm64: publish-linux-snap-arm64:
<<: *publish_snap <<: *publish_snap
before_script:
- *determine_version
variables: variables:
BUILD_ARCH: arm64 BUILD_ARCH: arm64
dependencies: dependencies:
@ -247,8 +249,6 @@ publish-linux-snap-arm64:
publish-linux-snap-armhf: publish-linux-snap-armhf:
<<: *publish_snap <<: *publish_snap
before_script:
- *determine_version
variables: variables:
BUILD_ARCH: armhf BUILD_ARCH: armhf
dependencies: dependencies:
@ -282,8 +282,7 @@ publish-github-and-s3:
- build-linux-ubuntu-arm64 - build-linux-ubuntu-arm64
- build-darwin-macos-x86_64 - build-darwin-macos-x86_64
- build-windows-msvc-x86_64 - build-windows-msvc-x86_64
before_script: before_script: *determine_version
- *determine_version
script: script:
- scripts/gitlab/push.sh - scripts/gitlab/push.sh
tags: tags: