Compare commits
	
		
			4 Commits 
		
	
	
		
			cf60fe151d
			...
			831747d92f
		
	
	| Author | SHA1 | Date | 
|---|---|---|
| 
							
							
								 | 
						831747d92f | |
| 
							
							
								 | 
						8c95269762 | |
| 
							
							
								 | 
						849d08ed5a | |
| 
							
							
								 | 
						8f5bcc06e6 | 
							
								
								
									
										12
									
								
								Makefile
								
								
								
								
							
							
						
						
									
										12
									
								
								Makefile
								
								
								
								
							| 
						 | 
					@ -1,11 +1,11 @@
 | 
				
			||||||
Version=0.0.2
 | 
					Version=0.0.1
 | 
				
			||||||
Branch=main
 | 
					Branch=main
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#------------- 命令部分 ----------------
 | 
					#------------- 命令部分 ----------------
 | 
				
			||||||
# make publish
 | 
					# make publish
 | 
				
			||||||
# 发布upm版本, 版本号和分支需要提前配置
 | 
					# 发布upm版本, 版本号和分支需要提前配置
 | 
				
			||||||
publish:
 | 
					publish: set_version
 | 
				
			||||||
	git switch ${Branch}
 | 
						git switch ${Branch}
 | 
				
			||||||
	git tag ${Version}
 | 
						git tag ${Version}
 | 
				
			||||||
	git push --tags
 | 
						git push --tags
 | 
				
			||||||
| 
						 | 
					@ -15,3 +15,11 @@ publish:
 | 
				
			||||||
build:
 | 
					build:
 | 
				
			||||||
	cd ./Runtime/ServerProto; \
 | 
						cd ./Runtime/ServerProto; \
 | 
				
			||||||
	protogen messages.proto --csharp_out=../NetworkGen
 | 
						protogen messages.proto --csharp_out=../NetworkGen
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					# 更新版本
 | 
				
			||||||
 | 
					set_version:
 | 
				
			||||||
 | 
						git switch ${Branch}
 | 
				
			||||||
 | 
						# python3 helper.py package.json ${Version}
 | 
				
			||||||
 | 
						python3 helper.py set_ver --path ./package.json --ver ${Version}
 | 
				
			||||||
 | 
						git commit . -m "update: set version to ${Version}"
 | 
				
			||||||
 | 
						git push
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -0,0 +1,36 @@
 | 
				
			||||||
 | 
					#!/usr/bin/env python3
 | 
				
			||||||
 | 
					import argparse
 | 
				
			||||||
 | 
					import json
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					def set_version(path, version):
 | 
				
			||||||
 | 
					    s = json.loads(open(path).read())
 | 
				
			||||||
 | 
					    s["version"] = version
 | 
				
			||||||
 | 
					    # print('json', s)
 | 
				
			||||||
 | 
					    json.dump(s, open(path, "w"))
 | 
				
			||||||
 | 
					    print('Packge version set to', version)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					if __name__ == '__main__':
 | 
				
			||||||
 | 
					    # 解析参数
 | 
				
			||||||
 | 
					    parser = argparse.ArgumentParser(description='Process some integers.')
 | 
				
			||||||
 | 
					    parser.add_argument('action', type=str, help='set_ver')
 | 
				
			||||||
 | 
					    parser.add_argument('--path', type=str, help='path of package.json')
 | 
				
			||||||
 | 
					    parser.add_argument('--ver', type=str, help='version u want to set')
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    args = parser.parse_args()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    path = args.path
 | 
				
			||||||
 | 
					    if len(path) == 0:
 | 
				
			||||||
 | 
					        print('no path found')
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					    
 | 
				
			||||||
 | 
					    ver = args.ver
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if args.action == 'set_ver':
 | 
				
			||||||
 | 
					        set_version(path, ver)    
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
							
								
								
									
										12
									
								
								package.json
								
								
								
								
							
							
						
						
									
										12
									
								
								package.json
								
								
								
								
							| 
						 | 
					@ -1,11 +1 @@
 | 
				
			||||||
{
 | 
					{"name": "com.guru.unity.gurudoflib", "displayName": "GuruDofLib", "version": "0.0.2", "description": "\u57fa\u4e8eGuru kcp\u5e93\u5b9e\u73b0\u7684\u5ba2\u6237\u7aef\u63a5\u53e3\u5c01\u88c5", "unity": "2020.3", "license": "MIT", "category": "Game tool", "dependencies": {}}
 | 
				
			||||||
  "name": "com.guru.unity.gurudoflib",
 | 
					 | 
				
			||||||
  "displayName": "GuruDofLib",
 | 
					 | 
				
			||||||
  "version": "0.0.1",
 | 
					 | 
				
			||||||
  "description": "基于Guru kcp库实现的客户端接口封装",
 | 
					 | 
				
			||||||
  "unity": "2020.3",
 | 
					 | 
				
			||||||
  "license": "MIT",
 | 
					 | 
				
			||||||
  "category": "Game tool",
 | 
					 | 
				
			||||||
  "dependencies": {
 | 
					 | 
				
			||||||
  }
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
		Loading…
	
		Reference in New Issue