55
66This repository contains GitHub Actions that are common to drivers.
77
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+
830# # Signing tools
931
1032The actions in the `garasign` folder are used to sign artifacts using the team's
@@ -15,78 +37,119 @@ GPG key.
1537Use this action to create signed git artifacts :
1638
1739` ` ` 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
2042 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+ ...
3744
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+ ` ` `
4051
4152# ## gpg-sign
4253
4354This action is used to create detached signatures for files :
4455
4556` ` ` 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
4864 with:
4965 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 }}
5466` ` `
5567
5668The action will create a signature file `somefile.ext.sig` in the working
5769directory.
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.
6070
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 :
6272
6373` ` ` 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
6681 with:
6782 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 }}
7283` ` `
7384
7485# # Reporting tools
7586
7687The following tools are meant to aid in generating Software Security Development Lifecycle
7788reports associated with a product release.
7889
79- # ## Papertrail
90+ # ## Authorized Publication
8091
8192This 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`
8394
8495` ` ` 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
87103 with:
88104 product_name: Mongo Python Driver
89105 release_version: ${{ github.ref_name }}
90106 filenames: dist/*
91107 token: ${{ github.token }}
92108` ` `
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