Skip to content

Commit c3c7739

Browse files
address comments except for env
1 parent 2f3357e commit c3c7739

File tree

3 files changed

+19
-18
lines changed

3 files changed

+19
-18
lines changed

node/generate_release.js renamed to node/generate_release.mjs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
const { readFileSync } = require("fs");
2-
const { join } = require("path");
1+
import { readFileSync } from 'node:fs';
2+
import { join, dirname } from 'node:path';
3+
import { fileURLToPath } from 'node:url';
4+
5+
const __dirname = dirname(fileURLToPath(import.meta.url));
36

47
const args = process.argv.slice(2);
58
if (!(args.length === 3 || args.length === 4)) {
@@ -9,10 +12,10 @@ if (!(args.length === 3 || args.length === 4)) {
912
process.exit(1);
1013
}
1114

12-
const [package, branch, tag, assetGroup] = args;
15+
const [npmPackage, branch, tag, assetGroup] = args;
1316

1417
const isNative =
15-
package === "kerberos" || package === "mongodb-client-encryption";
18+
npmPackage === "kerberos" || npmPackage === "mongodb-client-encryption";
1619
const template = readFileSync(
1720
join(__dirname, "./release_template.yml"),
1821
"utf-8",
@@ -25,13 +28,13 @@ const EVERGREEN_PROJECTS = {
2528

2629
const generated = template
2730
.replaceAll("RELEASE_BRANCH", branch)
28-
.replaceAll("RELEASE_PACKAGE", package)
31+
.replaceAll("RELEASE_PACKAGE", npmPackage)
2932
.replaceAll("RELEASE_TAG", tag)
30-
.replaceAll("EVERGREEN_PROJECT", EVERGREEN_PROJECTS[package] ?? "")
33+
.replaceAll("EVERGREEN_PROJECT", EVERGREEN_PROJECTS[npmPackage] ?? "")
3134
.replaceAll("IGNORE_INSTALL_SCRIPTS", isNative)
3235
.replaceAll("SILK_ASSET_GROUP", assetGroup ?? "''");
3336

34-
const project = EVERGREEN_PROJECTS[package];
37+
const project = EVERGREEN_PROJECTS[npmPackage];
3538
if (!project) {
3639
const final = generated
3740
.split("\n")

node/release_template.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,15 +59,15 @@ jobs:
5959

6060
- name: Copy sbom file to release assets
6161
shell: bash
62-
if: ${{ SILK_ASSET_GROUP == '' }}
62+
if: ${{ 'SILK_ASSET_GROUP' == '' }}
6363
run: cp sbom.json ${{ env.S3_ASSETS }}/sbom.json
6464

6565
# only used for mongodb-client-encryption
6666
- name: Augment SBOM and copy to release assets
67-
if: ${{ SILK_ASSET_GROUP != '' }}
67+
if: ${{ 'SILK_ASSET_GROUP' != '' }}
6868
uses: mongodb-labs/drivers-github-tools/sbom@v2
6969
with:
70-
silk_asset_group: ${{ SILK_ASSET_GROUP }}
70+
silk_asset_group: SILK_ASSET_GROUP
7171
sbom_file_name: sbom.json
7272

7373
- name: Generate authorized pub report

node/sign_node_package/action.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ inputs:
1717
dry_run:
1818
description: "Should we upload files to the release?"
1919
required: false
20-
default: "true"
20+
default: "false"
2121
artifact_directory:
2222
description: The directory in which to output signatures.
2323
default: artifacts
@@ -50,7 +50,7 @@ runs:
5050
aws_role_arn: ${{ inputs.aws_role_arn }}
5151
aws_secret_id: ${{ inputs.aws_secret_id }}
5252

53-
- name: Determine what files to sign
53+
- name: Determine what files to sign (native packages, works with glob patterns of build artifacts)
5454
if: ${{ inputs.sign_native == 'true' }}
5555
shell: bash
5656
run: |
@@ -61,7 +61,7 @@ runs:
6161
FILENAMES="$FILENAMES ${{ env.package_file }}"
6262
echo "FILES_TO_SIGN=${FILENAMES}" >> "$GITHUB_ENV"
6363
64-
- name: Determine what files to sign
64+
- name: Determine what files to sign (non-native packages, with only the release tarball)
6565
if: ${{ inputs.sign_native != 'true' }}
6666
shell: bash
6767
run: |
@@ -77,11 +77,9 @@ runs:
7777

7878
- name: Copy the tarballs to the artifacts directory
7979
shell: bash
80-
run: for filename in ${{ env.FILES_TO_SIGN }}; do cp ${filename} artifacts/; done
81-
82-
- name: Display structure of downloaded files
83-
shell: bash
84-
run: ls -la artifacts/
80+
run: |
81+
for filename in ${{ env.FILES_TO_SIGN }}; do cp ${filename} artifacts/; done
82+
ls -la artifacts/
8583
8684
- name: "Upload release artifacts"
8785
if: ${{ inputs.dry_run == false }}

0 commit comments

Comments
 (0)