-
Notifications
You must be signed in to change notification settings - Fork 530
86 lines (76 loc) · 2.31 KB
/
release.yml
File metadata and controls
86 lines (76 loc) · 2.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
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:
pr:
description: "The number of the merged release candidate PR"
required: true
env:
GEM_NAME: mongo
PRODUCT_NAME: Ruby Driver
PRODUCT_ID: mongodb-ruby-driver
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
pull-requests: read
contents: write
# required by the mongodb-labs/drivers-github-tools/setup@v2 step
# also required by `rubygems/release-gem`
id-token: write
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: mongodb-labs/drivers-github-tools/ruby/pr-check@v3
build:
name: "Build Gems"
needs: check
environment: release
runs-on: ubuntu-latest
steps:
- name: "Run the build action"
uses: mongodb-labs/drivers-github-tools/ruby/build@v3
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 }}
publish:
name: "Publish Gems"
needs: [ check, build ]
environment: release
runs-on: 'ubuntu-latest'
steps:
- name: "Run the publish action"
uses: mongodb-labs/drivers-github-tools/ruby/publish@v3
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: false
gem_name: ${{ env.GEM_NAME }}
product_name: ${{ env.PRODUCT_NAME }}
product_id: ${{ env.PRODUCT_ID }}
release_message: ${{ needs.check.outputs.message }}
ref: ${{ needs.check.outputs.ref }}