Skip to content

Commit 137cadc

Browse files
committed
Resort to github action
1 parent b506f24 commit 137cadc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+2839
-2326
lines changed

.github/dependabot.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
version: 2
22
updates:
3-
- package-ecosystem: gomod
4-
directory: "/"
5-
schedule:
6-
interval: daily
7-
time: "21:00"
8-
timezone: Asia/Shanghai
9-
open-pull-requests-limit: 10
3+
- package-ecosystem: gomod
4+
directory: "/"
5+
schedule:
6+
interval: daily
7+
time: "21:00"
8+
timezone: Asia/Shanghai
9+
open-pull-requests-limit: 10

.github/workflows/ci.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI
2+
on: [ push, pull_request ]
3+
jobs:
4+
test:
5+
strategy:
6+
matrix:
7+
os:
8+
- ubuntu-latest
9+
runs-on: ${{ matrix.os }}
10+
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@master
14+
with:
15+
fetch-depth: 0
16+
17+
- name: Set Up Go
18+
uses: actions/setup-go@v2
19+
with:
20+
go-version: '^1'
21+
22+
- name: Unit Test
23+
run: go test -v -race -coverprofile=coverage.txt -covermode=atomic ./...
24+
25+
- name: Upload coverage to Codecov
26+
uses: codecov/codecov-action@v2
27+
with:
28+
fail_ci_if_error: true
29+
flags: unittests
30+
verbose: true
31+
32+
- name: Integration Test
33+
run: |
34+
go run . -d -c my_token.example.yaml
35+
curl -sfL https://raw.githubusercontent.com/polyrabbit/my-token/master/install.sh | bash -s -- -d #Ensure download script works
36+
37+
- name: GoReleaser
38+
uses: goreleaser/goreleaser-action@v2
39+
if: startsWith(github.ref, 'refs/tags/')
40+
with:
41+
version: latest
42+
args: release --rm-dist --skip-validate
43+
env:
44+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.goreleaser.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
project_name: MyToken
2+
release:
3+
github:
4+
owner: polyrabbit
5+
name: my-token
6+
7+
mode: replace
8+
9+
builds:
10+
- id: "mt-build"
11+
binary: mt
12+
flags:
13+
- -v
14+
15+
ldflags:
16+
- -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}}
17+
18+
# GOOS list to build for.
19+
# For more info refer to: https://golang.org/doc/install/source#environment
20+
# Defaults are darwin and linux.
21+
goos:
22+
- linux
23+
- darwin
24+
- windows
25+
26+
# List of combinations of GOOS + GOARCH + GOARM to ignore.
27+
# Default is empty.
28+
ignore:
29+
- goos: darwin
30+
goarch: 386
31+
- goos: linux
32+
goarch: arm
33+
goarm: 7
34+
- goarm: mips64
35+
gomips: hardfloat
36+
37+
checksum:
38+
name_template: 'checksums.txt'
39+
40+
changelog:
41+
sort: asc
42+
filters:
43+
exclude:
44+
- '^docs:'
45+
- '^tests:'
46+
47+
archives:
48+
- name_template: "mt_{{ .Version }}_{{ .Os }}_{{ .Arch }}"

.travis.yml

-54
This file was deleted.

README.md

+33-25
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# MyToken
22

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

13-
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.
13+
my-token (or `mt` for short) is a CLI tool for those who are both **Crypto investors** and **Engineers**, allowing you
14+
to track token prices and changes in your favorite exchanges on the terminal.
1415

1516
### Features
1617

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

2122
### Supported Exchanges
2223

23-
* [Binance](https://www.binance.com/)
24-
* [CoinMarketCap](https://coinmarketcap.com/)
25-
* [Bitfinex](https://www.bitfinex.com/)
26-
* [Huobi.pro](https://www.huobi.pro/)
27-
* [ZB](https://www.zb.com/)
28-
* [OKEx](https://www.okex.com/)
29-
* [Gate.io](https://gate.io/)
30-
* [Bittrex](https://bittrex.com/)
31-
* [HitBTC](https://hitbtc.com/)
32-
* ~~[BigONE](https://big.one/)~~
33-
* [Poloniex](https://poloniex.com/)
34-
* [Kraken](https://www.kraken.com/)
35-
* [Coinbase](https://www.coinbase.com/)
36-
* _still adding..._
37-
24+
* [Binance](https://www.binance.com/)
25+
* [CoinMarketCap](https://coinmarketcap.com/)
26+
* [Bitfinex](https://www.bitfinex.com/)
27+
* [Huobi.pro](https://www.huobi.pro/)
28+
* [ZB](https://www.zb.com/)
29+
* [OKEx](https://www.okex.com/)
30+
* [Gate.io](https://gate.io/)
31+
* [Bittrex](https://bittrex.com/)
32+
* [HitBTC](https://hitbtc.com/)
33+
* ~~[BigONE](https://big.one/)~~
34+
* [Poloniex](https://poloniex.com/)
35+
* [Kraken](https://www.kraken.com/)
36+
* [Coinbase](https://www.coinbase.com/)
37+
* _still adding..._
38+
3839
### Installation
3940

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

4647
#### `curl | bash` style downloads to `/usr/local/bin`
48+
4749
```bash
4850
$ curl -sfL https://raw.githubusercontent.com/polyrabbit/my-token/master/install.sh | bash -s -- -d -b /usr/local/bin
4951
```
5052

51-
#### Using [Go](https://golang.org/) (1.12+)
53+
#### Using [Go](https://golang.org/) (1.16+)
54+
5255
```bash
5356
$ go get -u github.com/polyrabbit/my-token
5457
```
5558

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

5964
### Usage
6065

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

94-
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.
99+
Here `Binance` and `Huobi` can be replaced by any supported exchanges, and different exchanges use different forms to
100+
express tokens/symbols/markets, refer to their URLs to find the format.
95101

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

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

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

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

129137
### Thanks
130138

131-
* Inspired by [coinmon](https://github.com/bichenkk/coinmon)
139+
* Inspired by [coinmon](https://github.com/bichenkk/coinmon)
132140

133141
### License
134142

0 commit comments

Comments
 (0)