File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -28,16 +28,18 @@ jobs:
2828      - name : Install dependencies 
2929        run : npm install 
3030
31-       #  获取 tag 的版本类型(alpha 或 beta )
31+       #  获取 tag 的版本类型(仅支持 正式版和beta版 )
3232      - name : Determine release tag 
3333        id : determine_tag 
3434        run : | 
3535          TAG=$(echo "${GITHUB_REF}" | sed 's/refs\/tags\/\(.*\)/\1/') 
36-           PRERELEASE=$(echo $TAG | sed -n 's/.*-\(alpha\|beta\|rc\).*/\1/p') 
37-           if [ -n "$PRERELEASE" ]; then 
38-             echo "::set-output name=tag::$PRERELEASE" 
39-           else 
36+           if [[ "$TAG" =~ -beta ]]; then 
37+             echo "::set-output name=tag::beta" 
38+           elif [[ "$TAG" =~ ^v[0-9]+\.[0-9]+\.[0-9]+$ ]]; then 
4039            echo "::set-output name=tag::latest" 
40+           else 
41+             echo "Unsupported version detected. Terminating." 
42+             exit 1 
4143          fi 
4244       #  # 打包
4345      #  - name: Build Packages
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments