diff --git a/.github/workflows/linters.yml b/.github/workflows/linters.yml index 4700f36..0eaf511 100644 --- a/.github/workflows/linters.yml +++ b/.github/workflows/linters.yml @@ -6,4 +6,4 @@ name: 'Test' jobs: lint-unit: - uses: test-kitchen/.github/.github/workflows/lint-unit.yml@main + uses: test-kitchen/.github/.github/workflows/lint-unit.yml@v0.1.2 diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..cf2a45c --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,34 @@ +--- +name: release-please + +"on": + push: + branches: [main] + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: google-github-actions/release-please-action@v3 + id: release + with: + release-type: ruby + package-name: kitchen-google + version-file: lib/kitchen/driver/gce_version.rb + + - name: Checkout + uses: actions/checkout@v4 + if: ${{ steps.release.outputs.release_created }} + + - name: Build and publish to GitHub Package + uses: actionshub/publish-gem-to-github@main + if: ${{ steps.release.outputs.release_created }} + with: + token: ${{ secrets.GITHUB_TOKEN }} + owner: ${{ secrets.OWNER }} + + - name: Build and publish to RubyGems + uses: actionshub/publish-gem-to-rubygems@main + if: ${{ steps.release.outputs.release_created }} + with: + token: ${{ secrets.RUBYGEMS_API_KEY }} diff --git a/.markdownlint.yaml b/.markdownlint.yaml index 177bd51..5df560a 100644 --- a/.markdownlint.yaml +++ b/.markdownlint.yaml @@ -1,5 +1,8 @@ ---- -MD012: false +default: true MD013: false MD024: false +MD026: false MD036: false +MD012: false +MD029: false +MD004: false diff --git a/.mdlrc b/.mdlrc deleted file mode 100644 index c8faaa6..0000000 --- a/.mdlrc +++ /dev/null @@ -1 +0,0 @@ -rules "~MD036", "~MD013", "~MD024", "~MD029" diff --git a/.rubocop.yml b/.rubocop.yml index 1130823..8fd406e 100644 --- a/.rubocop.yml +++ b/.rubocop.yml @@ -1,3 +1,11 @@ --- +require: + - chefstyle + AllCops: - TargetRubyVersion: 2.5 + TargetRubyVersion: 3.1 + Include: + - "**/*.rb" + Exclude: + - "vendor/**/*" + - "spec/**/*" diff --git a/Gemfile b/Gemfile index f9de6ee..64a208e 100644 --- a/Gemfile +++ b/Gemfile @@ -1,6 +1,5 @@ source "https://rubygems.org" -# Specify your gem's dependencies in kitchen-google.gemspec gemspec group :test do diff --git a/kitchen-google.gemspec b/kitchen-google.gemspec index 48c42e5..07dd5dd 100644 --- a/kitchen-google.gemspec +++ b/kitchen-google.gemspec @@ -6,8 +6,8 @@ Gem::Specification.new do |s| s.version = Kitchen::Driver::GCE_VERSION s.summary = "Kitchen::Driver::Gce" s.description = "A Test-Kitchen driver for Google Compute Engine" - s.authors = ["Andrew Leonard", "Chef Partner Engineering"] - s.email = ["andy@hurricane-ridge.com", "partnereng@chef.io"] + s.authors = ["Test Kitchen Team"] + s.email = ["help@sous-chefs.org"] s.homepage = "https://github.com/test-kitchen/kitchen-google" s.license = "Apache-2.0" @@ -16,7 +16,7 @@ Gem::Specification.new do |s| s.add_dependency "gcewinpass", "~> 1.1" s.add_dependency "google-api-client", ">= 0.23.9", "<= 0.54.0" - s.add_dependency "test-kitchen", ">= 1.4.1" + s.add_dependency "test-kitchen", ">= 1.0.0", "< 4.0" - s.required_ruby_version = ">= 2.7" + s.required_ruby_version = ">= 3.1" end diff --git a/lib/kitchen/driver/gce.rb b/lib/kitchen/driver/gce.rb index 42dbad3..a38aa61 100644 --- a/lib/kitchen/driver/gce.rb +++ b/lib/kitchen/driver/gce.rb @@ -84,7 +84,7 @@ class Gce < Kitchen::Driver::Base default_config :metadata, {} default_config :labels, {} - DISK_NAME_REGEX = /(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)/.freeze + DISK_NAME_REGEX = /(?:[a-z](?:[-a-z0-9]{0,61}[a-z0-9])?)/ def name "Google Compute (GCE)" @@ -272,11 +272,11 @@ def update_windows_password(server_name) info("Resetting the Windows password for user #{username} on #{server_name}...") state[:password] = GoogleComputeWindowsPassword.new( - project: project, - zone: zone, + project:, + zone:, instance_name: server_name, email: config[:email], - username: username + username: ).new_password info("Password reset complete on #{server_name} complete.") diff --git a/renovate.json b/renovate.json new file mode 100644 index 0000000..b65764b --- /dev/null +++ b/renovate.json @@ -0,0 +1,8 @@ +{ + "$schema": "https://docs.renovatebot.com/renovate-schema.json", + "extends": [ + "config:recommended", + ":disableDependencyDashboard", + "schedule:automergeEarlyMondays" + ] +}