Skip to content

Commit

Permalink
Add release section and musl targets in travis configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
juan-leon committed Apr 26, 2021
1 parent c8edd3d commit a4c70ce
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 6 deletions.
21 changes: 18 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,22 +1,37 @@
language: rust
jobs:
include:
# Stable channel.
- os: linux
rust: stable
env: TARGET=x86_64-unknown-linux-gnu
- os: linux
rust: stable
env: TARGET=i686-unknown-linux-gnu
env: TARGET=x86_64-unknown-linux-musl
- os: osx
osx_image: xcode11.4 # Catalina
rust: stable
env: TARGET=x86_64-apple-darwin

env:
global:
# Default target on travis-ci.
# Used as conditional check in the install stage
- HOST=x86_64-unknown-linux-gnu
# Used on the deployment script
- PROJECT_NAME=lowcharts

before_deploy:
- bash ci/before_deploy

deploy:
provider: releases
api_key:
secure: "ERwRPSWDU9cBE5DysvxPBlTz+BYVUjk+NpZZW1MWgd1MLj2HyW618QyJ025F57GaOed8kVvPXaSJ6wnsOhSnz5r3zI4kZueN5AwC6slAnmLqro6/5QBmCtKaK1Di72xJoF1iMh78jRVmIt+NuMo3crduZke+1JRcWnOe/qasDCfiRxfAJwRc4rj3Y0bfPLC1AVOasD4sUmaafwJAOjyuBJW7x7vu1fQTHs/QEThnoqdHJSTR8htd77ff7Iv+3+kFWYALOA2S8A8CGpEvHEAs6Yvt0ndaBqI/wfG6GUPZYErzJc2ZsVqjvWQexVw+J8pW54uOaDNfg6UTOMPTBdZC+Nz3VkIZehEHcNDjPCkp3am4DKubmhZz2XK8FvY5fNIRR+7dKb61USvzS9dv8INYrwjqFUOGqgS2TzzaqDELXsKyN+mMrr1VWc6RfnBnt1v9GH6KBwySYZbAwDaGapFOmYdj9/bg7wfD+7xk2cmq+8R4vukpEIHcQs8dNusYltQ/btYL0uTGToCQnjB3djSY30DUa+dvpgRzhL0Mw4CsXEjdOVCRP8sJpx/lUeRZv4ZKjYTKv96WBBxTlbNV55R9PPcr4d5uTqu+iSg0vDnDejyuRyPi9klj6bpiFumjLNqSNnJA7nQq7RWE9f8Xew7VEmNJd5MmJfS7KQiT8B0LGkw="
file:
- $PROJECT_NAME-$TRAVIS_TAG-$TARGET.tar.gz
skip_cleanup: true
on:
tags: true

install:
# prevent target re-add error from rustup
- if [[ $TRAVIS_OS_NAME = linux && $HOST != $TARGET ]]; then rustup target add $TARGET; fi
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "lowcharts"
version = "0.1.0"
version = "0.2.0"
authors = ["JuanLeon Lahoz <[email protected]>"]
edition = "2018"
description = "Tool to draw low-resolution graphs in terminal"
Expand Down
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,14 @@ of a metric over time, but not the speed of that evolution.

There is regex support for this type of plots.

### Installing

### Building
#### Via release

Go over https://github.com/juan-leon/lowcharts/releases/ and download the binary
you want. Decompress the file and copy the binary to your path.

#### Via local compilation

```
$ git clone https://github.com/juan-leon/lowcharts
Expand Down
27 changes: 27 additions & 0 deletions ci/before_deploy
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/env bash

set -ex

function pack {
local tempdir pwd package_name

tempdir=$(mktemp -d 2>/dev/null || mktemp -d -t tmp)
pwd=$(pwd)
package_name="$PROJECT_NAME-$TRAVIS_TAG-$TARGET"
echo "fixme pwd is $pwd"
echo "fixme package_name is $package_name"

mkdir -p "$tempdir/$package_name"

cp "target/$TARGET/release/$PROJECT_NAME" "$tempdir/$package_name/"
strip "$tempdir/$package_name/$PROJECT_NAME"

pushd "$tempdir"
tar cvzf "$pwd/$package_name.tar.gz" "$package_name"/*
popd
rm -r "$tempdir"
}

cargo build --target "$TARGET" --release --verbose
pack
ls -l # fixme

0 comments on commit a4c70ce

Please sign in to comment.