Skip to content

Commit

Permalink
feat: Add input to select the build configuration.
Browse files Browse the repository at this point in the history
  • Loading branch information
na2axl committed Oct 6, 2024
1 parent 375c31a commit d05566f
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
4 changes: 4 additions & 0 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ inputs:
description: 'The directory where to install the SDK'
required: false
default: './amplitude_audio'
config:
description: 'The build configuration to download. Either debug or release.'
required: true
default: 'debug'

outputs:
path:
Expand Down
2 changes: 1 addition & 1 deletion badges/coverage.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/index.js.map

Large diffs are not rendered by default.

10 changes: 7 additions & 3 deletions src/download.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import * as core from '@actions/core'
import * as tc from '@actions/tool-cache'
import * as path from 'path'

export async function download(
platforms: Platform[],
Expand Down Expand Up @@ -41,9 +42,12 @@ async function downloadNightly(platforms: Platform[]): Promise<void> {
artifact.expired === false
)

const buildConfig = core.getInput('config')

for (const platform of platforms) {
const artifact = artifacts.find(artifact =>
artifact.name.includes(platform)
const artifact = artifacts.find(
artifact =>
artifact.name.includes(platform) && artifact.name.includes(buildConfig)
)

if (artifact === undefined) {
Expand All @@ -63,6 +67,6 @@ async function downloadNightly(platforms: Platform[]): Promise<void> {
core.addPath(extractedFolder)
core.info(`Downloaded ${platform} nightly build to ${extractedFolder}`)

core.setOutput('path', extractedFolder)
core.setOutput('path', path.normalize(extractedFolder))
}
}

0 comments on commit d05566f

Please sign in to comment.