GitHub Actions workflow for Windows EXE
This commit is contained in:
		
				
					committed by
					
						
						André Koch-Kramer
					
				
			
			
				
	
			
			
			
						parent
						
							b2acbcf0e0
						
					
				
				
					commit
					dc289024c8
				
			
							
								
								
									
										47
									
								
								.github/workflows/windows_exe.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										47
									
								
								.github/workflows/windows_exe.yml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							@@ -0,0 +1,47 @@
 | 
			
		||||
name: Windows EXE build
 | 
			
		||||
 | 
			
		||||
on: [push, pull_request]
 | 
			
		||||
 | 
			
		||||
jobs:
 | 
			
		||||
  build:
 | 
			
		||||
    runs-on: windows-latest
 | 
			
		||||
    steps:
 | 
			
		||||
      - name: Checkout Instaloader repository
 | 
			
		||||
        uses: actions/checkout@v2
 | 
			
		||||
      - name: Setup Python
 | 
			
		||||
        uses: actions/setup-python@v1
 | 
			
		||||
        with:
 | 
			
		||||
          python-version: 3.8
 | 
			
		||||
          architecture: x64
 | 
			
		||||
      - name: Get the tagged version
 | 
			
		||||
        id: get_version
 | 
			
		||||
        env:
 | 
			
		||||
          GITHUB_REF: ${{ github.ref }}
 | 
			
		||||
        run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\/v/}
 | 
			
		||||
        shell: bash
 | 
			
		||||
      - name: Run custom python script for EXE creation
 | 
			
		||||
        env:
 | 
			
		||||
          VERSION_TAG: v${{ steps.get_version.outputs.VERSION }}
 | 
			
		||||
        run: python deploy/windows/create_exe.py
 | 
			
		||||
      - name: Create draft release
 | 
			
		||||
        if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
 | 
			
		||||
        id: create_release
 | 
			
		||||
        uses: actions/create-release@v1
 | 
			
		||||
        env:
 | 
			
		||||
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 | 
			
		||||
        with:
 | 
			
		||||
          tag_name: v${{ steps.get_version.outputs.VERSION }}
 | 
			
		||||
          release_name: Version ${{ steps.get_version.outputs.VERSION }}
 | 
			
		||||
          draft: true
 | 
			
		||||
          prerelease: contains(steps.get_version.outputs.VERSION, 'a') || contains(steps.get_version.outputs.VERSION, 'b') || contains(steps.get_version.outputs.VERSION, 'c')
 | 
			
		||||
      - name: Upload EXE as release asset
 | 
			
		||||
        if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
 | 
			
		||||
        id: upload-release-asset
 | 
			
		||||
        uses: actions/upload-release-asset@v1
 | 
			
		||||
        env:
 | 
			
		||||
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 | 
			
		||||
        with:
 | 
			
		||||
          upload_url: ${{ steps.create_release.outputs.upload_url }}
 | 
			
		||||
          asset_path: ./instaloader-v${{ steps.get_version.outputs.VERSION }}-windows-standalone.zip
 | 
			
		||||
          asset_name: instaloader-v${{ steps.get_version.outputs.VERSION }}-windows-standalone.zip
 | 
			
		||||
          asset_content_type: application/zip
 | 
			
		||||
		Reference in New Issue
	
	Block a user