diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 1a56ad0fa6..ed77f56a5d 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,67 +1,88 @@ -name: "Mongoid Release" -run-name: "Mongoid Release for ${{ github.ref }}" +name: "Gem Release" +run-name: "Gem Release for ${{ github.ref }}" on: + # for auto-deploy when merging a release-candidate PR + push: + branches: + - 'master' + - '*-stable' + + # for manual release workflow_dispatch: inputs: - dry_run: - description: Whether this is a dry run or not + pr: + description: "The number of the merged release candidate PR" required: true - default: true - type: boolean env: SILK_ASSET_GROUP: mongoid - RELEASE_MESSAGE_TEMPLATE: | - Version {0} of the [Mongoid ODM for MongoDB](https://rubygems.org/gems/mongoid) is now available. - - **Release Highlights** + GEM_NAME: mongoid + PRODUCT_NAME: Mongoid + PRODUCT_ID: mongoid - TODO: one or more paragraphs describing important changes in this release +permissions: + # required for all workflows + security-events: write - **Documentation** + # required to fetch internal or private CodeQL packs + packages: read - Documentation is available at [MongoDB.com](https://www.mongodb.com/docs/mongoid/current/). + # only required for workflows in private repositories + actions: read + pull-requests: read + contents: write - **Installation** + # required by the mongodb-labs/drivers-github-tools/setup@v2 step + # also required by `rubygems/release-gem` + id-token: write - You may install this version via RubyGems, with: +jobs: + check: + name: "Check Release" + runs-on: ubuntu-latest + outputs: + message: ${{ steps.check.outputs.message }} + ref: ${{ steps.check.outputs.ref }} + steps: + - name: "Run the check action" + id: check + uses: jamis/drivers-github-tools/ruby/pr-check@ruby-3643-update-release-process - gem install --version {0} mongoid + build: + name: "Build Gems" + needs: check + environment: release + runs-on: ubuntu-latest + steps: + - name: "Run the build action" + uses: jamis/drivers-github-tools/ruby/build@ruby-3643-update-release-process + with: + app_id: ${{ vars.APP_ID }} + app_private_key: ${{ secrets.APP_PRIVATE_KEY }} + artifact: 'ruby-3.2' + gem_name: ${{ env.GEM_NAME }} + ruby_version: 'ruby-3.2' + ref: ${{ needs.check.outputs.ref }} -jobs: - release: - name: "Mongoid Release" + publish: + name: "Publish Gems" + needs: [ check, build ] environment: release runs-on: 'ubuntu-latest' - - permissions: - # required for all workflows - security-events: write - - # required to fetch internal or private CodeQL packs - packages: read - - # only required for workflows in private repositories - actions: read - contents: write - - # required by the mongodb-labs/drivers-github-tools/setup@v2 step - # also required by `rubygems/release-gem` - id-token: write - steps: - name: "Run the publish action" - uses: mongodb-labs/drivers-github-tools/ruby/publish@v2 + uses: jamis/drivers-github-tools/ruby/publish@ruby-3643-update-release-process with: app_id: ${{ vars.APP_ID }} app_private_key: ${{ secrets.APP_PRIVATE_KEY }} aws_role_arn: ${{ secrets.AWS_ROLE_ARN }} aws_region_name: ${{ vars.AWS_REGION_NAME }} aws_secret_id: ${{ secrets.AWS_SECRET_ID }} - dry_run: ${{ inputs.dry_run }} - gem_name: mongoid - product_name: Mongoid - product_id: mongoid - release_message_template: ${{ env.RELEASE_MESSAGE_TEMPLATE }} + dry_run: false + gem_name: ${{ env.GEM_NAME }} + product_name: ${{ env.PRODUCT_NAME }} + product_id: ${{ env.PRODUCT_ID }} + release_message: ${{ needs.check.outputs.message }} silk_asset_group: ${{ env.SILK_ASSET_GROUP }} + ref: ${{ needs.check.outputs.ref }} diff --git a/Rakefile b/Rakefile index 6c45428d1f..c616601569 100644 --- a/Rakefile +++ b/Rakefile @@ -10,16 +10,16 @@ $: << File.join(ROOT, 'spec/shared/lib') require "rake" require "rspec/core/rake_task" -# stands in for the Bundler-provided `build` task, which builds the -# gem for this project. Our release process builds the gems in a -# particular way, in a GitHub action. This task is just to help remind -# developers of that fact. +if File.exist?('./spec/shared/lib/tasks/candidate.rake') + load 'spec/shared/lib/tasks/candidate.rake' +end + +desc 'Build the gem' task :build do - abort <<~WARNING - `rake build` does nothing in this project. The gem must be built via - the `Mongoid Release` action on GitHub, which is triggered manually when - a new release is ready. - WARNING + command = %w[ gem build ] + command << "--output=#{ENV['GEM_FILE_NAME']}" if ENV['GEM_FILE_NAME'] + command << (ENV['GEMSPEC'] || 'mongoid.gemspec') + system(*command) end # `rake version` is used by the deployment system so get the release version diff --git a/gem-public_cert.pem b/gem-public_cert.pem deleted file mode 100644 index 68fa1da731..0000000000 --- a/gem-public_cert.pem +++ /dev/null @@ -1,26 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIEeDCCAuCgAwIBAgIBATANBgkqhkiG9w0BAQsFADBBMREwDwYDVQQDDAhkYngt -cnVieTEXMBUGCgmSJomT8ixkARkWB21vbmdvZGIxEzARBgoJkiaJk/IsZAEZFgNj -b20wHhcNMjQwMjA5MTc0NzIyWhcNMjUwMjA4MTc0NzIyWjBBMREwDwYDVQQDDAhk -YngtcnVieTEXMBUGCgmSJomT8ixkARkWB21vbmdvZGIxEzARBgoJkiaJk/IsZAEZ -FgNjb20wggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQC0/Veq9l47cTfX -tQ+kHq2NOCwJuJGt1iXWQ/vH/yp7pZ/bLej7gPDl2CfIngAXRjM7r1FkR9ya7VAm -IneBFcVU3HhpIXWi4ByXGjBOXFD1Dfbz4C4zedIWRk/hNzXa+rQY4KPwpOwG/hZg -id+rSXWSbNlkyN97XfonweVh7JsIa9X/2JY9ADYjhCfEZF+b0+Wl7+jgwzLWb46I -0WH0bZBIZ0BbKAwUXIgvq5mQf9PzukmMVYCwnkJ/P4wrHO22HuwnbMyvJuGjVwqi -j1NRp/2vjmKBFWxIfhlSXEIiqAmeEVNXzhPvTVeyo+rma+7R3Bo+4WHkcnPpXJJZ -Jd63qXMvTB0GplEcMJPztWhrJOmcxIOVoQyigEPSQT8JpzFVXby4SGioizv2eT7l -VYSiCHuc3yEDyq5M+98WGX2etbj6esYtzI3rDevpIAHPB6HQmtoJIA4dSl3gjFb+ -D+YQSuB2qYu021FI9zeY9sbZyWysEXBxhwrmTk+XUV0qz+OQZkMCAwEAAaN7MHkw -CQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFH4nnr4tYlatU57RbExW -jG86YM5nMB8GA1UdEQQYMBaBFGRieC1ydWJ5QG1vbmdvZGIuY29tMB8GA1UdEgQY -MBaBFGRieC1ydWJ5QG1vbmdvZGIuY29tMA0GCSqGSIb3DQEBCwUAA4IBgQBKGtHA -fpi3N/BL1J5O4CBsAjtF4jHDiw2r5MwK+66NzMh3uedjgPI7MoosemLy++SB+8BR -SE8bDkb6gfDQQzrI6KSXXyqH2TbQXpY5Tac7/yqXRiu8G2qOrOj4czB/Hq7j09CV -YoH88v6hL11i5jt6jPjFh8hXYG0hDQxhi3atRz5Wwd98tUf2DSbyJXJiRgCBeZjl -rP7AnKsWMu0C+zPlL+nXtQr+nTFtkKXRWfUJMqePpBqtriQvgQ+Y1ItqYVTSLuiM -iwUMcn/rGhdCMBSaKDXdFkIveCHQE2f2WBo2EdErrcTrgEKYYdNfzcb/43j7L1kx -AUwyTtk+HFrviBynQbKN82rjbZE+5gukVea5c7idQPkqacPYsoU37DI+hTlUyJkV -dcTtfEg44lLlfNukBslfiQf54r+uWbyB0m0rDUN/py7/Ghyzt5GLBU91uCO3dGoI -55uFRHMvEcJMTDeImC/nuucPCAiEGMHggr9+NPC0tqpxjGKTo7lS7GzUFjg= ------END CERTIFICATE----- diff --git a/lib/mongoid/version.rb b/lib/mongoid/version.rb index e6bed282cf..fb278a1e1c 100644 --- a/lib/mongoid/version.rb +++ b/lib/mongoid/version.rb @@ -1,5 +1,9 @@ # frozen_string_literal: true module Mongoid - VERSION = "8.0.10" + # The current version of Mongoid + # + # Note that this file is automatically updated via `rake candidate:create`. + # Manual changes to this file will be overwritten by that rake task. + VERSION = '8.0.10' end diff --git a/mongoid.gemspec b/mongoid.gemspec index fed8a63fec..2f18536b90 100644 --- a/mongoid.gemspec +++ b/mongoid.gemspec @@ -24,13 +24,6 @@ Gem::Specification.new do |s| 'source_code_uri' => 'https://github.com/mongodb/mongoid', } - if File.exist?('gem-private_key.pem') - s.signing_key = 'gem-private_key.pem' - s.cert_chain = ['gem-public_cert.pem'] - else - warn "[#{s.name}] Warning: No private key present, creating unsigned gem." - end - s.required_ruby_version = ">= 2.6" s.required_rubygems_version = ">= 1.3.6" diff --git a/product.yml b/product.yml new file mode 100644 index 0000000000..e3cf86f88e --- /dev/null +++ b/product.yml @@ -0,0 +1,8 @@ +--- +name: Mongoid +description: a Ruby ODM for MongoDB +package: mongoid +jira: https://jira.mongodb.org/projects/MONGOID +version: + number: 8.0.10 + file: lib/mongoid/version.rb diff --git a/spec/shared b/spec/shared index a59235a9fd..6b1158f69f 160000 --- a/spec/shared +++ b/spec/shared @@ -1 +1 @@ -Subproject commit a59235a9fd96c545105f8f1f9dec49738e1c0a3c +Subproject commit 6b1158f69f7a23345259223bc305393b86e9ab3e