Attempt to fix GitHub release job on CI

This commit is contained in:
timvisee 2019-03-03 23:32:18 +01:00
parent a6104eef30
commit c5aca77062
No known key found for this signature in database
GPG key ID: B8DB720BC383E172

View file

@ -42,28 +42,28 @@ variables:
RUST_VERSION: stable RUST_VERSION: stable
RUST_TARGET: x86_64-unknown-linux-gnu RUST_TARGET: x86_64-unknown-linux-gnu
# Check on stable, beta and nightly # # Check on stable, beta and nightly
.check-base: &check-base # .check-base: &check-base
stage: check # stage: check
script: # script:
- cargo check --verbose # - cargo check --verbose
- cargo check --no-default-features --features send2 --verbose # - cargo check --no-default-features --features send2 --verbose
- cargo check --no-default-features --features send3 --verbose # - cargo check --no-default-features --features send3 --verbose
- cargo check --features no-color --verbose # - cargo check --features no-color --verbose
rust-stable: # rust-stable:
<<: *check-base # <<: *check-base
rust-beta: # rust-beta:
<<: *check-base # <<: *check-base
variables: # variables:
RUST_VERSION: beta # RUST_VERSION: beta
rust-nightly: # rust-nightly:
<<: *check-base # <<: *check-base
variables: # variables:
RUST_VERSION: nightly # RUST_VERSION: nightly
rust-old: # rust-old:
<<: *check-base # <<: *check-base
variables: # variables:
RUST_VERSION: "1.32.0" # RUST_VERSION: "1.32.0"
# Build using Rust stable # Build using Rust stable
build-x86_64-linux-gnu: build-x86_64-linux-gnu:
@ -113,36 +113,36 @@ build-x86_64-linux-musl:
- ffsend-$RUST_TARGET - ffsend-$RUST_TARGET
expire_in: 1 month expire_in: 1 month
# Run the unit tests through Cargo # # Run the unit tests through Cargo
cargo-test: # cargo-test:
stage: test # stage: test
dependencies: [] # dependencies: []
script: # script:
- cargo test --verbose # - cargo test --verbose
# Run integration test with the public Send service # # Run integration test with the public Send service
public-send-test: # public-send-test:
stage: test # stage: test
allow_failure: true # allow_failure: true
dependencies: # dependencies:
- build-x86_64-linux-musl # - build-x86_64-linux-musl
variables: # variables:
GIT_STRATEGY: none # GIT_STRATEGY: none
RUST_TARGET: x86_64-unknown-linux-musl # RUST_TARGET: x86_64-unknown-linux-musl
before_script: [] # before_script: []
script: # script:
# Generate random file, upload/download and assert equality # # Generate random file, upload/download and assert equality
- "head -c2m </dev/urandom >testfile" # - "head -c2m </dev/urandom >testfile"
- "./ffsend-$RUST_TARGET upload testfile -d=10 -p=secret -I" # - "./ffsend-$RUST_TARGET upload testfile -d=10 -p=secret -I"
- "./ffsend-$RUST_TARGET download $(./ffsend-$RUST_TARGET history -q) -p=secret -I -o=downloadfile" # - "./ffsend-$RUST_TARGET download $(./ffsend-$RUST_TARGET history -q) -p=secret -I -o=downloadfile"
- "./ffsend-$RUST_TARGET delete $(./ffsend-$RUST_TARGET history -q)" # - "./ffsend-$RUST_TARGET delete $(./ffsend-$RUST_TARGET history -q)"
- "cmp --silent ./testfile ./downloadfile || (echo ERROR: Downloaded file is different than original; exit 1)" # - "cmp --silent ./testfile ./downloadfile || (echo ERROR: Downloaded file is different than original; exit 1)"
# Also test Firefox Send v3 # # Also test Firefox Send v3
- "./ffsend-$RUST_TARGET upload --host http://send2.dev.lcip.org/ testfile -d=10 -p=secret -I" # - "./ffsend-$RUST_TARGET upload --host http://send2.dev.lcip.org/ testfile -d=10 -p=secret -I"
- "./ffsend-$RUST_TARGET download $(./ffsend-$RUST_TARGET history -q) -p=secret -I -o=downloadfile2" # - "./ffsend-$RUST_TARGET download $(./ffsend-$RUST_TARGET history -q) -p=secret -I -o=downloadfile2"
- "./ffsend-$RUST_TARGET delete $(./ffsend-$RUST_TARGET history -q)" # - "./ffsend-$RUST_TARGET delete $(./ffsend-$RUST_TARGET history -q)"
- "cmp --silent ./testfile ./downloadfile2 || (echo ERROR: Downloaded file is different than original; exit 1)" # - "cmp --silent ./testfile ./downloadfile2 || (echo ERROR: Downloaded file is different than original; exit 1)"
# Cargo crate release # Cargo crate release
crate: crate:
@ -158,13 +158,16 @@ crate:
# Publish release binaries to as GitHub release # Publish release binaries to as GitHub release
github-release: github-release:
stage: release stage: release
only: # only:
- /^v(\d+\.)*\d+$/ # - /^v(\d+\.)*\d+$/
dependencies: dependencies:
- build-x86_64-linux-gnu - build-x86_64-linux-gnu
- build-x86_64-linux-musl - build-x86_64-linux-musl
before_script: [] before_script: []
script: script:
# TODO: remove after testing!
- export CI_COMMIT_REF_NAME=v0.2.6
# Install dependencies # Install dependencies
- apt-get update - apt-get update
- apt-get install -y curl wget gzip - apt-get install -y curl wget gzip
@ -172,6 +175,7 @@ github-release:
# Download github-release binary # Download github-release binary
- wget $(curl -s https://api.github.com/repos/tfausak/github-release/releases/latest | grep 'browser_' | cut -d\" -f4 | grep 'linux') -O github-release.gz - wget $(curl -s https://api.github.com/repos/tfausak/github-release/releases/latest | grep 'browser_' | cut -d\" -f4 | grep 'linux') -O github-release.gz
- gunzip github-release.gz - gunzip github-release.gz
- chmod a+x ./github-release
# Upload binaries # Upload binaries
- ./github-release upload --token "$GITHUB_TOKEN" --owner 'timvisee' --repo 'ffsend' --tag "$CI_COMMIT_REF_NAME" --file ffsend-x86_64-linux-gnu --name ffsend-$CI_COMMIT_REF_NAME-linux-x64 - ./github-release upload --token "$GITHUB_TOKEN" --owner 'timvisee' --repo 'ffsend' --tag "$CI_COMMIT_REF_NAME" --file ffsend-x86_64-linux-gnu --name ffsend-$CI_COMMIT_REF_NAME-linux-x64