1
0
mirror of https://github.com/goreleaser/goreleaser.git synced 2025-03-05 14:55:19 +02:00

feat: allow to template apk keyname ()

To help solve this issue
```
    apk:
      signature:
        key_file: "{{ .Env.ABUILD_KEY_NAME }}.rsa"
        key_name: "{{ .Env.ABUILD_KEY_NAME }}"
```

<!--

Hi, thanks for contributing!

Please make sure you read our CONTRIBUTING guide.

Also, add tests and the respective documentation changes as well.

-->


<!-- If applied, this commit will... -->

Allow that the key_name in apk signature to be templated

<!-- Why is this change being made? -->

The name of the key might not be hardcoded, in a github workflow

<!-- # Provide links to any relevant tickets, URLs or other resources
-->

...
This commit is contained in:
Kalle Møller 2023-01-11 13:10:31 +01:00 committed by GitHub
parent 3fd95e1737
commit 1b7dd258ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -212,6 +212,11 @@ func create(ctx *context.Context, fpm config.NFPM, format string, binaries []*ar
if err != nil {
return err
}
apkKeyName, err := t.Apply(overridden.APK.Signature.KeyName)
if err != nil {
return err
}
contents := files.Contents{}
for _, content := range overridden.Contents {
@ -353,7 +358,7 @@ func create(ctx *context.Context, fpm config.NFPM, format string, binaries []*ar
KeyFile: apkKeyFile,
KeyPassphrase: getPassphraseFromEnv(ctx, "APK", fpm.ID),
},
KeyName: overridden.APK.Signature.KeyName,
KeyName: apkKeyName,
},
Scripts: nfpm.APKScripts{
PreUpgrade: overridden.APK.Scripts.PreUpgrade,