Skip to content

Commit e4efaab

Browse files
graingertcodingjoe
authored andcommitted
Fix automated NPM deployment process (#505)
Use skip_cleanup to distribute build artifacts.
1 parent 1e8971c commit e4efaab

File tree

2 files changed

+14
-10
lines changed

2 files changed

+14
-10
lines changed

.travis.yml

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,23 @@ script:
5252
- tox -e $TOXENV
5353
after_success:
5454
- codecov
55-
before_deploy: ./set_version.py
55+
before_deploy:
56+
- git stash --all
57+
- ./set_version.py
58+
_deploy_provider: &_deploy_provider
59+
skip_cleanup: true
60+
on:
61+
tags: true
62+
repo: applegrew/django-select2
5663
deploy:
57-
- provider: pypi
64+
- <<: *_deploy_provider
65+
provider: pypi
5866
distributions: sdist bdist_wheel
5967
user: codingjoe
6068
password:
6169
secure: fEP9K7y0ZF9fRvQEUN4kgPXQEZvi3Cx3ikUebG2UM/2uhcaUQm0+KpgZ2S+lvOTYcBnNgzPzFsVIZMcVcTxwIKuQDEMq9y2eop2hnisb9KXsIm9qPYSzOnRm74VuiOt4hNOZMe0qVBK2cO3vC9NDXuzdI8A0JynJhthfl4t+kFM=
62-
on:
63-
tags: true
64-
repo: applegrew/django-select2
65-
- provider: npm
70+
- <<: *_deploy_provider
71+
provider: npm
6672
6773
api_key:
6874
secure: PV38cQx9qhEFkpSdytbM72UzIMCfhpjmRJ8dzT+bCAaOIs5rEcyKN+h1r5ranunCxWyuFsMW4A2iW/SCxnKCR/oPAguuwUbT5ogBXlsskqPFWUxuoTHYMrd+zB+SC6+bMgq+o5ul+kJCYtEkWP6cMlIEzKyTLab7m5PsnDXNVnI=
69-
on:
70-
tags: true
71-
repo: applegrew/django-select2

set_version.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#!/usr/bin/env python3
2+
"""Set the version in NPM's package.json to match the git tag."""
23
import json
34
import os
45

5-
def main():
6+
if __name__ == '__main__':
67
with open('package.json', 'r+') as f:
78
data = json.load(f)
89
f.seek(0)

0 commit comments

Comments
 (0)