Skip to content

Commit fb7aaf5

Browse files
plusvicjoseotoro
andauthored
Migrate from Travis-CI to GitHub Actions. (#36)
Co-authored-by: Jose Toro <josetoro@google.com>
1 parent cf3d207 commit fb7aaf5

File tree

5 files changed

+48
-29
lines changed

5 files changed

+48
-29
lines changed

.github/workflows/build.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Build
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- master
9+
jobs:
10+
build:
11+
name: Build
12+
runs-on: ubuntu-latest
13+
steps:
14+
- uses: actions/checkout@v2
15+
- uses: actions/setup-go@v2
16+
- name: Build
17+
run: make build

.github/workflows/release.yaml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Release
2+
on:
3+
push:
4+
tags:
5+
- "*.*.*"
6+
jobs:
7+
create_release:
8+
name: Create release
9+
runs-on: ubuntu-latest
10+
env:
11+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
12+
steps:
13+
- uses: actions/checkout@v2
14+
- uses: actions/setup-go@v2
15+
- id: get_version
16+
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
17+
- name: Install dependencies
18+
run: |
19+
go get github.com/mitchellh/gox
20+
go get github.com/tcnksm/ghr
21+
- name: Add GOPATH to search path
22+
run: echo `go env GOPATH`/bin >> $GITHUB_PATH
23+
- name: Build
24+
run: make all
25+
env:
26+
VERSION: ${{ steps.get_version.outputs.VERSION }}
27+
- name: Create release
28+
run: ./new_release.sh
29+
env:
30+
VERSION: ${{ steps.get_version.outputs.VERSION }}

.travis.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

Makefile

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
# This how we want to name the binary output
22
BINARY=./build/vt
33

4-
# These are the value we want to pass for VERSION
5-
VERSION=`git describe`
6-
74
# Setup the -ldflags option for go build here, interpolate the variable values
85
LDFLAGS=-ldflags "-X github.com/VirusTotal/vt-cli/cmd.Version=${VERSION}"
96

deploy.sh renamed to new_release.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ zip -j dist/Linux32.zip build/linux/386/vt
66
zip -j dist/Linux64.zip build/linux/amd64/vt
77
zip -j dist/Windows32.zip build/windows/386/vt.exe
88
zip -j dist/Windows64.zip build/windows/amd64/vt.exe
9-
ghr -t $GITHUB_TOKEN -u VirusTotal -replace $TRAVIS_TAG dist/
9+
ghr -t $GITHUB_TOKEN -u VirusTotal -replace $VERSION dist/

0 commit comments

Comments
 (0)