diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..5ed37e5 --- /dev/null +++ b/.gitattributes @@ -0,0 +1 @@ +.devcontainer/** linguist-vendored diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index e5e3262..650060e 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -127,18 +127,17 @@ jobs: with: fetch-depth: 25 - - run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* + - name: Fetch git tags + run: git fetch --depth=1 origin +refs/tags/*:refs/tags/* - - name: Cache - uses: actions/cache@v2 + - name: Setup node + uses: actions/setup-node@v2 with: - path: | - .yarn - **/node_modules - key: e2e-${{ hashFiles('yarn.lock') }} + node-version: '14' + cache: 'yarn' - name: Install dependencies - run: yarn install --frozen-lockfile --check-files + run: yarn --frozen-lockfile - name: Download build artifact uses: actions/download-artifact@v2 @@ -146,4 +145,12 @@ jobs: name: lambda path: lib - - run: ./scripts/publish-release.sh + # git user is required (bot not used) by release-it + - name: Set git user to GitHub Actions + uses: fregante/setup-git-user@v1.0.1 + + - name: Set registry for publish + run: yarn config set registry https://registry.npmjs.org + + - name: Publish packages + run: ./scripts/publish-release.sh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 02e2501..fb97a67 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,6 +21,7 @@ jobs: release-branch: release release-tag: ${{ github.event.inputs.tag }} exclude: | + .devcontainer/**/* .vscode/**/* lib/**/* scripts/**/* diff --git a/CHANGELOG.md b/CHANGELOG.md index 106d9b3..6927a7d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,13 @@ # Changelog -## 12.0.1 (December 21, 2021) +## [Unreleased] + +## [12.0.2] - 2022-01-22 + +- Uses Image Optimizer module of [Next.js 12.0.2](https://github.com/vercel/next.js/releases/tag/v12.0.2) ([#101](https://github.com/milliHQ/terraform-aws-next-js-image-optimization/pull/101)) +- Use relative path as lambda function local package path ([#98](https://github.com/milliHQ/terraform-aws-next-js-image-optimization/pull/98)) + +## [12.0.1] (December 21, 2021) In this release we fixed a bug that could occur when using absolute image paths (When you use S3 as backend, you are not affected). In addition you can now define a new input variable `next_image_base_origin` that can be used to resolve absolute image paths. diff --git a/README.md b/README.md index 9367290..5aff29e 100644 --- a/README.md +++ b/README.md @@ -96,9 +96,9 @@ Then rebuild and redeploy your Next.js application to make use of the changed co ## Examples -- [Statically exported Next.js app hosted on S3](https://github.com/milliHQ/terraform-aws-next-js-image-optimization/tree/main/examples/with-next-js) +- [Statically exported Next.js app hosted on S3](https://github.com/milliHQ/terraform-aws-next-js-image-optimization/tree/main/examples/with-next-js-export) Use the image optimizer together with a statically exported Next.js app that is deployed to S3 and CloudFront. -- [Next.js + Vercel](https://github.com/milliHQ/terraform-aws-next-js-image-optimization/tree/main/examples/with-next-js-export) +- [Next.js + Vercel](https://github.com/milliHQ/terraform-aws-next-js-image-optimization/tree/main/examples/with-next-js) Use the image optimizer together with a Next.js app deployed on Vercel. - [Existing CloudFront](https://github.com/milliHQ/terraform-aws-next-js-image-optimization/tree/main/examples/with-existing-cloudfront) Use the image optimizer with an existing CloudFront distribution. @@ -140,7 +140,7 @@ Then rebuild and redeploy your Next.js application to make use of the changed co | next\_image\_domains | Allowed origin domains that can be used for fetching images. | `list(string)` | `[]` | no | | next\_image\_formats | If the Accept head matches more than one of the configured formats, the first match in the array is used. Therefore, the array order matters. If there is no match, the Image Optimization API will fallback to the original image's format. | `list(string)` |
[| no | | next\_image\_image\_sizes | Allowed image sizes that should be used for image optimization. | `list(number)` | `null` | no | -| next\_image\_version | Next.js version from where you want to use the image optimizer from. Supports semver ranges. | `string` | `"12.0.1"` | no | +| next\_image\_version | Next.js version from where you want to use the image optimizer from. Supports semver ranges. | `string` | `"12.0.2"` | no | | source\_bucket\_id | When your static files are deployed to a Bucket (e.g. with Terraform Next.js) the optimizer can pull the source from the bucket rather than over the internet. | `string` | `null` | no | | tags | Tag metadata to label AWS resources that support tags. | `map(string)` | `{}` | no | diff --git a/examples/with-next-js-export/README.md b/examples/with-next-js-export/README.md index a9891a1..06a49b2 100644 --- a/examples/with-next-js-export/README.md +++ b/examples/with-next-js-export/README.md @@ -59,17 +59,7 @@ After Terraform has successfully created all resources in your AWS account, you > website_bucket_id = "next-image-optimizer-example-export" ``` -### 3. Adjust Next.js config - -In the Next.js project, open the `next.config.js` file and add the following lines (Remember to replace `
"image/webp"
]