RimacTechnology / semantic-release-s3

semantic-release plugin to push files and folders to AWS S3 bucket
MIT License
2 stars 1 forks source link

directoryPath not found. #22

Open nyan-left opened 2 months ago

nyan-left commented 2 months ago

Issues

semantic-release-s3 Version You Are Using

2.4.1-beta.2

Your Config

        [
          "@rimac-technology/semantic-release-s3",
          {
            "s3Bucket": {
              "main": "my-docs/prod",
              "beta": "my-docs/beta",
            },
            "directoryPath": "docs/**/*",
            "objectACL": "public-read",
            "removeDirectoryRoot": true,
          }
        ]

Steps to reproduce

Expected behavior

The plugin correctly finds my directory and uploads it to s3.

Actual behavior

The plugin fails to find directoryPath. I've switched over to beta branch, get the following logs:

Publish step start
Initializing AWS S3...
Found file paths: []

I have confirmed that the docs directory exists at the root of my project and contains files.

Requirements

nyan-left commented 2 months ago

Update: I fixed this by tweaking my directoryPath:

"directoryPath": "../../docs/**/*",

(monorepo setup)

This does however break removeDirectoryRoot. In addition, it seems that my bucket directories are being ignored:

    "s3Bucket": {
              "main": "my-docs/prod",
              "beta": "my-docs/beta",
            },

Files get uploaded to mydocs/docs instead of mydocs/prod.

I suspect making use of cwd would fix the pathing issues. https://github.com/semantic-release/semantic-release/blob/master/docs/developer-guide/plugin.md#context-object-keys-by-lifecycle