File tree Expand file tree Collapse file tree 3 files changed +43
-5
lines changed Expand file tree Collapse file tree 3 files changed +43
-5
lines changed Original file line number Diff line number Diff line change 1010  push :
1111    branches :
1212      - master 
13+     tags :
14+       - " *" 
15+ 
1316  pull_request :
1417    branches :
1518      - master 
@@ -154,3 +157,36 @@ jobs:
154157        flags : ${{ runner.os }} 
155158        fail_ci_if_error : false 
156159        name : ${{ matrix.name }} 
160+ 
161+   deploy :
162+ 
163+     runs-on : ubuntu-latest 
164+ 
165+     needs : [build] 
166+ 
167+     steps :
168+     - uses : actions/checkout@v1 
169+     - name : Set up Python 
170+       uses : actions/setup-python@v1 
171+       with :
172+         python-version : " 3.7" 
173+     - name : Install dependencies 
174+       run : | 
175+         python -m pip install --upgrade pip 
176+         pip install --upgrade wheel setuptools tox 
177+ name : Build package 
178+       run : | 
179+         python setup.py sdist bdist_wheel 
180+ name : Publish package to PyPI 
181+       if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') 
182+       uses : pypa/gh-action-pypi-publish@master 
183+       with :
184+         user : __token__ 
185+         password : ${{ secrets.pypi_token }} 
186+     - name : Publish GitHub release notes 
187+       if : github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags') 
188+       env :
189+         GH_RELEASE_NOTES_TOKEN : ${{ secrets.release_notes }} 
190+       run : | 
191+         sudo apt-get install pandoc 
192+         tox -e publish-gh-release-notes 
Original file line number Diff line number Diff line change @@ -68,19 +68,21 @@ def main(argv):
6868    if  len (argv ) >  1 :
6969        tag_name  =  argv [1 ]
7070    else :
71-         tag_name  =  os .environ .get ("TRAVIS_TAG " )
71+         tag_name  =  os .environ .get ("GITHUB_REF " )
7272        if  not  tag_name :
73-             print ("tag_name not given and $TRAVIS_TAG  not set" , file = sys .stderr )
73+             print ("tag_name not given and $GITHUB_REF  not set" , file = sys .stderr )
7474            return  1 
75+         if  tag_name .startswith ("refs/tags/" ):
76+             tag_name  =  tag_name [len ("refs/tags/" ) :]
7577
7678    token  =  os .environ .get ("GH_RELEASE_NOTES_TOKEN" )
7779    if  not  token :
7880        print ("GH_RELEASE_NOTES_TOKEN not set" , file = sys .stderr )
7981        return  1 
8082
81-     slug  =  os .environ .get ("TRAVIS_REPO_SLUG " )
83+     slug  =  os .environ .get ("GITHUB_REPOSITORY " )
8284    if  not  slug :
83-         print ("TRAVIS_REPO_SLUG  not set" , file = sys .stderr )
85+         print ("GITHUB_REPOSITORY  not set" , file = sys .stderr )
8486        return  1 
8587
8688    rst_body  =  parse_changelog (tag_name )
Original file line number Diff line number Diff line change @@ -135,7 +135,7 @@ commands = python scripts/release.py {posargs}
135135description  = create GitHub release after deployment
136136basepython  = python3
137137usedevelop  = True
138- passenv  = GH_RELEASE_NOTES_TOKEN TRAVIS_TAG TRAVIS_REPO_SLUG 
138+ passenv  = GH_RELEASE_NOTES_TOKEN GITHUB_REF GITHUB_REPOSITORY 
139139deps  =
140140    github3.py
141141    pypandoc
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments