Skip to content

Commit

Permalink
Fix deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
awiddersheim committed Aug 3, 2018
1 parent 40b131d commit e1f5678
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 21 deletions.
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,6 @@ workflows:
- build
filters:
branches:
only: master
ignore: /.*/
tags:
only: /^v.*/
44 changes: 24 additions & 20 deletions release.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,29 @@ def run_command(command):
).strip().decode('utf-8')


github = Github(os.environ['GITHUB_TOKEN'])

repo = github.get_user().get_repo(
run_command('python setup.py --name'),
)

tag = 'v{}'.format(run_command('python setup.py --version'))

release = repo.create_git_release(
tag=tag,
name=tag,
message=run_command(
'git show --no-patch --pretty=format:"%s%n%b" {}'.format(
os.environ['CIRCLE_SHA1'],
def main()
github = Github(os.environ['GITHUB_TOKEN'])

repo = github.get_user().get_repo(
run_command('python setup.py --name'),
)

tag = 'v{}'.format(run_command('python setup.py --version'))

release = repo.create_git_release(
tag=tag,
name=tag,
message=run_command(
'git show --no-patch --pretty=format:"%s%n%b" {}'.format(
os.environ['CIRCLE_SHA1'],
),
),
),
prerelease=os.environ.get('CIRCLE_TAG') is None,
target_commitish=os.environ.get('CIRCLE_TAG', os.environ['CIRCLE_SHA1'])
)
target_commitish=os.environ['CIRCLE_SHA1'],
)

for item in glob.glob(sys.argv[1]):
release.upload_asset(item)

for item in glob.glob(sys.argv[1]):
release.upload_asset(item)
if __name__ == '__main__':
if os.environ.get('CIRCLE_TAG'):
main()

0 comments on commit e1f5678

Please sign in to comment.