capistrano-around_chatwork 1.0.2 → 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: af33eb9e410ee6bbb301b1066238060a96e6090202244424bae547a6698dc06d
4
- data.tar.gz: a54735fc4dca586c91a3fe0c16d0b7305045132b32a5016418f5dc75323a8542
3
+ metadata.gz: f0b06fb228ef8662b7a062c1693758e1e5256829970fcebede88a99c347e0c82
4
+ data.tar.gz: e0c27acf4b5fb47a351314f5d6365c77363b6804ffbb922fba70bea49efedeed
5
5
  SHA512:
6
- metadata.gz: 802be193d45fbb36e362111f546786f3e6579569413ecb2693e579c38a77727de798ba98c9dc39d282256380e32f665c3b26012d6d88d63dbf221baf515ac6a9
7
- data.tar.gz: 1f8a26a12aaf349a19a123b387b1317e1fa5d781ca913f924a9a45d68e7b36a7059d2b811ed8ac5745eb7aeb80c35a2aa0a1a57ea9cb2c5659537fc888878095
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,20 @@
1
1
  # Changelog
2
2
  ## Unreleased
3
- [full changelog](https://github.com/sue445/capistrano-around_chatwork/compare/v1.0.2...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
4
18
 
5
19
  ## 1.0.2
6
20
  [full changelog](https://github.com/sue445/capistrano-around_chatwork/compare/v1.0.1...v1.0.2)
data/README.md CHANGED
@@ -1,7 +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)
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)
5
6
 
6
7
  post to [ChatWork](http://www.chatwork.com/) before and after the specified task
7
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,7 +14,7 @@ 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"
17
+ spec.required_ruby_version = ">= 3.2.0"
18
18
 
19
19
  spec.metadata["homepage_uri"] = spec.homepage
20
20
  spec.metadata["source_code_uri"] = spec.homepage
@@ -31,8 +31,11 @@ Gem::Specification.new do |spec|
31
31
  spec.require_paths = ["lib"]
32
32
 
33
33
  spec.add_dependency "capistrano", ">= 3.0.0"
34
- spec.add_dependency "cha", ">= 1.2.0"
34
+ spec.add_dependency "chatwork"
35
35
 
36
+ spec.add_development_dependency "bcrypt_pbkdf"
36
37
  spec.add_development_dependency "bundler"
38
+ spec.add_development_dependency "dotenv"
39
+ spec.add_development_dependency "ed25519"
37
40
  spec.add_development_dependency "rake"
38
41
  end
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module AroundChatwork
3
- VERSION = "1.0.2"
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.2
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: 2021-11-20 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,19 +24,33 @@ 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
@@ -52,6 +65,34 @@ dependencies:
52
65
  - - ">="
53
66
  - !ruby/object:Gem::Version
54
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
@@ -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
@@ -92,7 +139,6 @@ metadata:
92
139
  source_code_uri: https://github.com/sue445/capistrano-around_chatwork
93
140
  changelog_uri: https://github.com/sue445/capistrano-around_chatwork/blob/master/CHANGELOG.md
94
141
  rubygems_mfa_required: 'true'
95
- post_install_message:
96
142
  rdoc_options: []
97
143
  require_paths:
98
144
  - lib
@@ -100,15 +146,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
100
146
  requirements:
101
147
  - - ">="
102
148
  - !ruby/object:Gem::Version
103
- version: 2.1.0
149
+ version: 3.2.0
104
150
  required_rubygems_version: !ruby/object:Gem::Requirement
105
151
  requirements:
106
152
  - - ">="
107
153
  - !ruby/object:Gem::Version
108
154
  version: '0'
109
155
  requirements: []
110
- rubygems_version: 3.2.22
111
- signing_key:
156
+ rubygems_version: 4.0.3
112
157
  specification_version: 4
113
158
  summary: post to ChatWork before and after the specified task
114
159
  test_files: []