mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 06:30:27 +03:00 
			
		
		
		
	🎯 deploy: no releaseChannels on github releases
Don't deploy versions of to GitHub releases where a `releaseChannels` value is set in index-v2.json. (This usually would mean it's a alpha or beta version.)
This commit is contained in:
		
							parent
							
								
									c6598f2835
								
							
						
					
					
						commit
						242490ddc3
					
				
					 2 changed files with 20 additions and 12 deletions
				
			
		| 
						 | 
				
			
			@ -218,6 +218,9 @@
 | 
			
		|||
# an example for this deployment automation:
 | 
			
		||||
# https://github.com/f-droid/fdroidclient/releases/
 | 
			
		||||
#
 | 
			
		||||
# Currently versions which are assigned to a release channel (e.g. alpha or
 | 
			
		||||
# beta releases) are ignored.
 | 
			
		||||
#
 | 
			
		||||
# In the examble below tokens are read from environment variables. Putting
 | 
			
		||||
# tokens directly into the config file is also supported but discouraged. It is
 | 
			
		||||
# highly recommended to use a "Fine-grained personal access token", which is
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1118,7 +1118,7 @@ def push_binary_transparency(git_repo_path, git_remote):
 | 
			
		|||
 | 
			
		||||
def find_release_infos(index_v2_path, repo_dir, package_names):
 | 
			
		||||
    """
 | 
			
		||||
    Find files, texts, etc. for uploading to a release page.
 | 
			
		||||
    Find files, texts, etc. for uploading to a release page in index-v2.json.
 | 
			
		||||
 | 
			
		||||
    This function parses index-v2.json for file-paths elegible for deployment
 | 
			
		||||
    to release pages. (e.g. GitHub releases) It also groups these files by
 | 
			
		||||
| 
						 | 
				
			
			@ -1149,6 +1149,7 @@ def find_release_infos(index_v2_path, repo_dir, package_names):
 | 
			
		|||
                release_infos[package_name][ver_name] = {
 | 
			
		||||
                    'files': files,
 | 
			
		||||
                    'whatsNew': version.get('whatsNew', {}).get("en-US"),
 | 
			
		||||
                    'hasReleaseChannels': len(version.get('releaseChannels', [])) > 0,
 | 
			
		||||
                }
 | 
			
		||||
    return release_infos
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -1202,6 +1203,10 @@ def upload_to_github_releases_repo(repo_conf, release_infos, global_gh_token):
 | 
			
		|||
 | 
			
		||||
    for version in all_local_versions:
 | 
			
		||||
        if version in unreleased_tags:
 | 
			
		||||
            # Making sure we're not uploading this version when releaseChannels
 | 
			
		||||
            # is set. (releaseChannels usually mean it's e.g. an alpha or beta
 | 
			
		||||
            # version)
 | 
			
		||||
            if not release_infos.get(packages[0], {}).get(version, {}).get('hasReleaseChannels'):
 | 
			
		||||
                # collect files associated with this github release
 | 
			
		||||
                files = []
 | 
			
		||||
                for package in packages:
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue