Skip to content

Commit

Permalink
tagged releases
Browse files Browse the repository at this point in the history
  • Loading branch information
chrmoritz committed Feb 28, 2014
1 parent b837ce4 commit 5efa6b8
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ script:
- mac/travis.rb
branches:
only:
- master
- /^v?(\d)+(\.\d+)*/

This comment has been minimized.

Copy link
@chrmoritz

chrmoritz Feb 28, 2014

Author Collaborator

@wizzomafizzo builds are now only triggered when pushing a tag (or a branch, so pls don't name a branch after a version number) matching this regex

This comment has been minimized.

Copy link
@chrmoritz

chrmoritz Feb 28, 2014

Author Collaborator

BTW: you may want to run git tag -d git tag | grep -v 0.1`` now (to delete all local tags except 0.1)

This comment has been minimized.

Copy link
@wizzomafizzo

wizzomafizzo Mar 1, 2014

Owner

BAM

8 changes: 2 additions & 6 deletions mac/starcheat.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@

class Starcheat < Formula
homepage 'https://github.com/wizzomafizzo/starcheat'
url 'https://github.com/wizzomafizzo/starcheat.git'
version 'beta'
url 'https://github.com/wizzomafizzo/starcheat/archive/0.1.tar.gz'

devel do
url 'https://github.com/wizzomafizzo/starcheat.git', :branch => 'dev'
version 'dev'
end
head 'https://github.com/wizzomafizzo/starcheat.git', :branch => 'dev'

depends_on :python3
depends_on 'pyqt5'
Expand Down
13 changes: 9 additions & 4 deletions mac/travis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,24 @@ def system cmd, *args
raise "error" unless Kernel.system cmd, *args
end

# Build starcheat
system 'python3', 'build.py', '-v'
# Run some tests
FileUtils.cd 'build'
system './starcheat.py', '-v'
# run some other unit test here
unless ENV['TRAVIS_BUILD_ID'].nil? || ENV['TRAVIS_SECURE_ENV_VARS'] == 'false'
# ToDo: run some other unit test here
unless ENV['TRAVIS_BUILD_ID'].nil? || ENV['TRAVIS_SECURE_ENV_VARS'] == 'false' || "#{ENV['TRAVIS_BRANCH']}" !~ /^v?(\d)+(\.\d+)*/
# Build OS X .app
FileUtils.mv '../mac/setup.py', '.'
system 'python3', 'setup.py', 'py2app'
system '/usr/local/opt/qt5/bin/macdeployqt', 'dist/starcheat.app', '-verbose=2'
# Test OS X .app
FileUtils.mv 'dist/starcheat.app', 'StarCheat.app'
system 'StarCheat.app/Contents/MacOS/starcheat', '-v'
# Upload OS X .app to Github Releases
system 'tar', 'czf', 'starcheat.tar.gz', 'StarCheat.app'
puts '==> Uploading'
`curl -H "Authorization: token #{ENV['HOMEBREW_GITHUB_API_TOKEN']}" -H "Accept: application/json" -d '{"tag_name":"#{ENV['TRAVIS_COMMIT'][0..6]}","target_commitish":"#{ENV['TRAVIS_COMMIT']}","name":"starcheat (#{ENV['TRAVIS_COMMIT'][0..6]})","prerelease":true}' https://api.github.com/repos/wizzomafizzo/starcheat/releases` =~ /.*"upload_url":\s*"([\w\.\:\/]*){\?name}.*/m
`curl -H "Authorization: token #{ENV['HOMEBREW_GITHUB_API_TOKEN']}" -H "Accept: application/json" -H "Content-Type: application/gzip" --data-binary @starcheat.tar.gz #{$1}?name=starcheat-#{ENV['TRAVIS_COMMIT'][0..6]}.tar.gz` unless $1.nil?
`curl -H "Authorization: token #{ENV['HOMEBREW_GITHUB_API_TOKEN']}" -H "Accept: application/json" -d '{"tag_name":"#{ENV['TRAVIS_BRANCH']}","name":"starcheat #{ENV['TRAVIS_BRANCH']}"}' https://api.github.com/repos/wizzomafizzo/starcheat/releases` =~ /.*"upload_url":\s*"([\w\.\:\/]*){\?name}.*/m
`curl -H "Authorization: token #{ENV['HOMEBREW_GITHUB_API_TOKEN']}" -H "Accept: application/json" -H "Content-Type: application/gzip" --data-binary @starcheat.tar.gz #{$1}?name=starcheat-#{ENV['TRAVIS_BRANCH']}-osx.tar.gz` unless $1.nil?
raise "Skipping uploading build because tag is already in use" if $1.nil?
end

0 comments on commit 5efa6b8

Please sign in to comment.