mirror of
				https://github.com/msgpack/msgpack-python.git
				synced 2025-11-03 19:10:55 +00:00 
			
		
		
		
	upload to PyPI on create a release (#639)
This commit is contained in:
		
							parent
							
								
									cdc7644503
								
							
						
					
					
						commit
						fe9e620a60
					
				
					 1 changed files with 45 additions and 3 deletions
				
			
		
							
								
								
									
										48
									
								
								.github/workflows/wheel.yml
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										48
									
								
								.github/workflows/wheel.yml
									
										
									
									
										vendored
									
									
								
							| 
						 | 
					@ -1,8 +1,10 @@
 | 
				
			||||||
name: Build Wheels
 | 
					name: Build sdist and Wheels
 | 
				
			||||||
on:
 | 
					on:
 | 
				
			||||||
  push:
 | 
					  push:
 | 
				
			||||||
    branches: [main]
 | 
					    branches: [main]
 | 
				
			||||||
  create:
 | 
					  release:
 | 
				
			||||||
 | 
					    types:
 | 
				
			||||||
 | 
					      - published
 | 
				
			||||||
  workflow_dispatch:
 | 
					  workflow_dispatch:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
jobs:
 | 
					jobs:
 | 
				
			||||||
| 
						 | 
					@ -34,7 +36,7 @@ jobs:
 | 
				
			||||||
          CIBW_SKIP: "pp* cp38-macosx_*"
 | 
					          CIBW_SKIP: "pp* cp38-macosx_*"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      - name: Build sdist
 | 
					      - name: Build sdist
 | 
				
			||||||
        if: runner.os == 'Linux'
 | 
					        if: runner.os == 'Linux' && runner.arch == 'X64'
 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          pip install build
 | 
					          pip install build
 | 
				
			||||||
          python -m build -s -o wheelhouse
 | 
					          python -m build -s -o wheelhouse
 | 
				
			||||||
| 
						 | 
					@ -44,3 +46,43 @@ jobs:
 | 
				
			||||||
        with:
 | 
					        with:
 | 
				
			||||||
          name: wheels-${{ matrix.os }}
 | 
					          name: wheels-${{ matrix.os }}
 | 
				
			||||||
          path: wheelhouse
 | 
					          path: wheelhouse
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  # combine all wheels into one artifact
 | 
				
			||||||
 | 
					  combine_wheels:
 | 
				
			||||||
 | 
					    needs: [build_wheels]
 | 
				
			||||||
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					      - uses: actions/download-artifact@v4
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          # unpacks all CIBW artifacts into dist/
 | 
				
			||||||
 | 
					          pattern: wheels-*
 | 
				
			||||||
 | 
					          path: dist
 | 
				
			||||||
 | 
					          merge-multiple: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - name: Upload Wheels to artifact
 | 
				
			||||||
 | 
					        uses: actions/upload-artifact@v4
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          name: wheels-all
 | 
				
			||||||
 | 
					          path: dist
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  # https://github.com/pypa/cibuildwheel/blob/main/examples/github-deploy.yml
 | 
				
			||||||
 | 
					  upload_pypi:
 | 
				
			||||||
 | 
					    needs: [build_wheels]
 | 
				
			||||||
 | 
					    runs-on: ubuntu-latest
 | 
				
			||||||
 | 
					    environment: pypi
 | 
				
			||||||
 | 
					    permissions:
 | 
				
			||||||
 | 
					      id-token: write
 | 
				
			||||||
 | 
					    if: github.event_name == 'release' && github.event.action == 'published'
 | 
				
			||||||
 | 
					    # or, alternatively, upload to PyPI on every tag starting with 'v' (remove on: release above to use this)
 | 
				
			||||||
 | 
					    # if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
 | 
				
			||||||
 | 
					    steps:
 | 
				
			||||||
 | 
					      - uses: actions/download-artifact@v4
 | 
				
			||||||
 | 
					        with:
 | 
				
			||||||
 | 
					          # unpacks all CIBW artifacts into dist/
 | 
				
			||||||
 | 
					          pattern: wheels-*
 | 
				
			||||||
 | 
					          path: dist
 | 
				
			||||||
 | 
					          merge-multiple: true
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					      - uses: pypa/gh-action-pypi-publish@release/v1
 | 
				
			||||||
 | 
					        #with:
 | 
				
			||||||
 | 
					        # To test: repository-url: https://test.pypi.org/legacy/
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue