bard 0.55.0 → 0.57.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f7b5104dd7439dfc79a1c608bebc1481c9a1d1ced133a637b94593acb944a6a0
4
- data.tar.gz: 85d8e12e5957a3a16a74ff6cf400b3ccf4a58f6ad15171d656ef18a0dddf1967
3
+ metadata.gz: 185f8659f83ac6f3ddcc4922db94061b58a610d09d1da8bd92de1c30f3be1d3f
4
+ data.tar.gz: 2552ea154c16e106b64c2e7b4db26eb1a0dfb92e99d5e158a93cc818620de14b
5
5
  SHA512:
6
- metadata.gz: 656e71d268890def82ef43283375d91e4b1f88fa4007c58b7f855be64946210ae32d4db518faafc9301e0c7baf17b763f90d6866f3df06f3c5e51813ca3c4cee
7
- data.tar.gz: be4a640a1eb96fe264cf25d7b1c22c11766e3a4647580c8d7d4a19f06fe5afd3b34e9882f11636b3fe0c37e1ae2ae44bfbb923d6d5051ef9cf637fda5b5aacec
6
+ metadata.gz: d5db740a15a9b346f96ba6cdf1ba2e82841ef5c9f18fa07d7068a47de6d7b7490cb93388622af030e70471905d0ed58c100b73e9c1105ea17754233cbdfec573
7
+ data.tar.gz: a82d8134445429bf9562c47ec4921a52dc32f81082ef82529d5fd97b1ffa2610f317569496ed577525639720f647194f46c87d1f88ac695242e557313ef3d327
@@ -0,0 +1,26 @@
1
+ name: deploy
2
+ on:
3
+ pull_request:
4
+ types:
5
+ - closed
6
+ jobs:
7
+ deploy:
8
+ if: github.event.pull_request.merged == true
9
+ runs-on: ubuntu-20.04
10
+ steps:
11
+ - uses: actions/checkout@v3
12
+ - uses: ruby/setup-ruby@v1
13
+ with:
14
+ bundler-cache: true
15
+ - name: Install SSH key
16
+ uses: shimataro/ssh-key-action@v2
17
+ with:
18
+ key: ${{ secrets.DEPLOY_SSH_PRIVATE_KEY }}
19
+ known_hosts: unnecessary
20
+ config: |
21
+ Host *
22
+ StrictHostKeyChecking no
23
+ UserKnownHostsFile=/dev/null
24
+ - name: deploy
25
+ run: bundle exec bard deploy --skip-ci
26
+
data/lib/bard/git.rb CHANGED
@@ -8,14 +8,22 @@ module Bard::CLI::Git
8
8
  end
9
9
 
10
10
  def current_sha
11
- `git rev-parse HEAD`.chomp
11
+ sha_of("HEAD")
12
12
  end
13
13
 
14
14
  def fast_forward_merge?(root, branch)
15
- root_head = `git rev-parse #{root}`.chomp
16
- branch_head = `git rev-parse #{branch}`.chomp
15
+ root_head = sha_of(root)
16
+ branch_head = sha_of(branch)
17
17
  common_ancestor = `git merge-base #{root_head} #{branch_head}`.chomp
18
18
  common_ancestor == root_head
19
19
  end
20
+
21
+ def up_to_date_with_remote? branch
22
+ sha_of(branch) == sha_of("origin/#{branch}")
23
+ end
24
+
25
+ def sha_of ref
26
+ `git rev-parse #{ref}`.chomp
27
+ end
20
28
  end
21
29
 
data/lib/bard/version.rb CHANGED
@@ -1,4 +1,4 @@
1
1
  module Bard
2
- VERSION = "0.55.0"
2
+ VERSION = "0.57.0"
3
3
  end
4
4
 
data/lib/bard.rb CHANGED
@@ -40,7 +40,7 @@ class Bard::CLI < Thor
40
40
  branch = Git.current_branch
41
41
 
42
42
  if branch == "master"
43
- run_crucial "git push origin master:master"
43
+ run_crucial "git push origin #{branch}:#{branch}" if !Git.up_to_date_with_remote?(branch)
44
44
  invoke :ci, [branch], options.slice("local-ci") unless options["skip-ci"]
45
45
 
46
46
  else
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bard
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.55.0
4
+ version: 0.57.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Micah Geisel
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-10 00:00:00.000000000 Z
11
+ date: 2024-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -140,6 +140,7 @@ files:
140
140
  - features/support/io.rb
141
141
  - install_files/.github/workflows/cache-ci.yml
142
142
  - install_files/.github/workflows/ci.yml
143
+ - install_files/.github/workflows/deploy.yml
143
144
  - install_files/apt_dependencies.rb
144
145
  - install_files/ci
145
146
  - install_files/setup
@@ -179,7 +180,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
179
180
  - !ruby/object:Gem::Version
180
181
  version: '0'
181
182
  requirements: []
182
- rubygems_version: 3.2.32
183
+ rubygems_version: 3.5.4
183
184
  signing_key:
184
185
  specification_version: 4
185
186
  summary: CLI to automate common development tasks.