Skip to content

Commit 0b3f219

Browse files
committed
Merge branch 'jamis-3505-ssdlc-2.1' into 2.1-stable
2 parents 626963d + 7f0d4a3 commit 0b3f219

File tree

16 files changed

+459
-167
lines changed

16 files changed

+459
-167
lines changed

.github/workflows/cleanup.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: "Dry-Run Cleanup"
2+
run-name: "Dry Run Cleanup for ${{ github.ref }}"
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
confirm:
8+
description: Indicate whether you want this workflow to run (must be "true")
9+
required: true
10+
type: string
11+
tag:
12+
description: The name of the tag (and release) to clean up
13+
required: true
14+
type: string
15+
16+
jobs:
17+
release:
18+
name: "Dry-Run Cleanup"
19+
environment: release
20+
runs-on: 'ubuntu-latest'
21+
if: ${{ inputs.confirm == 'true' }}
22+
23+
permissions:
24+
# required for all workflows
25+
security-events: write
26+
27+
# required to fetch internal or private CodeQL packs
28+
packages: read
29+
30+
# only required for workflows in private repositories
31+
actions: read
32+
contents: write
33+
34+
# required by the mongodb-labs/drivers-github-tools/setup@v2 step
35+
# also required by `rubygems/release-gem`
36+
id-token: write
37+
38+
steps:
39+
- name: "Run the cleanup action"
40+
uses: mongodb-labs/drivers-github-tools/ruby/cleanup@v2
41+
with:
42+
app_id: ${{ vars.APP_ID }}
43+
app_private_key: ${{ secrets.APP_PRIVATE_KEY }}
44+
tag: ${{ inputs.tag }}

.github/workflows/codeql.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: "CodeQL"
2+
3+
on: [ push, pull_request ]
4+
5+
jobs:
6+
analyze:
7+
name: Analyze (${{ matrix.language }})
8+
runs-on: 'ubuntu-latest'
9+
timeout-minutes: 360
10+
permissions:
11+
# required for all workflows
12+
security-events: write
13+
14+
# required to fetch internal or private CodeQL packs
15+
packages: read
16+
17+
# only required for workflows in private repositories
18+
actions: read
19+
contents: read
20+
21+
strategy:
22+
fail-fast: false
23+
matrix:
24+
include:
25+
- language: ruby
26+
build-mode: none
27+
- language: c
28+
build-mode: manual
29+
- language: java
30+
build-mode: none
31+
steps:
32+
- name: Checkout repository
33+
uses: actions/checkout@v4
34+
35+
# Initializes the CodeQL tools for scanning.
36+
- name: Initialize CodeQL
37+
uses: github/codeql-action/init@v3
38+
with:
39+
languages: ${{ matrix.language }}
40+
build-mode: ${{ matrix.build-mode }}
41+
config: |
42+
paths-ignore:
43+
- spec
44+
- tmp
45+
46+
- name: Setup Ruby
47+
if: matrix.build-mode == 'manual'
48+
uses: ruby/setup-ruby@v1
49+
with:
50+
ruby-version: '3.2'
51+
bundler-cache: true
52+
53+
- name: Install libsasl
54+
if: matrix.build-mode == 'manual'
55+
shell: bash
56+
run: sudo apt-get -y install libsasl2-dev
57+
58+
- name: Manually build the native code
59+
if: matrix.build-mode == 'manual'
60+
shell: bash
61+
run: bundle exec rake compile
62+
63+
- name: Perform CodeQL Analysis
64+
uses: github/codeql-action/analyze@v3
65+
with:
66+
category: "/language:${{matrix.language}}"
67+

.github/workflows/release.yml

Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
name: "Release"
2+
run-name: "Release for ${{ github.ref }}"
3+
4+
on:
5+
workflow_dispatch:
6+
inputs:
7+
dry_run:
8+
description: Is this a dry run?
9+
required: true
10+
default: true
11+
type: boolean
12+
13+
env:
14+
RELEASE_MESSAGE_TEMPLATE: |
15+
Version {0} of [Ruby Kerberos Authentication for MongoDB](https://rubygems.org/gems/mongo_kerberos) is now available.
16+
17+
**Release Highlights**
18+
19+
TODO: one or more paragraphs describing important changes in this release
20+
21+
**Installation**
22+
23+
You may install this version via RubyGems, with:
24+
25+
gem install --version {0} mongo_kerberos
26+
27+
permissions:
28+
# required for all workflows
29+
security-events: write
30+
31+
# required to fetch internal or private CodeQL packs
32+
packages: read
33+
34+
# only required for workflows in private repositories
35+
actions: read
36+
contents: write
37+
38+
# required by the mongodb-labs/drivers-github-tools/setup@v2 step
39+
# also required by `rubygems/release-gem`
40+
id-token: write
41+
42+
jobs:
43+
build:
44+
name: "Build Gems"
45+
runs-on: ubuntu-latest
46+
strategy:
47+
fail-fast: false
48+
matrix:
49+
ruby: [ '3.2', jruby ]
50+
steps:
51+
- name: Check out the repository
52+
uses: actions/checkout@v4
53+
54+
- name: Setup Ruby
55+
uses: ruby/setup-ruby@v1
56+
with:
57+
ruby-version: ${{ matrix.ruby }}
58+
bundler-cache: true
59+
60+
- name: Set output gem file name
61+
shell: bash
62+
run: |
63+
echo "GEM_FILE_NAME=$(bundle exec rake gem_file_name)" >> "$GITHUB_ENV"
64+
65+
- name: Build the gem
66+
shell: bash
67+
run: bundle exec rake build
68+
69+
- name: Save the generated gem file for later
70+
uses: actions/upload-artifact@v4
71+
with:
72+
name: ${{ env.GEM_FILE_NAME }}
73+
path: ${{ env.GEM_FILE_NAME }}
74+
retention-days: 1
75+
overwrite: true
76+
77+
publish:
78+
name: Publish Gems
79+
needs: build
80+
environment: release
81+
runs-on: ubuntu-latest
82+
steps:
83+
- name: Check out the repository
84+
uses: mongodb-labs/drivers-github-tools/secure-checkout@v2
85+
with:
86+
app_id: ${{ vars.APP_ID }}
87+
private_key: ${{ secrets.APP_PRIVATE_KEY }}
88+
89+
- name: Setup Ruby
90+
uses: ruby/setup-ruby@v1
91+
with:
92+
ruby-version: '3.2'
93+
bundler-cache: true
94+
95+
- name: Get the release version
96+
shell: bash
97+
run: echo "RELEASE_VERSION=$(bundle exec rake version)" >> "$GITHUB_ENV"
98+
99+
- name: Setup GitHub tooling for DBX Drivers
100+
uses: mongodb-labs/drivers-github-tools/setup@v2
101+
with:
102+
aws_role_arn: ${{ secrets.AWS_ROLE_ARN }}
103+
aws_region_name: ${{ vars.AWS_REGION_NAME }}
104+
aws_secret_id: ${{ secrets.AWS_SECRET_ID }}
105+
106+
- name: Fetch the gem artifacts
107+
uses: actions/download-artifact@v4
108+
with:
109+
merge-multiple: true
110+
111+
- name: Sign the gems
112+
uses: mongodb-labs/drivers-github-tools/gpg-sign@v2
113+
with:
114+
filenames: '*.gem'
115+
116+
- name: Generate SSDLC Reports
117+
uses: mongodb-labs/drivers-github-tools/full-report@v2
118+
with:
119+
product_name: Mongo Kerberos for Ruby
120+
release_version: ${{ env.RELEASE_VERSION }}
121+
dist_filenames: '*.gem'
122+
silk_asset_group: mongo-ruby-kerberos
123+
124+
- name: Create the tag
125+
uses: mongodb-labs/drivers-github-tools/tag-version@v2
126+
with:
127+
version: ${{ env.RELEASE_VERSION }}
128+
tag_template: "v${VERSION}"
129+
tag_message_template: "Release tag for v${VERSION}"
130+
131+
- name: Create a new release
132+
shell: bash
133+
run: gh release create v${{ env.RELEASE_VERSION }} --title ${{ env.RELEASE_VERSION }} --generate-notes --draft
134+
135+
- name: Capture the changelog
136+
shell: bash
137+
run: gh release view v${{ env.RELEASE_VERSION }} --json body --template '{{ .body }}' >> changelog
138+
139+
- name: Prepare release message
140+
shell: bash
141+
run: |
142+
echo "${{ format(env.RELEASE_MESSAGE_TEMPLATE, env.RELEASE_VERSION) }}" > release-message
143+
cat changelog >> release-message
144+
145+
- name: Update release information
146+
shell: bash
147+
run: |
148+
echo "RELEASE_URL=$(gh release edit v${{ env.RELEASE_VERSION }} --notes-file release-message)" >> "$GITHUB_ENV"
149+
150+
- name: Upload release artifacts
151+
shell: bash
152+
run: gh release upload v${{ env.RELEASE_VERSION }} *.gem ${{ env.RELEASE_ASSETS }}/*.sig
153+
154+
- name: Upload S3 assets
155+
uses: mongodb-labs/drivers-github-tools/upload-s3-assets@v2
156+
with:
157+
version: ${{ env.RELEASE_VERSION }}
158+
product_name: mongo-ruby-kerberos
159+
dry_run: ${{ inputs.dry_run }}
160+
161+
- name: Publish the gems
162+
uses: rubygems/release-gem@v1
163+
if: inputs.dry_run == 'false'
164+
with:
165+
await-release: false

.github/workflows/test.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: CI
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
build:
7+
name: >-
8+
ruby:${{ matrix.ruby }}
9+
env:
10+
CI: true
11+
TESTOPTS: -v
12+
13+
runs-on: ${{ matrix.os }}-latest
14+
if: |
15+
!( contains(github.event.pull_request.title, '[ci skip]')
16+
|| contains(github.event.pull_request.title, '[skip ci]')
17+
|| contains(github.event.head_commit.message, '[ci skip]')
18+
|| contains(github.event.head_commit.message, '[skip ci]'))
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
os: [ ubuntu ]
23+
ruby: [ 2.7, 3.0, 3.1, 3.2, 3.3, jruby-9.3, jruby-9.4 ]
24+
25+
steps:
26+
- name: Checkout the repository
27+
uses: actions/checkout@v4
28+
29+
- name: Setup Ruby
30+
uses: ruby/setup-ruby@v1
31+
with:
32+
ruby-version: ${{ matrix.ruby }}
33+
bundler-cache: true
34+
35+
- name: Install libsasl
36+
shell: bash
37+
run: sudo apt-get -y install libsasl2-dev
38+
39+
- name: Run the tests
40+
timeout-minutes: 10
41+
shell: bash
42+
run: bundle exec rake spec

.travis.yml

Lines changed: 0 additions & 30 deletions
This file was deleted.

Gemfile

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,4 @@ gem 'yard'
88
group :development, :test do
99
gem 'rspec'
1010
gem 'rake-compiler'
11-
12-
if ENV['CI']
13-
gem 'coveralls', :require => false
14-
gem 'mime-types', '1.25' # v2.0+ does not supporty ruby 1.8
15-
else
16-
gem 'ruby-prof', :platforms => :mri
17-
gem 'pry'
18-
gem 'guard-rspec', :platforms => [ :ruby_19, :ruby_24, :ruby_25 ]
19-
gem 'rb-inotify', :require => false # Linux
20-
gem 'rb-fsevent', :require => false # OS X
21-
gem 'rb-fchange', :require => false # Windows
22-
gem 'terminal-notifier-guard'
23-
end
2411
end

Guardfile

Lines changed: 0 additions & 9 deletions
This file was deleted.

0 commit comments

Comments
 (0)