Skip to content

Commit

Permalink
Added new input variable to set artifact name (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
matteodanelli authored and trapacska committed Jun 11, 2019
1 parent 8b297cc commit 13c55ee
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
6 changes: 6 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ type ConfigsModel struct {
KeystoreAlias string
PrivateKeyPassword string
JarsignerOptions string
OutputName string
}

func splitElements(list []string, sep string) (s []string) {
Expand Down Expand Up @@ -73,6 +74,7 @@ func createConfigsModelFromEnvs() ConfigsModel {
KeystoreAlias: os.Getenv("keystore_alias"),
PrivateKeyPassword: os.Getenv("private_key_password"),
JarsignerOptions: os.Getenv("jarsigner_options"),
OutputName: os.Getenv("output_name"),
}

if val := os.Getenv("apk_path"); val != "" {
Expand All @@ -92,6 +94,7 @@ func (configs ConfigsModel) print() {
log.Printf(" - KeystoreAlias: %s", configs.KeystoreAlias)
log.Printf(" - PrivateKeyPassword: %s", secureInput(configs.PrivateKeyPassword))
log.Printf(" - JarsignerOptions: %s", configs.JarsignerOptions)
log.Printf(" - OutputName: %s", configs.OutputName)
fmt.Println()
}

Expand Down Expand Up @@ -430,6 +433,9 @@ func main() {

log.Infof("Zipalign Build Artifact")
signedArtifactName := fmt.Sprintf("%s-bitrise-signed%s", buildArtifactBasename, artifactExt)
if configs.OutputName != "" {
signedArtifactName = fmt.Sprintf("%s%s", configs.OutputName, artifactExt)
}
fullPath := filepath.Join(buildArtifactDir, signedArtifactName)

if artifactExt == ".aab" {
Expand Down
8 changes: 8 additions & 0 deletions step.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,14 @@ inputs:
summary: ""
description: |
__deprecated!__ jarsigner options are detected from the keystore
- output_name: ""
opts:
title: "Artifact name"
summary: 'Name of the produced output artifact'
is_sensitive: false
description: |
If is empty then the output name is "app-release-bitrise-signed".
Else it's the specified name. Do not add extensione here.
outputs:
- BITRISE_SIGNED_APK_PATH:
opts:
Expand Down

0 comments on commit 13c55ee

Please sign in to comment.