Skip to content

Commit

Permalink
Resort to github action
Browse files Browse the repository at this point in the history
  • Loading branch information
polyrabbit committed Dec 15, 2021
1 parent b506f24 commit 137cadc
Show file tree
Hide file tree
Showing 44 changed files with 2,839 additions and 2,326 deletions.
14 changes: 7 additions & 7 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version: 2
updates:
- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
time: "21:00"
timezone: Asia/Shanghai
open-pull-requests-limit: 10
- package-ecosystem: gomod
directory: "/"
schedule:
interval: daily
time: "21:00"
timezone: Asia/Shanghai
open-pull-requests-limit: 10
44 changes: 44 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CI
on: [ push, pull_request ]
jobs:
test:
strategy:
matrix:
os:
- ubuntu-latest
runs-on: ${{ matrix.os }}

steps:
- name: Checkout
uses: actions/checkout@master
with:
fetch-depth: 0

- name: Set Up Go
uses: actions/setup-go@v2
with:
go-version: '^1'

- name: Unit Test
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v2
with:
fail_ci_if_error: true
flags: unittests
verbose: true

- name: Integration Test
run: |
go run . -d -c my_token.example.yaml
curl -sfL https://raw.githubusercontent.com/polyrabbit/my-token/master/install.sh | bash -s -- -d #Ensure download script works
- name: GoReleaser
uses: goreleaser/goreleaser-action@v2
if: startsWith(github.ref, 'refs/tags/')
with:
version: latest
args: release --rm-dist --skip-validate
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
48 changes: 48 additions & 0 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
project_name: MyToken
release:
github:
owner: polyrabbit
name: my-token

mode: replace

builds:
- id: "mt-build"
binary: mt
flags:
- -v

ldflags:
- -X github.com/polyrabbit/my-token/config.Rev={{.ShortCommit}} -X github.com/polyrabbit/my-token/config.Version={{.Version}} -X github.com/polyrabbit/my-token/config.Date={{.Date}}

# GOOS list to build for.
# For more info refer to: https://golang.org/doc/install/source#environment
# Defaults are darwin and linux.
goos:
- linux
- darwin
- windows

# List of combinations of GOOS + GOARCH + GOARM to ignore.
# Default is empty.
ignore:
- goos: darwin
goarch: 386
- goos: linux
goarch: arm
goarm: 7
- goarm: mips64
gomips: hardfloat

checksum:
name_template: 'checksums.txt'

changelog:
sort: asc
filters:
exclude:
- '^docs:'
- '^tests:'

archives:
- name_template: "mt_{{ .Version }}_{{ .Os }}_{{ .Arch }}"
54 changes: 0 additions & 54 deletions .travis.yml

This file was deleted.

58 changes: 33 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# MyToken

[![Build Status](https://travis-ci.org/polyrabbit/my-token.svg?branch=master)](https://travis-ci.org/polyrabbit/my-token)
[![CI](https://github.com/polyrabbit/my-token/workflows/CI/badge.svg)](https://github.com/polyrabbit/my-token/actions)
[![codecov](https://codecov.io/gh/polyrabbit/my-token/branch/master/graph/badge.svg)](https://codecov.io/gh/polyrabbit/my-token)
[![License: MIT](https://img.shields.io/badge/License-MIT-brightgreen.svg)](https://opensource.org/licenses/MIT)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](https://github.com/polyrabbit/my-token/pulls)
Expand All @@ -10,31 +10,32 @@
![my-token](https://user-images.githubusercontent.com/2657334/76717485-8560d280-676e-11ea-94af-54a5e10e9b25.png)

my-token (or `mt` for short) is a CLI tool for those who are both **Crypto investors** and **Engineers**, allowing you to track token prices and changes in your favorite exchanges on the terminal.
my-token (or `mt` for short) is a CLI tool for those who are both **Crypto investors** and **Engineers**, allowing you
to track token prices and changes in your favorite exchanges on the terminal.

### Features

* Auto refresh on a specified interval, watch prices in live update mode
* Proxy aware HTTP request, for easy access to blocked exchanges
* Real-time prices from 12+ exchanges
* Auto refresh on a specified interval, watch prices in live update mode
* Proxy aware HTTP request, for easy access to blocked exchanges
* Real-time prices from 12+ exchanges

### Supported Exchanges

* [Binance](https://www.binance.com/)
* [CoinMarketCap](https://coinmarketcap.com/)
* [Bitfinex](https://www.bitfinex.com/)
* [Huobi.pro](https://www.huobi.pro/)
* [ZB](https://www.zb.com/)
* [OKEx](https://www.okex.com/)
* [Gate.io](https://gate.io/)
* [Bittrex](https://bittrex.com/)
* [HitBTC](https://hitbtc.com/)
* ~~[BigONE](https://big.one/)~~
* [Poloniex](https://poloniex.com/)
* [Kraken](https://www.kraken.com/)
* [Coinbase](https://www.coinbase.com/)
* _still adding..._
* [Binance](https://www.binance.com/)
* [CoinMarketCap](https://coinmarketcap.com/)
* [Bitfinex](https://www.bitfinex.com/)
* [Huobi.pro](https://www.huobi.pro/)
* [ZB](https://www.zb.com/)
* [OKEx](https://www.okex.com/)
* [Gate.io](https://gate.io/)
* [Bittrex](https://bittrex.com/)
* [HitBTC](https://hitbtc.com/)
* ~~[BigONE](https://big.one/)~~
* [Poloniex](https://poloniex.com/)
* [Kraken](https://www.kraken.com/)
* [Coinbase](https://www.coinbase.com/)
* _still adding..._

### Installation

#### Homebrew
Expand All @@ -44,17 +45,21 @@ my-token (or `mt` for short) is a CLI tool for those who are both **Crypto inves
```

#### `curl | bash` style downloads to `/usr/local/bin`

```bash
$ curl -sfL https://raw.githubusercontent.com/polyrabbit/my-token/master/install.sh | bash -s -- -d -b /usr/local/bin
```

#### Using [Go](https://golang.org/) (1.12+)
#### Using [Go](https://golang.org/) (1.16+)

```bash
$ go get -u github.com/polyrabbit/my-token
```

#### Manually
Download from [release page](https://github.com/polyrabbit/my-token/releases/latest) and extract the tarbal into /usr/bin or your `PATH` directory.

Download from [release page](https://github.com/polyrabbit/my-token/releases/latest) and extract the tarbal into
/usr/bin or your `PATH` directory.

### Usage

Expand Down Expand Up @@ -91,7 +96,8 @@ Find help/updates from here - https://github.com/polyrabbit/my-token
$ mt binance.BNBUSDT binance.BTCUSDT Huobi.HTUSDT
```

Here `Binance` and `Huobi` can be replaced by any supported exchanges, and different exchanges use different forms to express tokens/symbols/markets, refer to their URLs to find the format.
Here `Binance` and `Huobi` can be replaced by any supported exchanges, and different exchanges use different forms to
express tokens/symbols/markets, refer to their URLs to find the format.

* #### Auto-refresh on every 10 seconds

Expand All @@ -115,7 +121,9 @@ See issue [#3](https://github.com/polyrabbit/my-token/issues/3) for a discussion
$ mt -c my_token.example.yaml
```

my-token can also read options from configuration file, see the attached [my_token.example.yaml](my_token.example.yaml) for its format. By default my-token searches configuration file `my_token.yml` in current directory and `$HOME`, so you can compose a `my_token.yml`, place it in your `$HOME` and just type `mt` to get all pre-defined prices.
my-token can also read options from configuration file, see the attached [my_token.example.yaml](my_token.example.yaml)
for its format. By default my-token searches configuration file `my_token.yml` in current directory and `$HOME`, so you
can compose a `my_token.yml`, place it in your `$HOME` and just type `mt` to get all pre-defined prices.

```bash
$ # Generate an example config file to my $HOME directory
Expand All @@ -128,7 +136,7 @@ $ mt # <--- This is also the way I used most freqently

### Thanks

* Inspired by [coinmon](https://github.com/bichenkk/coinmon)
* Inspired by [coinmon](https://github.com/bichenkk/coinmon)

### License

Expand Down
Loading

0 comments on commit 137cadc

Please sign in to comment.