Skip to content

Commit

Permalink
ci
Browse files Browse the repository at this point in the history
  • Loading branch information
mh-cbon committed Sep 7, 2017
1 parent 201b810 commit 1e45045
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 27 deletions.
11 changes: 6 additions & 5 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ script:
# - curl -L https://raw.githubusercontent.com/mh-cbon/go-bin-rpm/master/setup-repository.sh | GH=$GH EMAIL=$EMAIL sh -xe

before_deploy:
- POOL=`echo ${GH_APP} | cut -c 1`
# create the deb package
- cd $GOPATH/src/github.com/$TRAVIS_REPO_SLUG
- mkdir -p build/$OSARCH
Expand All @@ -70,20 +71,20 @@ before_deploy:
- cp $GH_APP-$OSARCH-$VERSION.deb $GH_APP-$OKARCH.deb
# upload to bintray
- curl -fL https://getcli.jfrog.io | sh
- ls -alh
- ./jfrog bt pc --key=$BTKEY --user=$GH_USER --licenses=MIT --vcs-url=https://github.com/$GH_USER/deb $GH_USER/deb/$GH_APP || echo "package already exists"
- ./jfrog bt upload --override=true --key $BTKEY --publish=true --deb=unstable/main/$OSARCH $GH_APP-$OSARCH-$VERSION.deb $GH_USER/deb/$GH_APP/$VERSION pool/g/$GH_APP/
# prepare rpm package creation
- ./jfrog bt upload --override=true --key $BTKEY --publish=true --deb=unstable/main/$OSARCH $GH_APP-$OSARCH-$VERSION.deb $GH_USER/deb/$GH_APP/$VERSION pool/$POOL/$GH_APP/
# create the rpm package
- docker pull fedora
# create the package in the docker
- >
docker run -v $PWD:/mnt/travis fedora /bin/sh -c
"cd /mnt/travis && (curl -s -L https://bintray.com/mh-cbon/rpm/rpm > /etc/yum.repos.d/w.repo) && dnf install go-bin-rpm changelog rpm-build -y --quiet && go-bin-rpm generate --file rpm.json -a $OSARCH --version $VERSION -o $GH_APP-$OSARCH-$VERSION.rpm"
# copy the rpm for gh release (backward compatibility)
- cp $GH_APP-$OSARCH-$VERSION.rpm $GH_APP-$OKARCH.rpm
# upload to bintray
- ./jfrog bt pc --key=$BTKEY --user=$GH_USER --licenses=MIT --vcs-url=https://github.com/$GH_USER/rpm $GH_USER/rpm/$GH_APP || echo "package already exists"
- ./jfrog bt upload --override=true --key $BTKEY --publish=true --deb=unstable/main/$OSARCH $GH_APP-$OSARCH-$VERSION.rpm $GH_USER/rpm/$GH_APP/$VERSION pool/g/$GH_APP/
- ./jfrog bt upload --override=true --key $BTKEY --publish=true $GH_APP-$OSARCH-$VERSION.rpm $GH_USER/rpm/$GH_APP/$VERSION pool/$POOL/$GH_APP/
# generate the repo metadata
- curl -X POST -u ${GH_USER}:${BTKEY} https://api.bintray.com/calc_metadata/${GH_USER}/rpm

deploy:
provider: releases
Expand Down
24 changes: 2 additions & 22 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ environment:
GOPATH: c:\gopath
JFROG_CLI_OFFER_CONFIG: false
VCS_URL: https://github.com/%APPVEYOR_REPO_NAME%
# GO15VENDOREXPERIMENT: 1
# CHOCOKEY:
# secure: HRc9tf57V3c3dVyn8hvMkKeiwK2oyWvOSjNXembIAQctNx+GTGBBaHI3bh+8cIgy
BT_KEY:
secure: P9xGXGG38T4AvO8XXXXcbaDG2sSN4t6KH92zssGp0nrbyQAZuxHD9F84s6PM9mOD
GH_TOKEN:
Expand Down Expand Up @@ -59,25 +56,8 @@ deploy_script:
- set GOARCH=amd64
- jfrog bt upload --user %GH_USER% --key %BT_KEY% --override=true --publish=true %GH_APP%-%GOARCH%-%VERSION%.msi %GH_USER%/msi/%GH_APP%/%VERSION%
# next section is a workaround for https://github.com/appveyor/ci/issues/1752
- gh-api-cli upload-release-asset -t %GH_TOKEN% -g "*-386.msi" -o %GH_USER% -r %GH_APP% --ver %VERSION%
- gh-api-cli upload-release-asset -t %GH_TOKEN% -g "*-amd64.msi" -o %GH_USER% -r %GH_APP% --ver %VERSION%

# build_script:
# - glide install
# - go test -v
# - go test github.com/mh-cbon/gump/config -v
# - go test github.com/mh-cbon/gump/stringexec -v
# - set MYAPP=gump
# - set GOARCH=386
# - 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%
# - set GOARCH=amd64
# - 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
- never-fail gh-api-cli upload-release-asset -t %GH_TOKEN% -g "*-386.msi" -o %GH_USER% -r %GH_APP% --ver %VERSION%
- never-fail gh-api-cli upload-release-asset -t %GH_TOKEN% -g "*-amd64.msi" -o %GH_USER% -r %GH_APP% --ver %VERSION%

artifacts:
- path: '*-386.msi'
Expand Down

0 comments on commit 1e45045

Please sign in to comment.