5
5
6
6
This repository contains GitHub Actions that are common to drivers.
7
7
8
+ ## Setup
9
+
10
+ There is a common setup action that is meant to be run before all
11
+ other actions. It handles fetching secrets from AWS Secrets Manager,
12
+ signing into Artifactory, setting up Garasign credentials, and
13
+ setting up environment variables used in other actions.
14
+ The action requires ` id-token: write ` permissions.
15
+
16
+ ``` yaml
17
+ - name : setup
18
+ uses : mongodb/drivers-github-tools/setup@v2
19
+ with :
20
+ aws_role_arn : ${{ secrets.AWS_ROLE_ARN }}
21
+ aws_region_name : ${{ vars.AWS_REGION_NAME }}
22
+ aws_secret_id : ${{ secrets.AWS_SECRET_ID }}
23
+ ` ` `
24
+
25
+ > [!Note]
26
+ > You *must* use the ` actions/checkout` action prior to calling the `setup` action,
27
+ > Since the `setup` action sets up git config that would be overridden by the
28
+ > `actions/checkout action`
29
+
8
30
# # Signing tools
9
31
10
32
The actions in the `garasign` folder are used to sign artifacts using the team's
@@ -15,78 +37,119 @@ GPG key.
15
37
Use this action to create signed git artifacts :
16
38
17
39
` ` ` yaml
18
- - name : " Create signed commit "
19
- uses : mongodb/drivers-github-tools/garasign/git-sign@main
40
+ - name: Setup
41
+ uses: mongodb/drivers-github-tools/setup@v2
20
42
with:
21
- command : " git commit -m 'Commit' -s --gpg-sign=${{ vars.GPG_KEY_ID }}"
22
- garasign_username : ${{ secrets.GRS_CONFIG_USER1_USERNAME }}
23
- garasign_password : ${{ secrets.GRS_CONFIG_USER1_PASSWORD }}
24
- artifactory_username : ${{ secrets.ARTIFACTORY_USER }}
25
- artifactory_password : ${{ secrets.ARTIFACTORY_PASSWORD }}
26
-
27
- - name : " Create signed tag"
28
- uses : mongodb/drivers-github-tools/garasign/git-sign@main
29
- with :
30
- command : " git tag -m 'Tag' -s --local-user=${{ vars.GPG_KEY_ID }} <tag>"
31
- garasign_username : ${{ secrets.GRS_CONFIG_USER1_USERNAME }}
32
- garasign_password : ${{ secrets.GRS_CONFIG_USER1_PASSWORD }}
33
- artifactory_username : ${{ secrets.ARTIFACTORY_USER }}
34
- artifactory_password : ${{ secrets.ARTIFACTORY_PASSWORD }}
35
- skip_setup : true
36
- ` ` `
43
+ ...
37
44
38
- If the action is used multiple times within the same job, the ` skip_setup`
39
- option can be set to a truthy value to avoid unnecessary logins to artifactory.
45
+ - name: Create signed commit
46
+ uses: mongodb/drivers-github-tools/git-sign@v2
47
+
48
+ - name: Create signed tag
49
+ uses: mongodb/drivers-github-tools/git-sign@v2
50
+ ` ` `
40
51
41
52
# ## gpg-sign
42
53
43
54
This action is used to create detached signatures for files :
44
55
45
56
` ` ` yaml
46
- - name: "Create detached signature"
47
- uses: mongodb/drivers-github-tools/garasign/gpg-sign@main
57
+ - name: Setup
58
+ uses: mongodb/drivers-github-tools/setup@v2
59
+ with:
60
+ ...
61
+
62
+ - name: Create detached signature
63
+ uses: mongodb/drivers-github-tools/gpg-sign@v2
48
64
with:
49
65
filenames: somefile.ext
50
- garasign_username: ${{ secrets.GRS_CONFIG_USER1_USERNAME }}
51
- garasign_password: ${{ secrets.GRS_CONFIG_USER1_PASSWORD }}
52
- artifactory_username: ${{ secrets.ARTIFACTORY_USER }}
53
- artifactory_password: ${{ secrets.ARTIFACTORY_PASSWORD }}
54
66
` ` `
55
67
56
68
The action will create a signature file `somefile.ext.sig` in the working
57
69
directory.
58
- If the action is used multiple times within the same job, the `skip_setup`
59
- option can be set to a truthy value to avoid unnecessary logins to artifactory.
60
70
61
- You can also supply multiple space-separated filenames to sign a list of files :
71
+ You can also supply a glob pattern to sign a group of files :
62
72
63
73
` ` ` yaml
64
- - name: "Create detached signature"
65
- uses: mongodb/drivers-github-tools/garasign/gpg-sign@main
74
+ - name: Setup
75
+ uses: mongodb/drivers-github-tools/setup@v2
76
+ with:
77
+ ...
78
+
79
+ - name: Create detached signature
80
+ uses: mongodb/drivers-github-tools/garasign/gpg-sign@v1
66
81
with:
67
82
filenames: dist/*
68
- garasign_username: ${{ secrets.GRS_CONFIG_USER1_USERNAME }}
69
- garasign_password: ${{ secrets.GRS_CONFIG_USER1_PASSWORD }}
70
- artifactory_username: ${{ secrets.ARTIFACTORY_USER }}
71
- artifactory_password: ${{ secrets.ARTIFACTORY_PASSWORD }}
72
83
` ` `
73
84
74
85
# # Reporting tools
75
86
76
87
The following tools are meant to aid in generating Software Security Development Lifecycle
77
88
reports associated with a product release.
78
89
79
- # ## Papertrail
90
+ # ## Authorized Publication
80
91
81
92
This action will create a record of authorized publication on distribution channels.
82
- By default it will create a "papertrail.txt" file in the current directory.
93
+ It will create the file `$S3_ASSETS/authorized_publication.txt`
83
94
84
95
` ` ` yaml
85
- - name: "Create papertrail report"
86
- uses: mongodb/drivers-github-tools/papertrail@main
96
+ - name: Setup
97
+ uses: mongodb/drivers-github-tools/setup@v2
98
+ with:
99
+ ...
100
+
101
+ - name: Create Authorized Publication Report
102
+ uses: mongodb/drivers-github-tools/authorized-pub@v2
87
103
with:
88
104
product_name: Mongo Python Driver
89
105
release_version: ${{ github.ref_name }}
90
106
filenames: dist/*
91
107
token: ${{ github.token }}
92
108
` ` `
109
+
110
+ # # Python Helper Scripts
111
+
112
+ These scripts are opinionated helper scripts for Python releases.
113
+
114
+ # ## Bump and Tag
115
+
116
+ Bump the version and create a new tag. Verify the tag.
117
+ Push the commit and tag to the source branch unless `dry_run` is set.
118
+
119
+ ` ` ` yaml
120
+ - name: Setup
121
+ uses: mongodb/drivers-github-tools/setup@v2
122
+ with:
123
+ ...
124
+
125
+ - uses: mongodb/drivers-github-tools/python/bump-and-tag@v2
126
+ with:
127
+ version: ${{ inputs.version }}
128
+ version_bump_script: ./.github/scripts/bump-version.sh
129
+ dry_run: ${{ inputs.dry_run }}
130
+ ` ` `
131
+
132
+ # ## Publish
133
+
134
+ Handles tasks related to publishing Python packages, including
135
+ signing `dist` file and publishing the `dist` files to PyPI.
136
+ It will also push the following (dev) version to the source branch.
137
+ It will create a draft GitHub release and attach the signature files.
138
+ Finally, it will publish a report to the appropriate S3 bucket.
139
+ If `dry_run` is set, nothing will be published or pushed.
140
+
141
+ ` ` ` yaml
142
+ - name: Setup
143
+ uses: mongodb/drivers-github-tools/setup@v2
144
+ with:
145
+ ...
146
+
147
+ - uses: mongodb-labs/drivers-github-tools/python/publish@v2
148
+ with:
149
+ version: ${{ inputs.version }}
150
+ following_version: ${{ inputs.following_version }}
151
+ version_bump_script: ./.github/scripts/bump-version.sh
152
+ product_name: winkerberos
153
+ token: ${{ github.token }}
154
+ dry_run: ${{ inputs.dry_run }}
155
+ ` ` `
0 commit comments