vtasks 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/CHANGELOG.md +11 -0
 - data/lib/vtasks/release.rb +17 -6
 - metadata +2 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: 0c4fd78d9502b352d79919ba68aeb29ce8cb688d27b7cb6b9e5fa6b8201f51dd
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 4d2041309f381fe4a4bbc364904caaf3cae342f205e5f8cbd4f8c8fea6108d4a
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 8283ce185aba1f99b9a991362a8b9de56fc49c3ba65db149a863788b23f5b99a331b1b40fdab393ed44d25aef59c2023e3fde41f59859d2b00493369adb3345e
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: ac9e68ac67525c0b3fb9733d59e8697215f355fad032a2b6555b505334c59010eb5b402d9e62036bdc13954864bdbaeed850aa7ca46baea5ed7898124a246f1e
         
     | 
    
        data/CHANGELOG.md
    CHANGED
    
    | 
         @@ -1,5 +1,16 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            # Change Log
         
     | 
| 
       2 
2 
     | 
    
         | 
| 
      
 3 
     | 
    
         
            +
            ## [v0.0.13](https://github.com/vladgh/vtasks/tree/v0.0.13) (2018-10-12)
         
     | 
| 
      
 4 
     | 
    
         
            +
            [Full Changelog](https://github.com/vladgh/vtasks/compare/v0.0.12...v0.0.13)
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
            **Implemented enhancements:**
         
     | 
| 
      
 7 
     | 
    
         
            +
             
     | 
| 
      
 8 
     | 
    
         
            +
            - Add option to require pull request [\#24](https://github.com/vladgh/vtasks/issues/24)
         
     | 
| 
      
 9 
     | 
    
         
            +
             
     | 
| 
      
 10 
     | 
    
         
            +
            **Fixed bugs:**
         
     | 
| 
      
 11 
     | 
    
         
            +
             
     | 
| 
      
 12 
     | 
    
         
            +
            - Fix branches [\#25](https://github.com/vladgh/vtasks/issues/25)
         
     | 
| 
      
 13 
     | 
    
         
            +
             
     | 
| 
       3 
14 
     | 
    
         
             
            ## [v0.0.12](https://github.com/vladgh/vtasks/tree/v0.0.12) (2018-10-11)
         
     | 
| 
       4 
15 
     | 
    
         
             
            [Full Changelog](https://github.com/vladgh/vtasks/compare/v0.0.11...v0.0.12)
         
     | 
| 
       5 
16 
     | 
    
         | 
    
        data/lib/vtasks/release.rb
    CHANGED
    
    | 
         @@ -12,12 +12,14 @@ module Vtasks 
     | 
|
| 
       12 
12 
     | 
    
         
             
                include Vtasks::Utils::Semver
         
     | 
| 
       13 
13 
     | 
    
         | 
| 
       14 
14 
     | 
    
         
             
                attr_reader :write_changelog,
         
     | 
| 
      
 15 
     | 
    
         
            +
                            :require_pull_request,
         
     | 
| 
       15 
16 
     | 
    
         
             
                            :wait_for_ci_success,
         
     | 
| 
       16 
17 
     | 
    
         
             
                            :bug_labels,
         
     | 
| 
       17 
18 
     | 
    
         
             
                            :enhancement_labels
         
     | 
| 
       18 
19 
     | 
    
         | 
| 
       19 
20 
     | 
    
         
             
                def initialize(options = {})
         
     | 
| 
       20 
21 
     | 
    
         
             
                  @write_changelog = options.fetch(:write_changelog, false)
         
     | 
| 
      
 22 
     | 
    
         
            +
                  @require_pull_request = options.fetch(:require_pull_request, false)
         
     | 
| 
       21 
23 
     | 
    
         
             
                  @wait_for_ci_success = options.fetch(:wait_for_ci_success, false)
         
     | 
| 
       22 
24 
     | 
    
         
             
                  @bug_labels = options.fetch(:bug_labels, 'bug')
         
     | 
| 
       23 
25 
     | 
    
         
             
                  @enhancement_labels = options.fetch(:enhancement_labels, 'enhancement')
         
     | 
| 
         @@ -52,9 +54,14 @@ module Vtasks 
     | 
|
| 
       52 
54 
     | 
    
         
             
                      task level.to_sym do
         
     | 
| 
       53 
55 
     | 
    
         
             
                        new_version = bump(level)
         
     | 
| 
       54 
56 
     | 
    
         
             
                        release = "#{new_version[:major]}.#{new_version[:minor]}.#{new_version[:patch]}"
         
     | 
| 
       55 
     | 
    
         
            -
                        release_branch = "release_v#{release.gsub(/[^0-9A-Za-z]/, '_')}"
         
     | 
| 
       56 
57 
     | 
    
         
             
                        initial_branch = git_branch
         
     | 
| 
       57 
58 
     | 
    
         | 
| 
      
 59 
     | 
    
         
            +
                        if require_pull_request == true
         
     | 
| 
      
 60 
     | 
    
         
            +
                          release_branch = "release_v#{release.gsub(/[^0-9A-Za-z]/, '_')}"
         
     | 
| 
      
 61 
     | 
    
         
            +
                        else
         
     | 
| 
      
 62 
     | 
    
         
            +
                          release_branch = initial_branch
         
     | 
| 
      
 63 
     | 
    
         
            +
                        end
         
     | 
| 
      
 64 
     | 
    
         
            +
             
     | 
| 
       58 
65 
     | 
    
         
             
                        info 'Check if the repository is clean'
         
     | 
| 
       59 
66 
     | 
    
         
             
                        git_clean_repo
         
     | 
| 
       60 
67 
     | 
    
         | 
| 
         @@ -70,8 +77,10 @@ module Vtasks 
     | 
|
| 
       70 
77 
     | 
    
         
             
                          if system 'git diff --quiet HEAD'
         
     | 
| 
       71 
78 
     | 
    
         
             
                            info 'CHANGELOG has not changed. Skipping...'
         
     | 
| 
       72 
79 
     | 
    
         
             
                          else
         
     | 
| 
       73 
     | 
    
         
            -
                             
     | 
| 
       74 
     | 
    
         
            -
             
     | 
| 
      
 80 
     | 
    
         
            +
                            if require_pull_request == true
         
     | 
| 
      
 81 
     | 
    
         
            +
                              info 'Create a new release branch'
         
     | 
| 
      
 82 
     | 
    
         
            +
                              sh "git checkout -b #{release_branch}"
         
     | 
| 
      
 83 
     | 
    
         
            +
                            end
         
     | 
| 
       75 
84 
     | 
    
         | 
| 
       76 
85 
     | 
    
         
             
                            info 'Commit the new changes'
         
     | 
| 
       77 
86 
     | 
    
         
             
                            sh "git commit --gpg-sign --message 'Update change log for v#{release}' CHANGELOG.md"
         
     | 
| 
         @@ -84,9 +93,11 @@ module Vtasks 
     | 
|
| 
       84 
93 
     | 
    
         
             
                              sleep 5 until git_ci_status(release_branch) == 'success'
         
     | 
| 
       85 
94 
     | 
    
         
             
                            end
         
     | 
| 
       86 
95 
     | 
    
         | 
| 
       87 
     | 
    
         
            -
                             
     | 
| 
       88 
     | 
    
         
            -
             
     | 
| 
       89 
     | 
    
         
            -
             
     | 
| 
      
 96 
     | 
    
         
            +
                            if require_pull_request == true
         
     | 
| 
      
 97 
     | 
    
         
            +
                              info 'Merge release branch'
         
     | 
| 
      
 98 
     | 
    
         
            +
                              sh "git checkout #{initial_branch}"
         
     | 
| 
      
 99 
     | 
    
         
            +
                              sh "git merge --gpg-sign --no-ff --message 'Release v#{release}' #{release_branch}"
         
     | 
| 
      
 100 
     | 
    
         
            +
                            end
         
     | 
| 
       90 
101 
     | 
    
         
             
                          end
         
     | 
| 
       91 
102 
     | 
    
         
             
                        end
         
     | 
| 
       92 
103 
     | 
    
         | 
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: vtasks
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.0. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.0.13
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Vlad Ghinea
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2018-10- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2018-10-12 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: rake
         
     |