Skip to content

Instantly share code, notes, and snippets.

@machsix
Created January 25, 2019 19:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save machsix/bad55bdcb1b2b676e8eb56e029265cc4 to your computer and use it in GitHub Desktop.
Save machsix/bad55bdcb1b2b676e8eb56e029265cc4 to your computer and use it in GitHub Desktop.
notifications:
email: false
services:
- postgresql
- docker
addons:
postgresql: "9.4"
language: go
go_import_path: "miniflux.app"
go:
- "1.11"
before_install:
- npm install -g jshint
- go get -u golang.org/x/lint/golint
script:
- jshint ui/static/js/*.js
- make lint
- make linux-amd64
- export TRAVIS_TAG=`git describe --abbrev=0 --tags`
- "echo \"Main version: ${TRAVIS_TAG}\""
before_deploy:
- git config --global user.email "travis@travis-ci.org"
- git config --global user.name "Travis CI"
- git tag -d ${TRAVIS_TAG}
- echo 'Delete tag'
- git push https://${GH_USER}:${GH_TOKEN}@github.com/${GH_REF} :refs/tags/${TRAVIS_TAG}
- "export ID=`curl -H \"Authorization: token ${GH_TOKEN}\" -X GET https://api.github.com/repos/${GH_REF}/releases|jq \".[0].id\"`"
- echo 'Delete draft release'
- "if [[ $ID != 'null' ]]; then curl -H \"Authorization: token ${GH_TOKEN}\" -X DELETE https://api.github.com/repos/${GH_REF}/releases/$id; fi"
- cp miniflux.1 LICENSE ChangeLog miniflux-linux-amd64 rpmbuild/SOURCES/
- "export SUBVER=`git rev-list \"${TRAVIS_TAG}\"..\"${TRAVIS_COMMIT}\" --count`"
- export SUBVER=$(($SUBVE + 1))
- "git tag -a ${TRAVIS_TAG} -m \"subversion: ${SUBVER}\""
- git push https://${GH_USER}:${GH_TOKEN}@github.com/${GH_REF} refs/tags/${TRAVIS_TAG}:refs/tags/${TRAVIS_TAG}
- "echo \"Minor version: ${SUBVER}\""
- "sed -i \"s|^Version:.*$|Version: ${TRAVIS_TAG}|\" rpmbuild/SPECS/miniflux.spec"
- "sed -i \"s|^Release:.*$|Release: ${SUBVER}%{?dist}|\" rpmbuild/SPECS/miniflux.spec"
- docker build -t miniflux/rpmbuild -f rpmbuild/Dockerfile .
- docker run --rm -v $(pwd)/rpmbuild:/root/rpmbuild miniflux/rpmbuild rpmbuild -bb /root/rpmbuild/SPECS/miniflux.spec
- find ./rpmbuild -name '*.rpm' -exec cp {} ./ \;
deploy:
overwrite: true
provider: releases
api_key: "$GH_TOKEN"
file_glob: true
file:
- "miniflux-linux-amd64"
- "*.rpm"
skip_cleanup: true
on:
branch: master'}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment