-
Notifications
You must be signed in to change notification settings - Fork 533
RUBY-3357 SSDLC Requirements #2880
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 10 commits
0049b0c
4b74d2e
5eae10f
884e922
832b1ab
f8b3e6a
51b948b
1d30b52
1ee7240
0494c06
d5c273f
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: "Dry-Run Cleanup" | ||
run-name: "Dry Run Cleanup for ${{ github.ref }}" | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
confirm: | ||
description: Indicate whether you want this workflow to run (must be "true") | ||
required: true | ||
type: string | ||
tag: | ||
description: The name of the tag (and release) to clean up | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
release: | ||
name: "Dry-Run Cleanup" | ||
environment: release | ||
runs-on: 'ubuntu-latest' | ||
if: ${{ inputs.confirm == 'true' }} | ||
|
||
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 cleanup action" | ||
uses: mongodb-labs/drivers-github-tools/ruby/cleanup@v2 | ||
with: | ||
app_id: ${{ vars.APP_ID }} | ||
app_private_key: ${{ secrets.APP_PRIVATE_KEY }} | ||
tag: ${{ inputs.tag }} |
Original file line number | Diff line number | Diff line change | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
@@ -1,9 +1,16 @@ | ||||||||||||||||||
name: "Driver Release" | ||||||||||||||||||
run-name: "Ruby Driver Release ${{ github.ref_name }}" | ||||||||||||||||||
run-name: "Driver Release for ${{ github.ref }}" | ||||||||||||||||||
|
||||||||||||||||||
on: workflow_dispatch | ||||||||||||||||||
on: | ||||||||||||||||||
workflow_dispatch: | ||||||||||||||||||
inputs: | ||||||||||||||||||
dry_run: | ||||||||||||||||||
description: Whether this is a dry run or not ("false" to deploy) | ||||||||||||||||||
required: true | ||||||||||||||||||
type: string | ||||||||||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Inputs for Consider this:
Suggested change
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh, that's good to know! I'll give that a try. |
||||||||||||||||||
|
||||||||||||||||||
env: | ||||||||||||||||||
SILK_ASSET_GROUP: mongodb-ruby-driver | ||||||||||||||||||
RELEASE_MESSAGE_TEMPLATE: | | ||||||||||||||||||
Version {0} of the [MongoDB Ruby Driver](https://rubygems.org/gems/mongo) is now available. | ||||||||||||||||||
|
||||||||||||||||||
|
@@ -43,88 +50,17 @@ jobs: | |||||||||||||||||
id-token: write | ||||||||||||||||||
|
||||||||||||||||||
steps: | ||||||||||||||||||
- name: "Create temporary app token" | ||||||||||||||||||
uses: actions/create-github-app-token@v1 | ||||||||||||||||||
id: app-token | ||||||||||||||||||
with: | ||||||||||||||||||
app-id: ${{ vars.APP_ID }} | ||||||||||||||||||
private-key: ${{ secrets.APP_PRIVATE_KEY }} | ||||||||||||||||||
|
||||||||||||||||||
- name: "Store GitHub token in environment" | ||||||||||||||||||
run: echo "GH_TOKEN=${{ steps.app-token.outputs.token }}" >> "$GITHUB_ENV" | ||||||||||||||||||
shell: bash | ||||||||||||||||||
|
||||||||||||||||||
- name: Checkout repository | ||||||||||||||||||
uses: actions/checkout@v4 | ||||||||||||||||||
with: | ||||||||||||||||||
token: ${{ env.GH_TOKEN }} | ||||||||||||||||||
|
||||||||||||||||||
- name: Setup Ruby | ||||||||||||||||||
uses: ruby/setup-ruby@v1 | ||||||||||||||||||
with: | ||||||||||||||||||
ruby-version: '3.2' | ||||||||||||||||||
bundler-cache: true | ||||||||||||||||||
|
||||||||||||||||||
- name: Setup GitHub tooling for DBX Drivers | ||||||||||||||||||
uses: mongodb-labs/drivers-github-tools/setup@v2 | ||||||||||||||||||
- name: "Run the publish action" | ||||||||||||||||||
uses: mongodb-labs/drivers-github-tools/ruby/publish@v2 | ||||||||||||||||||
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 }} | ||||||||||||||||||
|
||||||||||||||||||
- name: Get the driver version | ||||||||||||||||||
shell: bash | ||||||||||||||||||
run: | | ||||||||||||||||||
echo "DRIVER_VERSION=$(ruby -Ilib -rmongo/version -e 'puts Mongo::VERSION')" >> "$GITHUB_ENV" | ||||||||||||||||||
|
||||||||||||||||||
- name: Set output gem file name | ||||||||||||||||||
shell: bash | ||||||||||||||||||
run: | | ||||||||||||||||||
echo "GEM_FILE_NAME=mongo-${{ env.DRIVER_VERSION }}.gem" >> "$GITHUB_ENV" | ||||||||||||||||||
|
||||||||||||||||||
- name: Build the gem | ||||||||||||||||||
shell: bash | ||||||||||||||||||
run: | | ||||||||||||||||||
gem build --output=${{ env.GEM_FILE_NAME }} mongo.gemspec | ||||||||||||||||||
|
||||||||||||||||||
- name: Sign the gem | ||||||||||||||||||
uses: mongodb-labs/drivers-github-tools/gpg-sign@v2 | ||||||||||||||||||
with: | ||||||||||||||||||
filenames: '${{ env.GEM_FILE_NAME }}' | ||||||||||||||||||
|
||||||||||||||||||
- name: Create and sign the tag | ||||||||||||||||||
uses: mongodb-labs/drivers-github-tools/git-sign@v2 | ||||||||||||||||||
with: | ||||||||||||||||||
command: "git tag -u ${{ env.GPG_KEY_ID }} -m 'Release tag for v${{ env.DRIVER_VERSION }}' v${{ env.DRIVER_VERSION }}" | ||||||||||||||||||
|
||||||||||||||||||
- name: Push the tag to the repository | ||||||||||||||||||
shell: bash | ||||||||||||||||||
run: | | ||||||||||||||||||
git push origin v${{ env.DRIVER_VERSION }} | ||||||||||||||||||
|
||||||||||||||||||
- name: Create a new release | ||||||||||||||||||
shell: bash | ||||||||||||||||||
run: gh release create v${{ env.DRIVER_VERSION }} --title ${{ env.DRIVER_VERSION }} --generate-notes --draft | ||||||||||||||||||
|
||||||||||||||||||
- name: Capture the changelog | ||||||||||||||||||
shell: bash | ||||||||||||||||||
run: gh release view v${{ env.DRIVER_VERSION }} --json body --template '{{ .body }}' >> changelog | ||||||||||||||||||
|
||||||||||||||||||
- name: Prepare release message | ||||||||||||||||||
shell: bash | ||||||||||||||||||
run: | | ||||||||||||||||||
echo "${{ format(env.RELEASE_MESSAGE_TEMPLATE, env.DRIVER_VERSION) }}" > release-message | ||||||||||||||||||
cat changelog >> release-message | ||||||||||||||||||
|
||||||||||||||||||
- name: Update release information | ||||||||||||||||||
shell: bash | ||||||||||||||||||
run: | | ||||||||||||||||||
echo "RELEASE_URL=$(gh release edit v${{ env.DRIVER_VERSION }} --notes-file release-message)" >> "$GITHUB_ENV" | ||||||||||||||||||
|
||||||||||||||||||
- name: Upload release artifacts | ||||||||||||||||||
run: gh release upload v${{ env.DRIVER_VERSION }} ${{ env.GEM_FILE_NAME }} ${{ env.RELEASE_ASSETS }}/${{ env.GEM_FILE_NAME }}.sig | ||||||||||||||||||
|
||||||||||||||||||
- name: Publish the gem | ||||||||||||||||||
uses: rubygems/release-gem@v1 | ||||||||||||||||||
with: | ||||||||||||||||||
await-release: false | ||||||||||||||||||
dry_run: ${{ inputs.dry_run }} | ||||||||||||||||||
gem_name: mongo | ||||||||||||||||||
product_name: Ruby Driver | ||||||||||||||||||
product_id: mongodb-ruby-driver | ||||||||||||||||||
release_message_template: ${{ env.RELEASE_MESSAGE_TEMPLATE }} | ||||||||||||||||||
silk_asset_group: ${{ env.SILK_ASSET_GROUP }} |
Uh oh!
There was an error while loading. Please reload this page.