Update Wiki-Page with latest releases
This commit is contained in:
		
							parent
							
								
									37c9a59840
								
							
						
					
					
						commit
						cc070b4233
					
				
					 3 changed files with 45 additions and 3 deletions
				
			
		
							
								
								
									
										12
									
								
								.github/workflows/build.yml
									
										
									
									
										vendored
									
									
								
							
							
						
						
									
										12
									
								
								.github/workflows/build.yml
									
										
									
									
										vendored
									
									
								
							| 
						 | 
					@ -134,14 +134,20 @@ jobs:
 | 
				
			||||||
          name: ffmpeg
 | 
					          name: ffmpeg
 | 
				
			||||||
          path: artifacts
 | 
					          path: artifacts
 | 
				
			||||||
      - name: Create release
 | 
					      - name: Create release
 | 
				
			||||||
 | 
					        id: create_release
 | 
				
			||||||
        run: |
 | 
					        run: |
 | 
				
			||||||
          set -xe
 | 
					          set -xe
 | 
				
			||||||
          NAME="Auto-Build $(date +'%Y-%m-%d %H:%M')"
 | 
					          NAME="Auto-Build $(date +'%Y-%m-%d %H:%M')"
 | 
				
			||||||
          TAGNAME="autobuild-$(date +'%Y-%m-%d-%H-%M')"
 | 
					          TAGNAME="autobuild-$(date +'%Y-%m-%d-%H-%M')"
 | 
				
			||||||
          hub release create $(for a in artifacts/*; do echo -a $a; done) -m "$NAME" -t "master" "$TAGNAME"
 | 
					          hub release create $(for a in artifacts/*.zip; do echo -a $a; done) -m "$NAME" -t "master" "$TAGNAME"
 | 
				
			||||||
 | 
					          echo "::set-output name=tag_name::${TAGNAME}"
 | 
				
			||||||
        env:
 | 
					        env:
 | 
				
			||||||
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 | 
					          GITHUB_TOKEN: ${{ github.token }}
 | 
				
			||||||
 | 
					      - name: Update Wiki
 | 
				
			||||||
 | 
					        run: ./util/update_wiki.sh artifacts ${{ steps.create_release.outputs.tag_name }}
 | 
				
			||||||
 | 
					        env:
 | 
				
			||||||
 | 
					          GITHUB_TOKEN: ${{ github.token }}
 | 
				
			||||||
      - name: Prune old releases
 | 
					      - name: Prune old releases
 | 
				
			||||||
        run: ./util/prunetags.sh
 | 
					        run: ./util/prunetags.sh
 | 
				
			||||||
        env:
 | 
					        env:
 | 
				
			||||||
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
 | 
					          GITHUB_TOKEN: ${{ github.token }}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										1
									
								
								build.sh
									
										
									
									
									
								
							
							
						
						
									
										1
									
								
								build.sh
									
										
									
									
									
								
							| 
						 | 
					@ -69,4 +69,5 @@ rm -rf ffbuild
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if [[ -n "$GITHUB_ACTIONS" ]]; then
 | 
					if [[ -n "$GITHUB_ACTIONS" ]]; then
 | 
				
			||||||
    echo "::set-output name=build_name::${BUILD_NAME}"
 | 
					    echo "::set-output name=build_name::${BUILD_NAME}"
 | 
				
			||||||
 | 
					    echo "${BUILD_NAME}.zip" > "${ARTIFACTS_PATH}/${TARGET}-${VARIANT}${ADDINS_STR:+-}${ADDINS_STR}.txt"
 | 
				
			||||||
fi
 | 
					fi
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
							
								
								
									
										35
									
								
								util/update_wiki.sh
									
										
									
									
									
										Executable file
									
								
							
							
						
						
									
										35
									
								
								util/update_wiki.sh
									
										
									
									
									
										Executable file
									
								
							| 
						 | 
					@ -0,0 +1,35 @@
 | 
				
			||||||
 | 
					#!/bin/bash
 | 
				
			||||||
 | 
					set -e
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [[ $# != 2 ]]; then
 | 
				
			||||||
 | 
					    echo "Missing arguments"
 | 
				
			||||||
 | 
					    exit -1
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if [[ -z "$GITHUB_REPOSITORY" || -z "$GITHUB_TOKEN" || -z "$GITHUB_ACTOR" ]]; then
 | 
				
			||||||
 | 
					    echo "Missing environment"
 | 
				
			||||||
 | 
					    exit -1
 | 
				
			||||||
 | 
					fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					INPUTS="$1"
 | 
				
			||||||
 | 
					TAGNAME="$2"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					WIKIPATH="tmp_wiki"
 | 
				
			||||||
 | 
					WIKIFILE="Latest.md"
 | 
				
			||||||
 | 
					git clone "https://${GITHUB_ACTOR}:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.wiki.git" "${WIKIPATH}"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					echo "# Latest Autobuilds" > "${WIKIPATH}/${WIKIFILE}"
 | 
				
			||||||
 | 
					for f in "${INPUTS}"/*.txt; do
 | 
				
			||||||
 | 
					    VARIANT="${f::-4}"
 | 
				
			||||||
 | 
					    echo "[${VARIANT}](https://github.com/${GITHUB_REPOSITORY}/releases/download/${TAGNAME}/$(cat "${f}"))" >> "${WIKIPATH}/${WIKIFILE}"
 | 
				
			||||||
 | 
					done
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					cd "${WIKIPATH}"
 | 
				
			||||||
 | 
					git config user.email "actions@github.com"
 | 
				
			||||||
 | 
					git config user.name "Github Actions"
 | 
				
			||||||
 | 
					git add "$WIKIFILE"
 | 
				
			||||||
 | 
					git commit -m "Update latest version info"
 | 
				
			||||||
 | 
					git push
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					cd ..
 | 
				
			||||||
 | 
					rm -rf "$WIKIPATH"
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue