Skip to content

Commit

Permalink
hopefully fix travis
Browse files Browse the repository at this point in the history
  • Loading branch information
arguablykomodo committed Nov 26, 2018
1 parent 72ec561 commit 8fd9648
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 23 deletions.
38 changes: 15 additions & 23 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,27 +1,19 @@
language: go
go: "1.11"

stages:
- test
- deploy
script:
- cd compiler
- go get github.com/josephspurrier/goversioninfo/cmd/goversioninfo
- cd ..
- go run compiler/main.go $(git describe)
- ./update_tap.sh $TAP_TOKEN

jobs:
include:
- stage: test
script:
- go test

- stage: deploy
if: (tag =~ ^v) AND (branch = master) AND (repo = SrKomodo/shadowfox-updater)
script:
- cd compiler
- go get github.com/josephspurrier/goversioninfo/cmd/goversioninfo
- cd ..
- go run compiler/main.go $(git describe)
deploy:
provider: releases
api_key:
secure: IDjfAWsY8TIGCCHILaZ4V/HvrX/d29B20yhan7O6c0/DjGTCprappcVKBwD8yLPxUWVEfa7sWlO9BcVw4hclHAOHf8eq02I59gkip8ch36djkeub300rv340YrX//MAFEaPix/rI5zFGxswCwuojC+AacliltTpZEemqYp0jR6Shd0luS3BPLA0SApIl7cwLUONVM6L3gIGGmsaZDccKYR+sCuopuP40UgxoC3O4aw/hfg96ihgRkF3toKZSBMZFWvXMd82lsA+bI+WIjalBv/Om3gGWPI+7dlLrIZ5Xt3hOz110PTXi06VjRSsMZUZg7gfFeLI2/akKwjKRgflcMe8yMcGKvCEdYGa4unEDdry/l/LPaekZL2tj7QmqZDjMlVh2Cemrmuv0bZ6osekn3FNdMD7o3XX0OUkgvzKJdRnCVpOj0zCFRp3U5NRkBlnPbTlzc8p+OEKZRUAAaEDNSy39U22zYTQiEOsu1KmMP+ZzsxdXkQOQEW6jjO4dbWxVH4TTcYmM4JqhM6tlSpoXDgUJsZjtnme40FyjMYCEbG0VXI3xkTGMO/EowNDDHl5HHhqO3YELfLZREc2VTlirFnaSclvmiTc0MDJ+5MrXEYnVxb//0TkNzbZskFvsmbatzIAR31u8+Fpm2IFURgTnjfNPNG1i6MqAa3eve1frCdI=
file_glob: true
file: dist/*
skip_cleanup: true
deploy:
provider: releases
api_key:
secure: IDjfAWsY8TIGCCHILaZ4V/HvrX/d29B20yhan7O6c0/DjGTCprappcVKBwD8yLPxUWVEfa7sWlO9BcVw4hclHAOHf8eq02I59gkip8ch36djkeub300rv340YrX//MAFEaPix/rI5zFGxswCwuojC+AacliltTpZEemqYp0jR6Shd0luS3BPLA0SApIl7cwLUONVM6L3gIGGmsaZDccKYR+sCuopuP40UgxoC3O4aw/hfg96ihgRkF3toKZSBMZFWvXMd82lsA+bI+WIjalBv/Om3gGWPI+7dlLrIZ5Xt3hOz110PTXi06VjRSsMZUZg7gfFeLI2/akKwjKRgflcMe8yMcGKvCEdYGa4unEDdry/l/LPaekZL2tj7QmqZDjMlVh2Cemrmuv0bZ6osekn3FNdMD7o3XX0OUkgvzKJdRnCVpOj0zCFRp3U5NRkBlnPbTlzc8p+OEKZRUAAaEDNSy39U22zYTQiEOsu1KmMP+ZzsxdXkQOQEW6jjO4dbWxVH4TTcYmM4JqhM6tlSpoXDgUJsZjtnme40FyjMYCEbG0VXI3xkTGMO/EowNDDHl5HHhqO3YELfLZREc2VTlirFnaSclvmiTc0MDJ+5MrXEYnVxb//0TkNzbZskFvsmbatzIAR31u8+Fpm2IFURgTnjfNPNG1i6MqAa3eve1frCdI=
file_glob: true
file: dist/*
skip_cleanup: true
on:
tags: true
12 changes: 12 additions & 0 deletions tap_template
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
class ShadowfoxUpdater < Formula
desc "An automatic updater for ShadowFox"
homepage "https://github.com/SrKomodo/shadowfox-updater"
url "https://github.com/SrKomodo/shadowfox-updater/releases/download/tag/shadowfox_mac_x64"
version "tag"
sha256 "checksum"

def install
File.rename("shadowfox_mac_x64", "shadowfox")
bin.install "shadowfox"
end
end
23 changes: 23 additions & 0 deletions update_tap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/usr/bin/env bash

TAG=$(git describe)
CHECKSUM=$(sha256sum dist/shadowfox_mac_x64 | cut -d' ' -f1)

# clone repo
git clone https://github.com/SrKomodo/homebrew-tap.git
cd homebrew-tap
git remote rm origin
git remote add origin https://SrKomodo:$1@github.com/SrKomodo/homebrew-tap.git

# Compile template
IFS=''
while read line; do
REPLACE1=${line//tag/$TAG}
REPLACE2=${REPLACE1//checksum/$CHECKSUM}
echo $REPLACE2
done < ../tap_template > Formula/shadowfox-updater.rb

# Push to tap
git add Formula/shadowfox-updater.rb
git commit -m \"$TAG\"
git push --set-upstream origin master

0 comments on commit 8fd9648

Please sign in to comment.