capistrano-around_chatwork 1.0.1 → 2.0.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7673e71ea1c5fd965d6bb33c03389de4b6a90874d312085cf0a07122e0cf2fc1
4
- data.tar.gz: 16502691d41770c7ac30e179da8c99714ece573d549da8ab0df66c183a472824
3
+ metadata.gz: f0b06fb228ef8662b7a062c1693758e1e5256829970fcebede88a99c347e0c82
4
+ data.tar.gz: e0c27acf4b5fb47a351314f5d6365c77363b6804ffbb922fba70bea49efedeed
5
5
  SHA512:
6
- metadata.gz: '08b87a99e6051e70acc9c80ccd1ecec8c574b9219875bc61bec1852825971cd2b3107e002e10e820953dc8cd52a5a4bb643a667a877a779b5852a6cd63c43b54'
7
- data.tar.gz: d92966e93a34f1ed810459186499c86b809011af2b01681f636040271771dbd51e202524fdc4ccc49ee46f8d6682c22d75a223cadbb3a863763badcaa5cf05ed
6
+ metadata.gz: e371a6e38d58adfeb7b958d8d1d8fe61b9b89df4d9837c0b8e3c13dc81805017e69acc34fbe03f993d166e8fbc937d7ea0eef5cb8cb371816cb3a2b26ec69acb
7
+ data.tar.gz: 1cfd979fed9eb3929be1f177557b03936f94df66fa3e41e3b5b93b154c3b9132440c6106ad58b83c427dba1911978e6c494b91330f3b3cf9c31eb4c5cd015adb
data/.env.example ADDED
@@ -0,0 +1,2 @@
1
+ CHATWORK_API_TOKEN=
2
+ CHATWORK_ROOM_ID=
@@ -0,0 +1,20 @@
1
+ # c.f. https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
2
+ version: 2
3
+
4
+ updates:
5
+ ###########################################################
6
+ # NOTE: following sections are auto generated. DO NOT EDIT!
7
+ ###########################################################
8
+ - package-ecosystem: github-actions
9
+ directory: /
10
+ schedule:
11
+ interval: monthly
12
+ time: "05:00"
13
+ timezone: Asia/Tokyo
14
+ assignees:
15
+ - sue445
16
+ cooldown:
17
+ default-days: 7
18
+ exclude:
19
+ - ruby/setup-ruby
20
+ ###########################################################
@@ -0,0 +1,31 @@
1
+ # ref. https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes#configuring-automatically-generated-release-notes
2
+
3
+ changelog:
4
+ exclude:
5
+ labels:
6
+ - chore
7
+
8
+ categories:
9
+ - title: ":bomb: Breaking Changes"
10
+ labels:
11
+ - breaking change
12
+
13
+ - title: ":lock: Security Fix"
14
+ labels:
15
+ - security
16
+
17
+ - title: ":rocket: Features"
18
+ labels:
19
+ - enhancement
20
+
21
+ - title: ":bug: Bug Fixes"
22
+ labels:
23
+ - bug
24
+
25
+ - title: ":dependabot: Dependency updates"
26
+ labels:
27
+ - dependencies
28
+
29
+ - title: ":pencil: Other Changes"
30
+ labels:
31
+ - "*"
@@ -0,0 +1,16 @@
1
+ name: dependabot-auto-merge
2
+
3
+ on:
4
+ pull_request:
5
+ types:
6
+ - opened
7
+ - synchronize # PR branch is rebased
8
+
9
+ jobs:
10
+ auto-merge:
11
+ uses: sue445/workflows/.github/workflows/dependabot-auto-merge.yml@main
12
+ secrets:
13
+ # TODO: Set secrets to Dependabot secrets
14
+ app-id: ${{ secrets.GH_APP_ID }}
15
+ private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
16
+ slack-webhook: ${{ secrets.SLACK_WEBHOOK }}
@@ -0,0 +1,41 @@
1
+ name: Publish gem to rubygems.org
2
+
3
+ on:
4
+ workflow_dispatch:
5
+
6
+ jobs:
7
+ release:
8
+ if: github.repository == 'sue445/capistrano-around_chatwork'
9
+ runs-on: ubuntu-latest
10
+
11
+ environment:
12
+ name: rubygems.org
13
+ url: https://rubygems.org/gems/capistrano-around_chatwork
14
+
15
+ permissions:
16
+ contents: write
17
+ id-token: write
18
+
19
+ steps:
20
+ - name: Harden Runner
21
+ uses: step-security/harden-runner@20cf305ff2072d973412fa9b1e3a4f227bda3c76 # v2.14.0
22
+ with:
23
+ egress-policy: audit
24
+
25
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
26
+
27
+ - name: Set up Ruby
28
+ uses: ruby/setup-ruby@ae195bbe749a7cef685ac729197124a48305c1cb # v1.276.0
29
+ with:
30
+ bundler-cache: true
31
+ ruby-version: ruby
32
+
33
+ - name: Publish to RubyGems
34
+ uses: rubygems/release-gem@1c162a739e8b4cb21a676e97b087e8268d8fc40b # v1.1.2
35
+
36
+ - name: Create GitHub release
37
+ run: |
38
+ tag_name="$(git describe --tags --abbrev=0)"
39
+ gh release create "${tag_name}" --verify-tag --generate-notes
40
+ env:
41
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,71 @@
1
+ name: test
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - master
7
+ pull_request:
8
+ types:
9
+ - opened
10
+ - synchronize
11
+ - reopened
12
+ schedule:
13
+ - cron: "0 10 * * 5" # JST 19:00 (Fri)
14
+
15
+ jobs:
16
+ test:
17
+ runs-on: ubuntu-latest
18
+
19
+ strategy:
20
+ fail-fast: false
21
+
22
+ # NOTE: Workaround for ChatWork API Rate limit
23
+ # ref. https://developer.chatwork.com/docs/endpoints
24
+ max-parallel: 2
25
+
26
+ matrix:
27
+ ruby:
28
+ - "3.2"
29
+ - "3.3"
30
+ - "3.4"
31
+ - "4.0"
32
+
33
+ steps:
34
+ - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
35
+
36
+ - uses: ruby/setup-ruby@ae195bbe749a7cef685ac729197124a48305c1cb # v1.276.0
37
+ with:
38
+ ruby-version: ${{ matrix.ruby }}
39
+ bundler-cache: true
40
+
41
+ - run: bundle update --jobs $(nproc) --retry 3
42
+
43
+ - run: bundle exec rake integration_test:start_server
44
+
45
+ - run: bundle exec rake integration_test:deploy
46
+ env:
47
+ CHATWORK_API_TOKEN: ${{ secrets.CHATWORK_API_TOKEN }}
48
+ CHATWORK_ROOM_ID: ${{ secrets.CHATWORK_ROOM_ID }}
49
+
50
+ - name: Slack Notification (not success)
51
+ uses: act10ns/slack@cfcc30955fe9377f4f55e1079e5419ee1014269f # v2
52
+ if: "! success()"
53
+ continue-on-error: true
54
+ with:
55
+ status: ${{ job.status }}
56
+ webhook-url: ${{ secrets.SLACK_WEBHOOK }}
57
+ matrix: ${{ toJson(matrix) }}
58
+
59
+ all-pass:
60
+ if: always()
61
+
62
+ needs:
63
+ - test
64
+
65
+ runs-on: ubuntu-slim
66
+
67
+ steps:
68
+ - name: check dependent jobs
69
+ uses: re-actors/alls-green@05ac9388f0aebcb5727afa17fcccfecd6f8ec5fe # v1.2.2
70
+ with:
71
+ jobs: ${{ toJSON(needs) }}
data/.gitignore CHANGED
@@ -7,3 +7,4 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
+ .env
data/CHANGELOG.md CHANGED
@@ -1,6 +1,26 @@
1
1
  # Changelog
2
2
  ## Unreleased
3
- [full changelog](https://github.com/sue445/capistrano-around_chatwork/compare/v1.0.1...master)
3
+ [full changelog](https://github.com/sue445/capistrano-around_chatwork/compare/v2.0.0...master)
4
+
5
+ ## [2.0.0](https://github.com/sue445/capistrano-around_chatwork/releases/tag/v2.0.0)
6
+ [full changelog](https://github.com/sue445/capistrano-around_chatwork/compare/v1.0.3...v2.0.0)
7
+
8
+ * **[BREAKING CHANGE]** :bomb: Migrate to chatwork gem
9
+ * https://github.com/sue445/capistrano-around_chatwork/pull/12
10
+ * **[BREAKING CHANGE]** :bomb: Requires Ruby 3.2+
11
+ * https://github.com/sue445/capistrano-around_chatwork/pull/14
12
+
13
+ ## [1.0.3](https://github.com/sue445/capistrano-around_chatwork/releases/tag/v1.0.3)
14
+ [full changelog](https://github.com/sue445/capistrano-around_chatwork/compare/v1.0.2...v1.0.3)
15
+
16
+ * Release gem from GitHub Actions
17
+ * https://github.com/sue445/capistrano-around_chatwork/pull/6
18
+
19
+ ## 1.0.2
20
+ [full changelog](https://github.com/sue445/capistrano-around_chatwork/compare/v1.0.1...v1.0.2)
21
+
22
+ * Enable MFA requirement for gem releasing
23
+ * https://github.com/sue445/capistrano-around_chatwork/pull/5
4
24
 
5
25
  ## 1.0.1
6
26
  [full changelog](https://github.com/sue445/capistrano-around_chatwork/compare/v1.0.0...v1.0.1)
data/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Capistrano::AroundChatwork
2
2
 
3
3
  [![Gem Version](https://badge.fury.io/rb/capistrano-around_chatwork.svg)](http://badge.fury.io/rb/capistrano-around_chatwork)
4
- [![Code Climate](https://codeclimate.com/github/sue445/capistrano-around_chatwork/badges/gpa.svg)](https://codeclimate.com/github/sue445/capistrano-around_chatwork)
5
- [![Dependency Status](https://gemnasium.com/sue445/capistrano-around_chatwork.svg)](https://gemnasium.com/sue445/capistrano-around_chatwork)
4
+ [![test](https://github.com/sue445/capistrano-around_chatwork/actions/workflows/test.yml/badge.svg)](https://github.com/sue445/capistrano-around_chatwork/actions/workflows/test.yml)
5
+ [![Maintainability](https://qlty.sh/gh/sue445/projects/capistrano-around_chatwork/maintainability.svg)](https://qlty.sh/gh/sue445/projects/capistrano-around_chatwork)
6
6
 
7
7
  post to [ChatWork](http://www.chatwork.com/) before and after the specified task
8
8
 
data/Rakefile CHANGED
@@ -1 +1,32 @@
1
1
  require "bundler/gem_tasks"
2
+
3
+ namespace :integration_test do
4
+ integration_dir = File.join(__dir__, "spec", "integration")
5
+
6
+ desc "start test server"
7
+ task :start_server do
8
+ Dir.chdir(integration_dir) do
9
+ sh "docker image build . -t ssh_server"
10
+ sh "docker run -d -p 10000:22 ssh_server"
11
+ end
12
+ end
13
+
14
+ desc "stop test server"
15
+ task :stop_server do
16
+ Dir.chdir(integration_dir) do
17
+ sh "docker kill $(docker ps -q --filter 'ancestor=ssh_server') || true"
18
+ end
19
+ end
20
+
21
+ desc "Deploy to docker"
22
+ task :deploy do
23
+ require "dotenv/load"
24
+ Dir.chdir(integration_dir) do
25
+ sh "chmod 600 #{integration_dir}/config/id_ed25519"
26
+ sh "bundle exec cap development deploy"
27
+ end
28
+ end
29
+
30
+ desc "Run all integration test"
31
+ task :all => %i(start_server deploy stop_server)
32
+ end
@@ -14,15 +14,12 @@ Gem::Specification.new do |spec|
14
14
  spec.homepage = "https://github.com/sue445/capistrano-around_chatwork"
15
15
  spec.license = "MIT"
16
16
 
17
- spec.required_ruby_version = ">= 2.1.0"
18
-
19
- # Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
20
- # delete this section to allow pushing this gem to any host.
21
- if spec.respond_to?(:metadata)
22
- spec.metadata['allowed_push_host'] = "https://rubygems.org"
23
- else
24
- raise "RubyGems 2.0 or newer is required to protect against public gem pushes."
25
- end
17
+ spec.required_ruby_version = ">= 3.2.0"
18
+
19
+ spec.metadata["homepage_uri"] = spec.homepage
20
+ spec.metadata["source_code_uri"] = spec.homepage
21
+ spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/master/CHANGELOG.md"
22
+ spec.metadata["rubygems_mfa_required"] = "true"
26
23
 
27
24
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
28
25
  %w(img/).each do |exclude_dir|
@@ -34,8 +31,11 @@ Gem::Specification.new do |spec|
34
31
  spec.require_paths = ["lib"]
35
32
 
36
33
  spec.add_dependency "capistrano", ">= 3.0.0"
37
- spec.add_dependency "cha", ">= 1.2.0"
34
+ spec.add_dependency "chatwork"
38
35
 
39
- spec.add_development_dependency "bundler", "~> 1.9"
40
- spec.add_development_dependency "rake", "~> 10.0"
36
+ spec.add_development_dependency "bcrypt_pbkdf"
37
+ spec.add_development_dependency "bundler"
38
+ spec.add_development_dependency "dotenv"
39
+ spec.add_development_dependency "ed25519"
40
+ spec.add_development_dependency "rake"
41
41
  end
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module AroundChatwork
3
- VERSION = "1.0.1"
3
+ VERSION = "2.0.0"
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  require "capistrano/around_chatwork/version"
2
- require "cha"
2
+ require "chatwork"
3
3
 
4
4
  module Capistrano
5
5
  module AroundChatwork
@@ -23,8 +23,8 @@ module Capistrano
23
23
  def self.post_chatwork(message)
24
24
  return if message.empty?
25
25
 
26
- client = Cha.new(api_token: fetch(:chatwork_api_token))
27
- client.create_room_message(fetch(:chatwork_room_id), message)
26
+ client = ChatWork::Client.new(api_key: fetch(:chatwork_api_token))
27
+ client.create_message(room_id: fetch(:chatwork_room_id), body: message)
28
28
  end
29
29
  end
30
30
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-around_chatwork
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2018-01-19 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: capistrano
@@ -25,47 +24,89 @@ dependencies:
25
24
  - !ruby/object:Gem::Version
26
25
  version: 3.0.0
27
26
  - !ruby/object:Gem::Dependency
28
- name: cha
27
+ name: chatwork
29
28
  requirement: !ruby/object:Gem::Requirement
30
29
  requirements:
31
30
  - - ">="
32
31
  - !ruby/object:Gem::Version
33
- version: 1.2.0
32
+ version: '0'
34
33
  type: :runtime
35
34
  prerelease: false
36
35
  version_requirements: !ruby/object:Gem::Requirement
37
36
  requirements:
38
37
  - - ">="
39
38
  - !ruby/object:Gem::Version
40
- version: 1.2.0
39
+ version: '0'
40
+ - !ruby/object:Gem::Dependency
41
+ name: bcrypt_pbkdf
42
+ requirement: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - ">="
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
47
+ type: :development
48
+ prerelease: false
49
+ version_requirements: !ruby/object:Gem::Requirement
50
+ requirements:
51
+ - - ">="
52
+ - !ruby/object:Gem::Version
53
+ version: '0'
41
54
  - !ruby/object:Gem::Dependency
42
55
  name: bundler
43
56
  requirement: !ruby/object:Gem::Requirement
44
57
  requirements:
45
- - - "~>"
58
+ - - ">="
46
59
  - !ruby/object:Gem::Version
47
- version: '1.9'
60
+ version: '0'
48
61
  type: :development
49
62
  prerelease: false
50
63
  version_requirements: !ruby/object:Gem::Requirement
51
64
  requirements:
52
- - - "~>"
65
+ - - ">="
53
66
  - !ruby/object:Gem::Version
54
- version: '1.9'
67
+ version: '0'
68
+ - !ruby/object:Gem::Dependency
69
+ name: dotenv
70
+ requirement: !ruby/object:Gem::Requirement
71
+ requirements:
72
+ - - ">="
73
+ - !ruby/object:Gem::Version
74
+ version: '0'
75
+ type: :development
76
+ prerelease: false
77
+ version_requirements: !ruby/object:Gem::Requirement
78
+ requirements:
79
+ - - ">="
80
+ - !ruby/object:Gem::Version
81
+ version: '0'
82
+ - !ruby/object:Gem::Dependency
83
+ name: ed25519
84
+ requirement: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - ">="
87
+ - !ruby/object:Gem::Version
88
+ version: '0'
89
+ type: :development
90
+ prerelease: false
91
+ version_requirements: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - ">="
94
+ - !ruby/object:Gem::Version
95
+ version: '0'
55
96
  - !ruby/object:Gem::Dependency
56
97
  name: rake
57
98
  requirement: !ruby/object:Gem::Requirement
58
99
  requirements:
59
- - - "~>"
100
+ - - ">="
60
101
  - !ruby/object:Gem::Version
61
- version: '10.0'
102
+ version: '0'
62
103
  type: :development
63
104
  prerelease: false
64
105
  version_requirements: !ruby/object:Gem::Requirement
65
106
  requirements:
66
- - - "~>"
107
+ - - ">="
67
108
  - !ruby/object:Gem::Version
68
- version: '10.0'
109
+ version: '0'
69
110
  description: post to ChatWork before and after the specified task
70
111
  email:
71
112
  - sue445@sue445.net
@@ -73,6 +114,12 @@ executables: []
73
114
  extensions: []
74
115
  extra_rdoc_files: []
75
116
  files:
117
+ - ".env.example"
118
+ - ".github/dependabot.yml"
119
+ - ".github/release.yml"
120
+ - ".github/workflows/dependabot-auto-merge.yml"
121
+ - ".github/workflows/release_gem.yml"
122
+ - ".github/workflows/test.yml"
76
123
  - ".gitignore"
77
124
  - CHANGELOG.md
78
125
  - Gemfile
@@ -88,8 +135,10 @@ homepage: https://github.com/sue445/capistrano-around_chatwork
88
135
  licenses:
89
136
  - MIT
90
137
  metadata:
91
- allowed_push_host: https://rubygems.org
92
- post_install_message:
138
+ homepage_uri: https://github.com/sue445/capistrano-around_chatwork
139
+ source_code_uri: https://github.com/sue445/capistrano-around_chatwork
140
+ changelog_uri: https://github.com/sue445/capistrano-around_chatwork/blob/master/CHANGELOG.md
141
+ rubygems_mfa_required: 'true'
93
142
  rdoc_options: []
94
143
  require_paths:
95
144
  - lib
@@ -97,16 +146,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
97
146
  requirements:
98
147
  - - ">="
99
148
  - !ruby/object:Gem::Version
100
- version: 2.1.0
149
+ version: 3.2.0
101
150
  required_rubygems_version: !ruby/object:Gem::Requirement
102
151
  requirements:
103
152
  - - ">="
104
153
  - !ruby/object:Gem::Version
105
154
  version: '0'
106
155
  requirements: []
107
- rubyforge_project:
108
- rubygems_version: 2.7.3
109
- signing_key:
156
+ rubygems_version: 4.0.3
110
157
  specification_version: 4
111
158
  summary: post to ChatWork before and after the specified task
112
159
  test_files: []