Skip to content

Commit

Permalink
packaging: add choco package, add deb/rpm repositories
Browse files Browse the repository at this point in the history
  • Loading branch information
mh-cbon committed Jul 30, 2016
1 parent 8a1f487 commit 0c7cc36
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 40 deletions.
34 changes: 19 additions & 15 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,20 @@ language: go
go:
- tip

env:
global:
- MYAPP=gump
- MYEMAIL=mh-cbon@users.noreply.github.com
- secure: mRjSrjYptJnoBc15WbSKSkVe2loD0QeiRBeNnGe/uaTLASi6u7Q5B7TMRmGWlahVt+gEKz7BGnYheL+E1tk1yXi5ArGWXW0Rlm1pXbeP1c3T0cWzoHmuxQU7MyEOWb4xVyY7pEKTK8eSVbX4EqBmLXwK2fx8MK08l9vtGH3dNy9VSfKU06EFGjXKE7/i7nfB+0iYtlxnmjW+d6QR2MAuBh+jMy4ikgOffFFHwc6H7c6aHKcs2bcSOc4kmBSoyJ7pMRPX8CKayGFjURa9rX0P0+w9/G2/yE0qfWRJRVA6PrifS2fHR6ul7OAjLwSsF3lJHv/DeKchlO9yEBRWLvwmHPspHxttj1YPft5o4mb/EdQDgyGZYsQn78Js8Bk/jetplVy49mxu5WZDyOwz50EE7jt2i0/IDMNusjfO5kVTflEuv5k04K3/bNCva0c7W12rfq1lAOxo0lci6zxxNofo5Sh92Hw9daQsI6anJEULNCwl58287s/8urbs/WMCGyF4HsZ8kK5oJb94c3XhoHSpZwT/utmf/FDy/VfjK3Y1sXhtIk/LUVHGfGioLXo2701G5hIeQw9k+7BqLLdYobdTNLElQ/L2qYURmwNSuuWhSpLblXZPXuBqu9l1okKWp5ntB0oALsBGiQbfRLltP6m9d77IgXF2s34Uz9Psap30RlM=

before_install:
- sudo apt-get -qq update
- sudo apt-get install build-essential lintian -y
- mkdir -p ${GOPATH}/bin
- cd ~
- curl https://glide.sh/get | sh
- curl -L https://raw.githubusercontent.com/mh-cbon/latest/master/install.sh | GH=mh-cbon/changelog sh -xe
- curl -L https://raw.githubusercontent.com/mh-cbon/latest/master/install.sh | GH=mh-cbon/go-bin-deb sh -xe

install:
- cd $GOPATH/src/github.com/mh-cbon/gump
- cd $GOPATH/src/github.com/mh-cbon/$MYAPP
- glide install
- go install

Expand All @@ -26,24 +29,25 @@ script: echo "pass"
before_deploy:
- mkdir -p build/{386,amd64}
- mkdir -p pkg-build/{386,amd64}
- GOOS=linux GOARCH=386 go build --ldflags "-X main.VERSION=${TRAVIS_TAG}" -o build/386/gump gump.go
- GOOS=linux GOARCH=amd64 go build --ldflags "-X main.VERSION=${TRAVIS_TAG}" -o build/amd64/gump gump.go
- go-bin-deb generate -a 386 --version ${TRAVIS_TAG} -w pkg-build/386/ -o ${TRAVIS_BUILD_DIR}/gump-386.deb
- go-bin-deb generate -a amd64 --version ${TRAVIS_TAG} -w pkg-build/amd64/ -o ${TRAVIS_BUILD_DIR}/gump-amd64.deb
- rm -fr pkg-build*/
- docker run -v $PWD:/docker fedora /bin/sh -c "cd /docker && sh ./docker.sh ${TRAVIS_TAG} gump"
- sudo chown travis:travis gump-{386,amd64}.rpm
- GOOS=linux GOARCH=386 go build --ldflags "-X main.VERSION=${TRAVIS_TAG}" -o build/386/$MYAPP gump.go
- GOOS=linux GOARCH=amd64 go build --ldflags "-X main.VERSION=${TRAVIS_TAG}" -o build/amd64/$MYAPP gump.go
- curl -L https://raw.githubusercontent.com/mh-cbon/go-bin-deb/master/create-pkg.sh | GH=mh-cbon/$MYAPP sh -xe
- curl -L https://raw.githubusercontent.com/mh-cbon/go-bin-rpm/master/create-pkg.sh | GH=mh-cbon/$MYAPP sh -xe

after_deploy:
- curl -L https://raw.githubusercontent.com/mh-cbon/go-bin-deb/master/setup-repository.sh | GH=mh-cbon/$MYAPP EMAIL=$MYEMAIL sh -xe
- curl -L https://raw.githubusercontent.com/mh-cbon/go-bin-rpm/master/setup-repository.sh | GH=mh-cbon/$MYAPP EMAIL=$MYEMAIL sh -xe

deploy:
provider: releases
api_key:
secure: LDIJf5MDzbJ0RScFaxWBjyL6h8jZaHhr0ek7HZ4ubUVlvF+amwysMhK9vdgIb/4HTgLUUUFEIALlvstwGFf/LsLBs0OHZM3EPRY7A6/kt9s/aIJB3sfWSXRf+7ta+UrUeVVzKQxdXtTBT+Hba/hOu68A9vPA/v+h3107XkWng289au1RC41ZhrXbmV8PWb4WTYwt1OWhi+tgyULgsl2k8DG8OXRsVi3RMJEihEUXxcLo3R8GR7nBXZFgnxmuX45/9BuDBaFwEkKamCyidmV8CMZSB1EMSo3a+dcwihwdMpY3mvSUmJMurpNJuB0hY1ge8ANmI7kv8VivKRoc0JO8i4+vrArunUoz1LtNHxrvANfDMesvxW1by7N8S9k87Gym82Lm9VMDP1sXVQ4vvMGONayfzBH3A9I7AIhA80H6yfDtxQnwdLTI9hgYNmGGmhXImOSy5cE87CInPgGzc9BvmXnVTirgt7zyQ6Q6xpfxe37o2H/SrpZzvuzBbvmUGjM1DpWcMJTvu7WjkXVJN76hgRYLhLVl4lWVIeXlaUFqXyMoQCOeD38ryjC8+w8Pa0xnqYWM2QAPueVnl/X86IorbB865ZoF7ygp0O5Ujpxb5JZ8aUeGefo5t8+Dc0Y6c1U9LIGNTVsD16Wzn474ETL1vuNI2D19zGWCfCKG8d8cUxY=
file_glob: true
file:
- gump-386.deb
- gump-amd64.deb
- gump-386.rpm
- gump-amd64.rpm
- $MYAPP-386.deb
- $MYAPP-amd64.deb
- $MYAPP-386.rpm
- $MYAPP-amd64.rpm
skip_cleanup: true
on:
tags: true
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,17 @@ Bin util to bump your package using semver

Pick an msi package [here](https://github.com/mh-cbon/gump/releases)!

__deb/rpm__
__deb/ubuntu/rpm repositories__

```sh
wget -O - https://raw.githubusercontent.com/mh-cbon/latest/master/source.sh \
| GH=mh-cbon/gump sh -xe
# or
curl -L https://raw.githubusercontent.com/mh-cbon/latest/master/source.sh \
| GH=mh-cbon/gump sh -xe
```

__deb/ubuntu/rpm packages__

```sh
curl -L https://raw.githubusercontent.com/mh-cbon/latest/master/install.sh \
Expand All @@ -17,6 +27,12 @@ https://raw.githubusercontent.com/mh-cbon/latest/master/install.sh \
| GH=mh-cbon/gump sh -xe
```

__chocolatey__

```sh
choco install gump -y
```

__go__

```sh
Expand Down
18 changes: 12 additions & 6 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ skip_non_tags: true
environment:
GOPATH: c:\gopath
GO15VENDOREXPERIMENT: 1
CHOCOKEY:
secure: KOJemGCpMfF6oFpELBKidDtSZOXTMIjvdoHYESlI2OjHRgjN6fOS+XdWG9Ol+17T
GHTOKEN:
secure: WVMaMjrLzXN8YNcnFRfcucTYWtvoDeE/4b2TUGQBZDvv7u+ERBQ///z5Q8qYSt0L

install:
- curl -fsSL -o C:\wix310-binaries.zip http://static.wixtoolset.org/releases/v3.10.3.3007/wix310-binaries.zip
Expand All @@ -15,11 +19,9 @@ install:
- go version
- go env
- go get -u github.com/Masterminds/glide
- curl -fsSL -o C:\go-msi.msi https://github.com/mh-cbon/go-msi/releases/download/0.0.23/go-msi-amd64.msi
- DIR C:\
- msiexec.exe /i C:\go-msi.msi /quiet
- set PATH=C:\Program Files\go-msi\;%PATH% # need to set this manually ? ...
- echo %PATH%
- curl -fsSL -o C:\latest.bat https://raw.githubusercontent.com/mh-cbon/latest/master/latest.bat?a=1
- cmd /C C:\latest.bat mh-cbon go-msi amd64
- set PATH=C:\Program Files\go-msi\;%PATH%

build_script:
- glide install
Expand All @@ -31,6 +33,10 @@ build_script:
- go build -o %MYAPP%.exe --ldflags "-X main.VERSION=%APPVEYOR_REPO_TAG_NAME%" gump.go
- go-msi.exe make --msi %APPVEYOR_BUILD_FOLDER%\%MYAPP%-%GOARCH%.msi --version %APPVEYOR_REPO_TAG_NAME% --arch %GOARCH%

after_deploy:
- go-msi.exe choco --input %APPVEYOR_BUILD_FOLDER%\%APPVEYOR_PROJECT_NAME%-%GOARCH%.msi --version %APPVEYOR_REPO_TAG_NAME%
- choco push -k="'%CHOCOKEY%'" %APPVEYOR_PROJECT_NAME%.%APPVEYOR_REPO_TAG_NAME%.nupkg

test: off

artifacts:
Expand All @@ -46,7 +52,7 @@ deploy:
prerelease: false
description: "Release %APPVEYOR_REPO_TAG_NAME%"
auth_token:
secure: KCSQ5Lux18jVHKiuoiw50YTHG82Ii5PoBOhynj8kEqT/Rwm7sjKwdoUfnuT5i+JS
secure: WVMaMjrLzXN8YNcnFRfcucTYWtvoDeE/4b2TUGQBZDvv7u+ERBQ///z5Q8qYSt0L
on:
branch:
- master
Expand Down
14 changes: 0 additions & 14 deletions docker.sh

This file was deleted.

6 changes: 4 additions & 2 deletions glide.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package: github.com/mh-cbon/gump
scripts:
prebump: 666 git fetch --tags
prebump: 666 git fetch --tags origin master && 666 git pull origin master
preversion: |
philea -s "666 go vet %s" "666 go-fmt-fail %s" \
&& 666 go run gump.go -v \
Expand All @@ -10,7 +10,9 @@ scripts:
666 changelog md -o CHANGELOG.md --vars='{"name":"gump"}' \
&& 666 commit -q -m "changelog: !newversion!" -f CHANGELOG.md \
&& 666 git push && 666 git push --tags \
&& 666 gh-api-cli create-release -n release -o mh-cbon -r gump --ver !newversion! \
&& 666 gh-api-cli create-release -n release -o mh-cbon -r gump \
--ver !newversion! -c "changelog ghrelease --version !newversion!" \
--draft !isprerelease! \
&& 666 go install --ldflags "-X main.VERSION=!newversion!"
import:
- package: github.com/docopt/docopt.go
Expand Down
10 changes: 8 additions & 2 deletions wix.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,11 @@
}
]
},
"shortcuts": {}
}
"shortcuts": {},
"choco": {
"description": "Bin util to bump your package using semver",
"project-url": "https://github.com/mh-cbon/gump",
"tags": "bump",
"license-url": "https://github.com/mh-cbon/gump/blob/master/LICENSE"
}
}

0 comments on commit 0c7cc36

Please sign in to comment.