Skip to content

Commit b03533f

Browse files
authored
chore(ci): sign using package (#678)
1 parent 4606982 commit b03533f

File tree

5 files changed

+84
-49
lines changed

5 files changed

+84
-49
lines changed

.github/workflows/actions/test-and-build/action.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,18 @@ runs:
8989
- name: Sign .vsix
9090
if: runner.os == 'Linux'
9191
env:
92-
ARTIFACTORY_HOST: ${{ inputs.ARTIFACTORY_HOST }}
9392
ARTIFACTORY_PASSWORD: ${{ inputs.ARTIFACTORY_PASSWORD }}
9493
ARTIFACTORY_USERNAME: ${{ inputs.ARTIFACTORY_USERNAME }}
9594
GARASIGN_PASSWORD: ${{ inputs.GARASIGN_PASSWORD }}
9695
GARASIGN_USERNAME: ${{ inputs.GARASIGN_USERNAME }}
9796
run: |
98-
bash scripts/sign-vsix.sh
97+
set -e
98+
FILE_TO_SIGN=$(find . -maxdepth 1 -name '*.vsix' -print -quit)
99+
if [ -z "$FILE_TO_SIGN" ]; then
100+
echo "Error: No .vsix file found in the current directory." >&2
101+
exit 1
102+
fi
103+
node scripts/sign-vsix.js "${FILE_TO_SIGN}"
99104
ls *.vsix.sig
100105
shell: bash
101106

package-lock.json

Lines changed: 63 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1117,6 +1117,7 @@
11171117
"@mongodb-js/oidc-plugin": "^0.3.0",
11181118
"@mongodb-js/prettier-config-devtools": "^1.0.1",
11191119
"@mongodb-js/sbom-tools": "^0.5.4",
1120+
"@mongodb-js/signing-utils": "^0.3.1",
11201121
"@mongosh/service-provider-core": "^2.0.2",
11211122
"@testing-library/react": "^12.1.5",
11221123
"@types/babel__core": "^7.20.1",

scripts/sign-vsix.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
const { sign } = require('@mongodb-js/signing-utils');
2+
3+
(async () => {
4+
const file = process.argv[2];
5+
if (!file) {
6+
throw new Error('File is required.');
7+
}
8+
console.log(`Signing vsix: ${file}`);
9+
await sign(file, {
10+
client: 'local',
11+
signingMethod: 'gpg',
12+
});
13+
})();

scripts/sign-vsix.sh

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

0 commit comments

Comments
 (0)