Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jar Maven Signing - GnuPG and sha256 #22217

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Conversation

idiskyle
Copy link
Contributor

Description

Jar maven signing:

  • GnuPG
  • sha256.

Jar packages artifacts:

  • onnxruntime-android-full-aar
  • onnxruntime-java
  • onnxruntime-java-gpu

Motivation and Context

Previously, it is manually signed.
Goal: make it automatically.

@idiskyle idiskyle requested a review from a team as a code owner September 25, 2024 09:28
workingDirectory: '$(Build.BinariesDirectory)'
script: |
#!/bin/bash

Copy link
Member

@snnn snnn Sep 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add

set  -x

to the beginning of the script. Otherwise if any of the command failed we wouldn't know.

inputs:
targetType: 'inline'
workingDirectory: '$(Build.BinariesDirectory)'
script: |
Copy link
Member

@snnn snnn Sep 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you move the content to a separate *.ps1 file, we have a pipeline that can do grammar check and static analysis on the file.

foreach ($file in $targeting_original_files) {
$file_path = Join-Path $jar_file_directory -ChildPath $file
Write-Host "GnuPG signing to file: "$file_path
& $gpg_exe_path --pinentry-mode loopback --passphrase-file $passphrase_file -ab $file_path
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For all such external commands, you need to check their exit code. Like:

if ($lastExitCode -ne 0) {
      Write-Host -Object "xxx command failed. Exitcode: $exitCode"
      exit $lastExitCode
 }

See https://github.com/microsoft/onnxruntime/blob/main/tools/ci_build/github/windows/helpers.ps1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants