Skip to content

Commit

Permalink
Support the asset glob
Browse files Browse the repository at this point in the history
  • Loading branch information
Christian-Holbrook committed Feb 10, 2025
1 parent e93011e commit e0f9a22
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/create-release-artifacts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,4 +48,4 @@ jobs:
- name: Run upload
env:
GH_TOKEN: ${{ github.token }}
run: npx ts-node nested-ci/src/cli.ts upload-release --branch ${{ github.event.inputs.branch }}
run: npx ts-node nested-ci/src/cli.ts upload-release --branch ${{ github.event.inputs.branch }} --assetGlob ${{ github.event.inputs.asset-paths }}
4 changes: 2 additions & 2 deletions src/ReleaseCreator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ export class ReleaseCreator {
logger.decreaseIndent();
}

public async uploadRelease(options: { branch: string }) {
public async uploadRelease(options: { branch: string, assetsGlob: string }) {
logger.log(`Upload release... branch: ${options.branch}`);
logger.increaseIndent();

Expand Down Expand Up @@ -138,7 +138,7 @@ export class ReleaseCreator {
logger.decreaseIndent();

logger.log(`Get artifacts from the build`)
const artifacts = fastGlob.sync(`out/*`, { absolute: false })
const artifacts = fastGlob.sync(options.assetsGlob, { absolute: false })

logger.log(`Uploading artifacts`);
logger.increaseIndent();
Expand Down
1 change: 1 addition & 0 deletions src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ let options = yargs
.command('upload-release', 'Upload release artifacts to GitHub release', (builder) => {
return builder
.option('branch', { type: 'string', description: 'The branch the release is based on' })
.option('assetGlob', { type: 'string', description: 'The glob pattern used to get release artifact(s)' })
}, (argv) => {
new ReleaseCreator().uploadRelease(argv).catch(e => {
console.error(e);
Expand Down

0 comments on commit e0f9a22

Please sign in to comment.