From b014c10c611473db2b918faa40d0e6bee5987719 Mon Sep 17 00:00:00 2001 From: Corey Hemminger Date: Fri, 21 Jun 2024 17:01:15 -0500 Subject: [PATCH] fix: release please configs Signed-off-by: Corey Hemminger --- .github/CODEOWNERS | 1 + .github/workflows/ci.yml | 22 ---------------------- .github/workflows/lint.yml | 9 +++++++++ .github/workflows/publish.yml | 32 ++++++++++++++++++++++++++++++++ .markdownlint.yaml | 6 ++++++ .release-please-manifest.json | 3 +++ .rubocop.yml | 11 +++++++++++ Gemfile | 15 +++++++++++++++ kitchen-openstack.gemspec | 9 +-------- release-please-config.json | 12 ++++++++++++ 10 files changed, 90 insertions(+), 30 deletions(-) create mode 100644 .github/CODEOWNERS delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/publish.yml create mode 100644 .markdownlint.yaml create mode 100644 .release-please-manifest.json create mode 100644 .rubocop.yml create mode 100644 release-please-config.json diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 0000000..b7175b0 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1 @@ +@test-kitchen/maintainers diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index f61186d..0000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: CI - -on: - pull_request: - push: - branches: - - main - -jobs: - test: - runs-on: ubuntu-latest - strategy: - matrix: - ruby: [ '2.6', '2.7', '3.0', '3.1' ] - name: Lint & Test with Ruby ${{ matrix.ruby }} - steps: - - uses: actions/checkout@v2 - - uses: ruby/setup-ruby@v1 - with: - ruby-version: ${{ matrix.ruby }} - bundler-cache: true - - run: bundle exec rake diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000..042bc85 --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,9 @@ +--- +name: 'Lint, Unit & Integration Tests' + +'on': + pull_request: + +jobs: + lint-unit: + uses: test-kitchen/.github/.github/workflows/lint-unit.yml@main diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..d47a1b2 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,32 @@ +--- +name: release-please + +"on": + push: + branches: [main] + +jobs: + release-please: + runs-on: ubuntu-latest + steps: + - uses: googleapis/release-please-action@v4 + id: release + with: + token: ${{ secrets.PORTER_GITHUB_TOKEN }} + + - 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 new file mode 100644 index 0000000..9fd2375 --- /dev/null +++ b/.markdownlint.yaml @@ -0,0 +1,6 @@ +--- +default: true +MD004: false +MD012: false +MD013: false +MD024: false diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 0000000..e1e352c --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "6.2.0" +} diff --git a/.rubocop.yml b/.rubocop.yml new file mode 100644 index 0000000..0683d3c --- /dev/null +++ b/.rubocop.yml @@ -0,0 +1,11 @@ +--- +require: + - chefstyle + +AllCops: + TargetRubyVersion: 3.1 + Include: + - "**/*.rb" + Exclude: + - "vendor/**/*" + - "spec/**/*" diff --git a/Gemfile b/Gemfile index acabfdc..c29f133 100644 --- a/Gemfile +++ b/Gemfile @@ -4,3 +4,18 @@ source "https://rubygems.org" # Specify your gem's dependencies in kitchen-openstack.gemspec gemspec + +group :test do + gem "rake" + gem "kitchen-inspec" + gem "rspec", "~> 3.2" + gem "countloc" +end + +group :debug do + gem "pry" +end + +group :chefstyle do + gem "chefstyle", "2.2.3" +end diff --git a/kitchen-openstack.gemspec b/kitchen-openstack.gemspec index e43016c..e17397d 100644 --- a/kitchen-openstack.gemspec +++ b/kitchen-openstack.gemspec @@ -17,16 +17,9 @@ Gem::Specification.new do |spec| spec.files = Dir["LICENSE", "README.md", "lib/**/*"] spec.require_paths = ["lib"] - spec.required_ruby_version = ">= 2.6.0" + spec.required_ruby_version = ">= 3.1" spec.add_dependency "test-kitchen", ">= 1.4.1", "< 4" spec.add_dependency "fog-openstack", "~> 1.0" spec.add_dependency "ohai" - - spec.add_development_dependency "bundler" - spec.add_development_dependency "rake" - spec.add_development_dependency "chefstyle" - spec.add_development_dependency "countloc" - spec.add_development_dependency "rspec" - spec.add_development_dependency "github_changelog_generator" end diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 0000000..737561e --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,12 @@ +{ + "packages": { + ".": { + "package-name": "kitchen-openstack", + "changelog-path": "CHANGELOG.md", + "release-type": "ruby", + "include-component-in-tag": false, + "version-file": "lib/kitchen/driver/openstack_version.rb" + } + }, + "$schema": "https://raw.githubusercontent.com/googleapis/release-please/main/schemas/config.json" +}