Skip to content

Commit

Permalink
feat(publisher-s3): add keyResolver option to allow users to make the…
Browse files Browse the repository at this point in the history
…ir own S3 key path

Fixes #374
  • Loading branch information
MarshallOfSound committed Apr 16, 2018
1 parent 1d976bb commit 0ea9d3b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/publisher/s3/src/PublisherS3.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ AWS.util.update(AWS.S3.prototype, {
export default class PublisherS3 extends PublisherBase {
name = 's3';

async publish({ makeResults, packageJSON, tag }) {
async publish({ makeResults, packageJSON, tag, platform, arch }) {
const { config } = this;

const artifacts = makeResults.reduce((flat, makeResult) => {
Expand Down Expand Up @@ -62,7 +62,9 @@ export default class PublisherS3 extends PublisherBase {
localFile: artifactPath,
s3Params: {
Bucket: config.bucket,
Key: `${folder}/${path.basename(artifactPath)}`,
Key: this.config.keyResolver
? this.config.keyResolver(path.basename(artifactPath), platform, arch)
: `${folder}/${path.basename(artifactPath)}`,
ACL: config.public ? 'public-read' : 'private',
},
});
Expand Down

0 comments on commit 0ea9d3b

Please sign in to comment.