forked from open-webui/open-webui
		
	Add release creation workflow
This commit is contained in:
		
							parent
							
								
									d51aec9fec
								
							
						
					
					
						commit
						c89c27d351
					
				
					 1 changed files with 42 additions and 0 deletions
				
			
		
							
								
								
									
										42
									
								
								.github/workflows/build-release.yml
									
										
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										42
									
								
								.github/workflows/build-release.yml
									
										
									
									
										vendored
									
									
										Normal file
									
								
							|  | @ -0,0 +1,42 @@ | |||
| name: Release | ||||
| 
 | ||||
| on: | ||||
|   push: | ||||
|     branches: | ||||
|       - main # or whatever branch you want to use | ||||
| 
 | ||||
| jobs: | ||||
|   release: | ||||
|     runs-on: ubuntu-latest | ||||
| 
 | ||||
|     steps: | ||||
|     - name: Checkout repository | ||||
|       uses: actions/checkout@v2 | ||||
| 
 | ||||
|     - name: Get commit hash | ||||
|       id: get_hash | ||||
|       run: | | ||||
|         HASH=$(git rev-parse --short "$GITHUB_SHA") | ||||
|         echo "::set-output name=hash::$HASH" | ||||
| 
 | ||||
|     - name: Create GitHub release | ||||
|       uses: actions/github-script@v5 | ||||
|       with: | ||||
|         github-token: ${{ secrets.GITHUB_TOKEN }} | ||||
|         script: | | ||||
|           const release = await github.rest.repos.createRelease({ | ||||
|             owner: context.repo.owner, | ||||
|             repo: context.repo.repo, | ||||
|             tag_name: `v${{ steps.get_hash.outputs.hash }}`, | ||||
|             name: `v${{ steps.get_hash.outputs.hash }}`, | ||||
|             body: 'Automatically created new release', | ||||
|           }) | ||||
|           console.log(`Created release ${release.data.html_url}`) | ||||
| 
 | ||||
|     - name: Upload package to GitHub release | ||||
|       uses: actions/upload-artifact@v3 | ||||
|       with: | ||||
|         name: package | ||||
|         path: . | ||||
|       env: | ||||
|         GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Loan J
						Loan J