diff --git a/.gitattributes b/.gitattributes index 937c0eb3..cc2e6573 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,2 +1,3 @@ /.yarn/releases/** binary /.yarn/plugins/** binary +/__tests__/fixtures/oci-archive/** binary diff --git a/.github/buildx-releases.json b/.github/buildx-releases.json index d0fb87d3..0784810f 100644 --- a/.github/buildx-releases.json +++ b/.github/buildx-releases.json @@ -40,6 +40,88 @@ "https://github.com/docker/buildx/releases/download/v0.14.1/checksums.txt" ] }, + "v0.15.0-rc2": { + "id": 159285616, + "tag_name": "v0.15.0-rc2", + "html_url": "https://github.com/docker/buildx/releases/tag/v0.15.0-rc2", + "assets": [ + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.darwin-amd64", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.darwin-amd64.provenance.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.darwin-amd64.sbom.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.darwin-arm64", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.darwin-arm64.provenance.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.darwin-arm64.sbom.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-amd64", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-amd64.provenance.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-amd64.sbom.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-arm-v6", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-arm-v6.provenance.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-arm-v6.sbom.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-arm-v7", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-arm-v7.provenance.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-arm-v7.sbom.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-arm64", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-arm64.provenance.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-arm64.sbom.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-ppc64le", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-ppc64le.provenance.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-ppc64le.sbom.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-riscv64", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-riscv64.provenance.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-riscv64.sbom.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-s390x", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-s390x.provenance.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.linux-s390x.sbom.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.windows-amd64.exe", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.windows-amd64.provenance.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.windows-amd64.sbom.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.windows-arm64.exe", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.windows-arm64.provenance.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/buildx-v0.15.0-rc2.windows-arm64.sbom.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc2/checksums.txt" + ] + }, + "v0.15.0-rc1": { + "id": 158684634, + "tag_name": "v0.15.0-rc1", + "html_url": "https://github.com/docker/buildx/releases/tag/v0.15.0-rc1", + "assets": [ + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.darwin-amd64", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.darwin-amd64.provenance.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.darwin-amd64.sbom.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.darwin-arm64", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.darwin-arm64.provenance.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.darwin-arm64.sbom.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-amd64", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-amd64.provenance.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-amd64.sbom.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-arm-v6", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-arm-v6.provenance.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-arm-v6.sbom.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-arm-v7", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-arm-v7.provenance.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-arm-v7.sbom.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-arm64", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-arm64.provenance.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-arm64.sbom.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-ppc64le", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-ppc64le.provenance.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-ppc64le.sbom.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-riscv64", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-riscv64.provenance.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-riscv64.sbom.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-s390x", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-s390x.provenance.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.linux-s390x.sbom.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.windows-amd64.exe", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.windows-amd64.provenance.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.windows-amd64.sbom.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.windows-arm64.exe", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.windows-arm64.provenance.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/buildx-v0.15.0-rc1.windows-arm64.sbom.json", + "https://github.com/docker/buildx/releases/download/v0.15.0-rc1/checksums.txt" + ] + }, "v0.14.1": { "id": 156924662, "tag_name": "v0.14.1", diff --git a/.github/docker-releases.json b/.github/docker-releases.json index bf2bfde2..061726de 100644 --- a/.github/docker-releases.json +++ b/.github/docker-releases.json @@ -1,8 +1,20 @@ { "latest": { - "id": 155867714, - "tag_name": "v26.1.3", - "html_url": "https://github.com/moby/moby/releases/tag/v26.1.3", + "id": 159031384, + "tag_name": "v26.1.4", + "html_url": "https://github.com/moby/moby/releases/tag/v26.1.4", + "assets": [] + }, + "v26.1.4": { + "id": 159031384, + "tag_name": "v26.1.4", + "html_url": "https://github.com/moby/moby/releases/tag/v26.1.4", + "assets": [] + }, + "v23.0.12": { + "id": 158038616, + "tag_name": "v23.0.12", + "html_url": "https://github.com/moby/moby/releases/tag/v23.0.12", "assets": [] }, "v26.1.3": { diff --git a/__mocks__/@actions/github.ts b/__mocks__/@actions/github.ts index 8a0e9466..c733a0b1 100644 --- a/__mocks__/@actions/github.ts +++ b/__mocks__/@actions/github.ts @@ -22,7 +22,8 @@ export const context = { repo: 'actions-toolkit' }, ref: 'refs/heads/master', - runId: 123, + runId: 2188748038, + runNumber: 15, payload: { after: '860c1904a1ce19322e91ac35af1ab07466440c37', base_ref: null, diff --git a/__tests__/buildx/build.test.ts b/__tests__/buildx/build.test.ts index ac2b98c1..01070fff 100644 --- a/__tests__/buildx/build.test.ts +++ b/__tests__/buildx/build.test.ts @@ -100,7 +100,7 @@ describe('getProvenanceInput', () => { test.each([ [ 'true', - 'builder-id=https://github.com/docker/actions-toolkit/actions/runs/123' + 'builder-id=https://github.com/docker/actions-toolkit/actions/runs/2188748038/attempts/2' ], [ 'false', @@ -108,11 +108,11 @@ describe('getProvenanceInput', () => { ], [ 'mode=min', - 'mode=min,builder-id=https://github.com/docker/actions-toolkit/actions/runs/123' + 'mode=min,builder-id=https://github.com/docker/actions-toolkit/actions/runs/2188748038/attempts/2' ], [ 'mode=max', - 'mode=max,builder-id=https://github.com/docker/actions-toolkit/actions/runs/123' + 'mode=max,builder-id=https://github.com/docker/actions-toolkit/actions/runs/2188748038/attempts/2' ], [ 'builder-id=foo', @@ -137,11 +137,11 @@ describe('resolveProvenanceAttrs', () => { test.each([ [ 'mode=min', - 'mode=min,builder-id=https://github.com/docker/actions-toolkit/actions/runs/123' + 'mode=min,builder-id=https://github.com/docker/actions-toolkit/actions/runs/2188748038/attempts/2' ], [ 'mode=max', - 'mode=max,builder-id=https://github.com/docker/actions-toolkit/actions/runs/123' + 'mode=max,builder-id=https://github.com/docker/actions-toolkit/actions/runs/2188748038/attempts/2' ], [ 'builder-id=foo', @@ -153,7 +153,7 @@ describe('resolveProvenanceAttrs', () => { ], [ '', - 'builder-id=https://github.com/docker/actions-toolkit/actions/runs/123' + 'builder-id=https://github.com/docker/actions-toolkit/actions/runs/2188748038/attempts/2' ], ])('given %p', async (input: string, expected: string) => { expect(Build.resolveProvenanceAttrs(input)).toEqual(expected); @@ -202,6 +202,54 @@ describe('resolveSecret', () => { }); }); +describe('resolveCacheToAttrs', () => { + // prettier-ignore + test.each([ + [ + '', + undefined, + '' + ], + [ + 'user/app:cache', + undefined, + 'user/app:cache' + ], + [ + 'type=inline', + undefined, + 'type=inline' + ], + [ + 'type=gha', + undefined, + 'type=gha,repository=docker/actions-toolkit', + ], + [ + 'type=gha,mode=max', + undefined, + 'type=gha,mode=max,repository=docker/actions-toolkit', + ], + [ + 'type=gha,mode=max', + 'abcd1234', + 'type=gha,mode=max,repository=docker/actions-toolkit,ghtoken=abcd1234', + ], + [ + 'type=gha,repository=foo/bar,mode=max', + undefined, + 'type=gha,repository=foo/bar,mode=max', + ], + [ + 'type=gha,repository=foo/bar,mode=max', + 'abcd1234', + 'type=gha,repository=foo/bar,mode=max,ghtoken=abcd1234', + ], + ])('given %p', async (input: string, githubToken: string | undefined, expected: string) => { + expect(Build.resolveCacheToAttrs(input, githubToken)).toEqual(expected); + }); +}); + describe('hasLocalExporter', () => { // prettier-ignore test.each([ diff --git a/__tests__/docker/install.test.itg.ts b/__tests__/docker/install.test.itg.ts index 4d0dde95..c55f43a8 100644 --- a/__tests__/docker/install.test.itg.ts +++ b/__tests__/docker/install.test.itg.ts @@ -19,6 +19,7 @@ import {jest, describe, expect, test, beforeEach, afterEach} from '@jest/globals import {Install} from '../../src/docker/install'; import {Docker} from '../../src/docker/docker'; +import {Exec} from '../../src/exec'; // prettier-ignore const tmpDir = path.join(process.env.TEMP || '/tmp', 'docker-install-jest'); @@ -38,8 +39,19 @@ aarch64:https://cloud.debian.org/images/cloud/bookworm/20231013-1532/debian-12-g process.env = originalEnv; }); // prettier-ignore - test.each(['v24.0.4'])( + test.each(['v26.1.4'])( 'install docker %s', async (version) => { + if (process.env.ImageOS && process.env.ImageOS.startsWith('ubuntu')) { + // Remove containerd first on ubuntu runners to make sure it takes + // ones packaged with docker + await Exec.exec('sudo', ['apt-get', 'remove', '-y', 'containerd.io'], { + env: Object.assign({}, process.env, { + DEBIAN_FRONTEND: 'noninteractive' + }) as { + [key: string]: string; + } + }); + } await expect((async () => { const install = new Install({ version: version, diff --git a/__tests__/fixtures/hello.Dockerfile b/__tests__/fixtures/hello.Dockerfile index 760836b7..9375161c 100644 --- a/__tests__/fixtures/hello.Dockerfile +++ b/__tests__/fixtures/hello.Dockerfile @@ -14,7 +14,10 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM busybox +FROM busybox AS build ARG NAME=foo ARG TARGETPLATFORM -RUN echo "Hello $NAME from $TARGETPLATFORM" +RUN echo "Hello $NAME from $TARGETPLATFORM" > foo + +FROM scratch +COPY --from=build /foo / diff --git a/__tests__/fixtures/oci-archive/crazy-max~docker-alpine-s6~II9A63.dockerbuild b/__tests__/fixtures/oci-archive/crazy-max~docker-alpine-s6~II9A63.dockerbuild new file mode 100644 index 00000000..3301d783 Binary files /dev/null and b/__tests__/fixtures/oci-archive/crazy-max~docker-alpine-s6~II9A63.dockerbuild differ diff --git a/__tests__/fixtures/oci-archive/docker~test-docker-action~COIO50.dockerbuild b/__tests__/fixtures/oci-archive/docker~test-docker-action~COIO50.dockerbuild new file mode 100644 index 00000000..f20fec6e Binary files /dev/null and b/__tests__/fixtures/oci-archive/docker~test-docker-action~COIO50.dockerbuild differ diff --git a/__tests__/fixtures/oci-archive/docker~test-docker-action~SNHBPN+3.dockerbuild b/__tests__/fixtures/oci-archive/docker~test-docker-action~SNHBPN+3.dockerbuild new file mode 100644 index 00000000..688a1d37 Binary files /dev/null and b/__tests__/fixtures/oci-archive/docker~test-docker-action~SNHBPN+3.dockerbuild differ diff --git a/__tests__/fixtures/oci-archive/docker~test-docker-action~TYO4JJ+15.dockerbuild b/__tests__/fixtures/oci-archive/docker~test-docker-action~TYO4JJ+15.dockerbuild new file mode 100644 index 00000000..36922e4c Binary files /dev/null and b/__tests__/fixtures/oci-archive/docker~test-docker-action~TYO4JJ+15.dockerbuild differ diff --git a/__tests__/fixtures/oci-archive/hello-oci-gzip.tar b/__tests__/fixtures/oci-archive/hello-oci-gzip.tar new file mode 100644 index 00000000..fb62c0f9 Binary files /dev/null and b/__tests__/fixtures/oci-archive/hello-oci-gzip.tar differ diff --git a/__tests__/fixtures/oci-archive/hello-oci-multiplatform-gzip.tar b/__tests__/fixtures/oci-archive/hello-oci-multiplatform-gzip.tar new file mode 100644 index 00000000..b24cf205 Binary files /dev/null and b/__tests__/fixtures/oci-archive/hello-oci-multiplatform-gzip.tar differ diff --git a/__tests__/fixtures/oci-archive/hello-oci-uncompressed.tar b/__tests__/fixtures/oci-archive/hello-oci-uncompressed.tar new file mode 100644 index 00000000..6202d0f0 Binary files /dev/null and b/__tests__/fixtures/oci-archive/hello-oci-uncompressed.tar differ diff --git a/__tests__/fixtures/oci-archive/hello-oci-zstd.tar b/__tests__/fixtures/oci-archive/hello-oci-zstd.tar new file mode 100644 index 00000000..93b7dbf7 Binary files /dev/null and b/__tests__/fixtures/oci-archive/hello-oci-zstd.tar differ diff --git a/__tests__/fixtures/oci-archive/moby~buildkit~LWDOW6.dockerbuild b/__tests__/fixtures/oci-archive/moby~buildkit~LWDOW6.dockerbuild new file mode 100644 index 00000000..aab3a762 Binary files /dev/null and b/__tests__/fixtures/oci-archive/moby~buildkit~LWDOW6.dockerbuild differ diff --git a/__tests__/github.test.ts b/__tests__/github.test.ts index 93d05027..37a771fe 100644 --- a/__tests__/github.test.ts +++ b/__tests__/github.test.ts @@ -32,7 +32,7 @@ jest.spyOn(GitHub.prototype, 'repoData').mockImplementation((): Promise { - it('returns GitHub repository', async () => { + it('returns GitHub repo data', async () => { const github = new GitHub(); expect((await github.repoData()).name).toEqual('Hello-World'); }); @@ -89,9 +89,15 @@ describe('apiURL', () => { }); }); +describe('repository', () => { + it('returns GitHub repository', async () => { + expect(GitHub.repository).toEqual('docker/actions-toolkit'); + }); +}); + describe('workflowRunURL', () => { - it('returns 123', async () => { - expect(GitHub.workflowRunURL).toEqual('https://github.com/docker/actions-toolkit/actions/runs/123'); + it('returns 2188748038', async () => { + expect(GitHub.workflowRunURL).toEqual('https://github.com/docker/actions-toolkit/actions/runs/2188748038/attempts/2'); }); }); diff --git a/__tests__/oci/oci.test.ts b/__tests__/oci/oci.test.ts new file mode 100644 index 00000000..7c60ac41 --- /dev/null +++ b/__tests__/oci/oci.test.ts @@ -0,0 +1,50 @@ +/** + * Copyright 2024 actions-toolkit authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {afterEach, beforeEach, describe, expect, jest, test} from '@jest/globals'; +import * as fs from 'fs'; +import path from 'path'; +import * as rimraf from 'rimraf'; + +import {OCI} from '../../src/oci/oci'; + +const fixturesDir = path.join(__dirname, '..', 'fixtures'); + +// prettier-ignore +const tmpDir = path.join(process.env.TEMP || '/tmp', 'docker-jest'); + +beforeEach(() => { + jest.clearAllMocks(); +}); + +afterEach(function () { + rimraf.sync(tmpDir); +}); + +describe('loadArchive', () => { + // prettier-ignore + test.each(fs.readdirSync(path.join(fixturesDir, 'oci-archive')).filter(file => { + return fs.statSync(path.join(path.join(fixturesDir, 'oci-archive'), file)).isFile(); + }).map(filename => [filename]))('extracting %p', async (filename) => { + const res = await OCI.loadArchive({ + file: path.join(fixturesDir, 'oci-archive', filename) + }); + expect(res).toBeDefined(); + expect(res?.root.index).toBeDefined(); + expect(res?.root.layout).toBeDefined(); + // console.log(JSON.stringify(res, null, 2)); + }); +}); diff --git a/jest.config.itg.ts b/jest.config.itg.ts index 8995ea85..9628c493 100644 --- a/jest.config.itg.ts +++ b/jest.config.itg.ts @@ -23,6 +23,9 @@ const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-actions-toolkit-')) process.env = Object.assign({}, process.env, { TEMP: tmpDir, GITHUB_REPOSITORY: 'docker/actions-toolkit', + GITHUB_RUN_ATTEMPT: 2, + GITHUB_RUN_ID: 2188748038, + GITHUB_RUN_NUMBER: 15, RUNNER_TEMP: path.join(tmpDir, 'runner-temp'), RUNNER_TOOL_CACHE: path.join(tmpDir, 'runner-tool-cache') }) as { diff --git a/jest.config.ts b/jest.config.ts index 0f63e270..fb873b5e 100644 --- a/jest.config.ts +++ b/jest.config.ts @@ -23,6 +23,9 @@ const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-actions-toolkit-')) process.env = Object.assign({}, process.env, { TEMP: tmpDir, GITHUB_REPOSITORY: 'docker/actions-toolkit', + GITHUB_RUN_ATTEMPT: 2, + GITHUB_RUN_ID: 2188748038, + GITHUB_RUN_NUMBER: 15, RUNNER_TEMP: path.join(tmpDir, 'runner-temp'), RUNNER_TOOL_CACHE: path.join(tmpDir, 'runner-tool-cache') }) as { diff --git a/package.json b/package.json index b2c614c9..2b458269 100644 --- a/package.json +++ b/package.json @@ -58,17 +58,21 @@ "@octokit/plugin-rest-endpoint-methods": "^10.4.0", "async-retry": "^1.3.3", "csv-parse": "^5.5.6", + "gunzip-maybe": "^1.4.2", "handlebars": "^4.7.8", "js-yaml": "^4.1.0", "jwt-decode": "^4.0.0", "semver": "^7.6.2", + "tar-stream": "^3.1.7", "tmp": "^0.2.3" }, "devDependencies": { "@types/csv-parse": "^1.2.2", + "@types/gunzip-maybe": "^1.4.2", "@types/js-yaml": "^4.0.9", "@types/node": "^20.12.10", "@types/semver": "^7.5.8", + "@types/tar-stream": "^3.1.3", "@types/tmp": "^0.2.6", "@typescript-eslint/eslint-plugin": "^7.8.0", "@typescript-eslint/parser": "^7.8.0", diff --git a/src/buildx/build.ts b/src/buildx/build.ts index c368c45e..c2f5263d 100644 --- a/src/buildx/build.ts +++ b/src/buildx/build.ts @@ -161,6 +161,45 @@ export class Build { return `${input},builder-id=${GitHub.workflowRunURL}`; } + public static resolveCacheToAttrs(input: string, githubToken?: string): string { + if (!input) { + return input; + } + + let cacheType = 'registry'; + let ghaCacheRepository = ''; + let ghaCacheGHToken = ''; + + const fields = parse(input, { + relaxColumnCount: true, + skipEmptyLines: true + })[0]; + for (const field of fields) { + const parts = field + .toString() + .split(/(?<=^[^=]+?)=/) + .map(item => item.trim()); + if (parts[0] === 'type') { + cacheType = parts[1]; + } else if (parts[0] === 'repository') { + ghaCacheRepository = parts[1]; + } else if (parts[0] === 'ghtoken') { + ghaCacheGHToken = parts[1]; + } + } + + if (cacheType === 'gha') { + if (!ghaCacheRepository) { + input = `${input},repository=${GitHub.repository}`; + } + if (!ghaCacheGHToken && githubToken) { + input = `${input},ghtoken=${githubToken}`; + } + } + + return input; + } + public static hasLocalExporter(exporters: string[]): boolean { return Build.hasExporterType('local', exporters); } diff --git a/src/docker/assets.ts b/src/docker/assets.ts index fd42cf1a..15e39c22 100644 --- a/src/docker/assets.ts +++ b/src/docker/assets.ts @@ -79,6 +79,9 @@ if (Get-Service docker -ErrorAction SilentlyContinue) { Write-Host "Service removed" } +$env:Path = "$ToolDir;" + [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User") +Write-Host "Path: $env:Path" + $env:DOCKER_HOST = $DockerHost Write-Host "DOCKER_HOST: $env:DOCKER_HOST" diff --git a/src/docker/install.ts b/src/docker/install.ts index d3243cb2..46af76cb 100644 --- a/src/docker/install.ts +++ b/src/docker/install.ts @@ -253,6 +253,12 @@ export class Install { }); } + const envs = Object.assign({}, process.env, { + PATH: `${this.toolDir}:${process.env.PATH}` + }) as { + [key: string]: string; + }; + await core.group('Start Docker daemon', async () => { const bashPath: string = await io.which('bash', true); const cmd = `${this.toolDir}/dockerd --host="${dockerHost}" --config-file="${daemonConfigPath}" --exec-root="${this.runDir}/execroot" --data-root="${this.runDir}/data" --pidfile="${this.runDir}/docker.pid" --userland-proxy=false`; @@ -262,11 +268,12 @@ export class Install { // avoid killing it when the action finishes running. Even if detached, // we also need to run dockerd in a subshell and unref the process so // GitHub Action doesn't wait for it to finish. - `sudo -E ${bashPath} << EOF + `sudo env "PATH=$PATH" ${bashPath} << EOF ( ${cmd} 2>&1 | tee "${this.runDir}/dockerd.log" ) & EOF`, [], { + env: envs, detached: true, shell: true, stdio: ['ignore', process.stdout, process.stderr] @@ -280,7 +287,7 @@ EOF`, try { await Exec.getExecOutput(`docker version`, undefined, { silent: true, - env: Object.assign({}, process.env, { + env: Object.assign({}, envs, { DOCKER_HOST: dockerHost }) as { [key: string]: string; diff --git a/src/github.ts b/src/github.ts index ae107bfa..d0da7488 100644 --- a/src/github.ts +++ b/src/github.ts @@ -64,8 +64,14 @@ export class GitHub { return process.env.GITHUB_API_URL || 'https://api.github.com'; } + static get repository(): string { + return `${github.context.repo.owner}/${github.context.repo.repo}`; + } + static get workflowRunURL(): string { - return `${GitHub.serverURL}/${github.context.repo.owner}/${github.context.repo.repo}/actions/runs/${github.context.runId}`; + const runID = process.env.GITHUB_RUN_ID || github.context.runId; + const runAttempt = process.env.GITHUB_RUN_ATTEMPT || 1; + return `${GitHub.serverURL}/${GitHub.repository}/actions/runs/${runID}/attempts/${runAttempt}`; } static get actionsRuntimeToken(): GitHubActionsRuntimeToken | undefined { diff --git a/src/oci/oci.ts b/src/oci/oci.ts new file mode 100644 index 00000000..dd9a83b2 --- /dev/null +++ b/src/oci/oci.ts @@ -0,0 +1,163 @@ +/** + * Copyright 2024 actions-toolkit authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +import fs from 'fs'; +import gunzip from 'gunzip-maybe'; +import * as path from 'path'; +import {Readable} from 'stream'; +import * as tar from 'tar-stream'; + +import {Archive, LoadArchiveOpts} from '../types/oci/oci'; +import {Index} from '../types/oci'; +import {Manifest} from '../types/oci/manifest'; +import {Image} from '../types/oci/config'; +import {IMAGE_BLOBS_DIR_V1, IMAGE_INDEX_FILE_V1, IMAGE_LAYOUT_FILE_V1, ImageLayout} from '../types/oci/layout'; +import {MEDIATYPE_IMAGE_INDEX_V1, MEDIATYPE_IMAGE_MANIFEST_V1} from '../types/oci/mediatype'; + +export class OCI { + public static loadArchive(opts: LoadArchiveOpts): Promise { + return new Promise((resolve, reject) => { + const tarex: tar.Extract = tar.extract(); + + let rootIndex: Index; + let rootLayout: ImageLayout; + const indexes: Record = {}; + const manifests: Record = {}; + const images: Record = {}; + const blobs: Record = {}; + + tarex.on('entry', async (header, stream, next) => { + if (header.type === 'file') { + const filename = path.normalize(header.name); + if (filename === IMAGE_INDEX_FILE_V1) { + rootIndex = await OCI.streamToJson(stream); + } else if (filename === IMAGE_LAYOUT_FILE_V1) { + rootLayout = await OCI.streamToJson(stream); + } else if (filename.startsWith(path.join(IMAGE_BLOBS_DIR_V1, path.sep))) { + const blob = await OCI.extractBlob(stream); + const digest = `${filename.split(path.sep)[1]}:${filename.split(path.sep)[filename.split(path.sep).length - 1]}`; + if (OCI.isIndex(blob)) { + indexes[digest] = JSON.parse(blob); + } else if (OCI.isManifest(blob)) { + manifests[digest] = JSON.parse(blob); + } else if (OCI.isImage(blob)) { + images[digest] = JSON.parse(blob); + } else { + blobs[digest] = blob; + } + } else { + reject(new Error(`Invalid OCI archive: unexpected file ${filename}`)); + } + } + stream.resume(); + next(); + }); + + tarex.on('finish', () => { + if (!rootIndex || !rootLayout) { + reject(new Error('Invalid OCI archive: missing index or layout')); + } + resolve({ + root: { + index: rootIndex, + layout: rootLayout + }, + indexes: indexes, + manifests: manifests, + images: images, + blobs: blobs + } as Archive); + }); + + tarex.on('error', error => { + reject(error); + }); + + fs.createReadStream(opts.file).pipe(gunzip()).pipe(tarex); + }); + } + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + private static isIndex(blob: any): boolean { + try { + const index = JSON.parse(blob); + return index.mediaType === MEDIATYPE_IMAGE_INDEX_V1; + } catch { + return false; + } + } + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + private static isManifest(blob: any): boolean { + try { + const manifest = JSON.parse(blob); + return manifest.mediaType === MEDIATYPE_IMAGE_MANIFEST_V1 && manifest.layers.length > 0; + } catch { + return false; + } + } + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + private static isImage(blob: any): boolean { + try { + const image = JSON.parse(blob); + return image.rootfs.type !== ''; + } catch { + return false; + } + } + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + private static extractBlob(stream: Readable): Promise { + return new Promise((resolve, reject) => { + const chunks: Buffer[] = []; + const dstream = stream.pipe(gunzip()); + dstream.on('data', chunk => { + chunks.push(chunk); + }); + dstream.on('end', () => { + resolve(Buffer.concat(chunks).toString('utf8')); + }); + dstream.on('error', async error => { + reject(error); + }); + }); + } + + private static async streamToJson(stream: Readable): Promise { + return new Promise((resolve, reject) => { + const chunks: string[] = []; + let bytes = 0; + stream.on('data', chunk => { + bytes += chunk.length; + if (bytes <= 2 * 1024 * 1024) { + chunks.push(chunk.toString('utf8')); + } else { + reject(new Error('The data stream exceeds the size limit for JSON parsing.')); + } + }); + stream.on('end', () => { + try { + resolve(JSON.parse(chunks.join(''))); + } catch (error) { + reject(error); + } + }); + stream.on('error', async error => { + reject(error); + }); + }); + } +} diff --git a/src/types/oci/config.ts b/src/types/oci/config.ts new file mode 100644 index 00000000..b9f0d1ca --- /dev/null +++ b/src/types/oci/config.ts @@ -0,0 +1,52 @@ +/** + * Copyright 2024 actions-toolkit authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {Digest} from './digest'; +import {Platform} from './descriptor'; + +export interface ImageConfig { + User?: string; + ExposedPorts?: Record; + Env?: string[]; + Entrypoint?: string[]; + Cmd?: string[]; + Volumes?: Record; + WorkingDir?: string; + Labels?: Record; + StopSignal?: string; + ArgsEscaped?: boolean; +} + +export interface RootFS { + type: string; + diff_ids: Digest[]; +} + +export interface History { + created?: string; // assuming RFC 3339 formatted string + created_by?: string; + author?: string; + comment?: string; + empty_layer?: boolean; +} + +export interface Image extends Platform { + created?: string; // assuming RFC 3339 formatted string + author?: string; + config?: ImageConfig; + rootfs: RootFS; + history?: History[]; +} diff --git a/src/types/oci/descriptor.ts b/src/types/oci/descriptor.ts new file mode 100644 index 00000000..e2de5f85 --- /dev/null +++ b/src/types/oci/descriptor.ts @@ -0,0 +1,45 @@ +/** + * Copyright 2024 actions-toolkit authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {Digest} from './digest'; + +import {MEDIATYPE_EMPTY_JSON_V1} from './mediatype'; + +export interface Descriptor { + mediaType: string; + digest: Digest; + size: number; + urls?: string[]; + annotations?: Record; + data?: string; + platform?: Platform; + artifactType?: string; +} + +export interface Platform { + architecture: string; + os: string; + 'os.version'?: string; + 'os.features'?: string[]; + variant?: string; +} + +export const DescriptorEmptyJSON: Descriptor = { + mediaType: MEDIATYPE_EMPTY_JSON_V1, + digest: 'sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a', + size: 2, + data: '{}' +}; diff --git a/src/types/oci/digest.ts b/src/types/oci/digest.ts new file mode 100644 index 00000000..65b9ca79 --- /dev/null +++ b/src/types/oci/digest.ts @@ -0,0 +1,17 @@ +/** + * Copyright 2024 actions-toolkit authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export type Digest = string; diff --git a/src/types/oci/index.ts b/src/types/oci/index.ts new file mode 100644 index 00000000..480aab5f --- /dev/null +++ b/src/types/oci/index.ts @@ -0,0 +1,26 @@ +/** + * Copyright 2024 actions-toolkit authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {Versioned} from './versioned'; +import {Descriptor} from './descriptor'; + +export interface Index extends Versioned { + mediaType?: string; + artifactType?: string; + manifests: Descriptor[]; + subject?: Descriptor; + annotations?: Record; +} diff --git a/src/types/oci/layout.ts b/src/types/oci/layout.ts new file mode 100644 index 00000000..49cec12a --- /dev/null +++ b/src/types/oci/layout.ts @@ -0,0 +1,27 @@ +/** + * Copyright 2024 actions-toolkit authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export const IMAGE_LAYOUT_FILE_V1 = 'oci-layout'; + +export const IMAGE_LAYOUT_VERSION_V1 = '1.0.0'; + +export const IMAGE_INDEX_FILE_V1 = 'index.json'; + +export const IMAGE_BLOBS_DIR_V1 = 'blobs'; + +export interface ImageLayout { + version: string; +} diff --git a/src/types/oci/manifest.ts b/src/types/oci/manifest.ts new file mode 100644 index 00000000..14e28a69 --- /dev/null +++ b/src/types/oci/manifest.ts @@ -0,0 +1,27 @@ +/** + * Copyright 2024 actions-toolkit authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {Descriptor} from './descriptor'; +import {Versioned} from './versioned'; + +export interface Manifest extends Versioned { + mediaType?: string; + artifactType?: string; + config: Descriptor; + layers: Descriptor[]; + subject?: Descriptor; + annotations?: Record; +} diff --git a/src/types/oci/mediatype.ts b/src/types/oci/mediatype.ts new file mode 100644 index 00000000..fca5c00c --- /dev/null +++ b/src/types/oci/mediatype.ts @@ -0,0 +1,25 @@ +/** + * Copyright 2024 actions-toolkit authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export const MEDIATYPE_DESCRIPTOR_V1 = 'application/vnd.oci.descriptor.v1+json'; + +export const MEDIATYPE_IMAGE_MANIFEST_V1 = 'application/vnd.oci.image.manifest.v1+json'; + +export const MEDIATYPE_IMAGE_INDEX_V1 = 'application/vnd.oci.image.index.v1+json'; + +export const MEDIATYPE_IMAGE_LAYER_V1 = 'application/vnd.oci.image.layer.v1.tar'; + +export const MEDIATYPE_EMPTY_JSON_V1 = 'application/vnd.oci.empty.v1+json'; diff --git a/src/types/oci/oci.ts b/src/types/oci/oci.ts new file mode 100644 index 00000000..0b36a71b --- /dev/null +++ b/src/types/oci/oci.ts @@ -0,0 +1,36 @@ +/** + * Copyright 2024 actions-toolkit authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +import {Index} from './index'; +import {ImageLayout} from './layout'; +import {Manifest} from './manifest'; +import {Image} from './config'; + +export interface LoadArchiveOpts { + file: string; +} + +export interface Archive { + root: { + index: Index; + layout: ImageLayout; + }; + indexes: Record; + manifests: Record; + images: Record; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + blobs: Record; +} diff --git a/src/types/oci/versioned.ts b/src/types/oci/versioned.ts new file mode 100644 index 00000000..ef335d59 --- /dev/null +++ b/src/types/oci/versioned.ts @@ -0,0 +1,19 @@ +/** + * Copyright 2024 actions-toolkit authors + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +export interface Versioned { + schemaVersion: number; +} diff --git a/yarn.lock b/yarn.lock index 4d5a14a9..6369e839 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1111,9 +1111,11 @@ __metadata: "@octokit/core": ^5.1.0 "@octokit/plugin-rest-endpoint-methods": ^10.4.0 "@types/csv-parse": ^1.2.2 + "@types/gunzip-maybe": ^1.4.2 "@types/js-yaml": ^4.0.9 "@types/node": ^20.12.10 "@types/semver": ^7.5.8 + "@types/tar-stream": ^3.1.3 "@types/tmp": ^0.2.6 "@typescript-eslint/eslint-plugin": ^7.8.0 "@typescript-eslint/parser": ^7.8.0 @@ -1125,6 +1127,7 @@ __metadata: eslint-plugin-import: ^2.29.1 eslint-plugin-jest: ^28.5.0 eslint-plugin-prettier: ^5.1.3 + gunzip-maybe: ^1.4.2 handlebars: ^4.7.8 jest: ^29.7.0 js-yaml: ^4.1.0 @@ -1132,6 +1135,7 @@ __metadata: prettier: ^3.2.5 rimraf: ^5.0.5 semver: ^7.6.2 + tar-stream: ^3.1.7 tmp: ^0.2.3 ts-jest: ^29.1.2 ts-node: ^10.9.2 @@ -2162,6 +2166,15 @@ __metadata: languageName: node linkType: hard +"@types/gunzip-maybe@npm:^1.4.2": + version: 1.4.2 + resolution: "@types/gunzip-maybe@npm:1.4.2" + dependencies: + "@types/node": "*" + checksum: 9be931d6b74ea4e28f2682e3aac6c242448128c6e06bee2e5758e8747ef51f231c46f11e27783092530f81c51f0a5ce6f87217e92e7e80b55e7132c7538e5f3e + languageName: node + linkType: hard + "@types/istanbul-lib-coverage@npm:*, @types/istanbul-lib-coverage@npm:^2.0.0, @types/istanbul-lib-coverage@npm:^2.0.1": version: 2.0.3 resolution: "@types/istanbul-lib-coverage@npm:2.0.3" @@ -2248,6 +2261,15 @@ __metadata: languageName: node linkType: hard +"@types/tar-stream@npm:^3.1.3": + version: 3.1.3 + resolution: "@types/tar-stream@npm:3.1.3" + dependencies: + "@types/node": "*" + checksum: 187387748288b35924284afc26cf36b6b966377f5131398bf484c475f7191c50f5e5903c94a7391049b6cdfce174ae2e63f776dea9425d94ddc6bd31ebe386ee + languageName: node + linkType: hard + "@types/tmp@npm:^0.2.6": version: 0.2.6 resolution: "@types/tmp@npm:0.2.6" @@ -2942,6 +2964,15 @@ __metadata: languageName: node linkType: hard +"browserify-zlib@npm:^0.1.4": + version: 0.1.4 + resolution: "browserify-zlib@npm:0.1.4" + dependencies: + pako: ~0.2.0 + checksum: abee4cb4349e8a21391fd874564f41b113fe691372913980e6fa06a777e4ea2aad4e942af14ab99bce190d5ac8f5328201432f4ef0eae48c6d02208bc212976f + languageName: node + linkType: hard + "browserslist@npm:^4.17.5": version: 4.19.3 resolution: "browserslist@npm:4.19.3" @@ -3627,6 +3658,18 @@ __metadata: languageName: node linkType: hard +"duplexify@npm:^3.5.0, duplexify@npm:^3.6.0": + version: 3.7.1 + resolution: "duplexify@npm:3.7.1" + dependencies: + end-of-stream: ^1.0.0 + inherits: ^2.0.1 + readable-stream: ^2.0.0 + stream-shift: ^1.0.0 + checksum: 3c2ed2223d956a5da713dae12ba8295acb61d9acd966ccbba938090d04f4574ca4dca75cca089b5077c2d7e66101f32e6ea9b36a78ca213eff574e7a8b8accf2 + languageName: node + linkType: hard + "eastasianwidth@npm:^0.2.0": version: 0.2.0 resolution: "eastasianwidth@npm:0.2.0" @@ -3678,6 +3721,15 @@ __metadata: languageName: node linkType: hard +"end-of-stream@npm:^1.0.0, end-of-stream@npm:^1.1.0": + version: 1.4.4 + resolution: "end-of-stream@npm:1.4.4" + dependencies: + once: ^1.4.0 + checksum: 530a5a5a1e517e962854a31693dbb5c0b2fc40b46dad2a56a2deec656ca040631124f4795823acc68238147805f8b021abbe221f4afed5ef3c8e8efc2024908b + languageName: node + linkType: hard + "env-paths@npm:^2.2.0": version: 2.2.1 resolution: "env-paths@npm:2.2.1" @@ -4734,6 +4786,22 @@ __metadata: languageName: node linkType: hard +"gunzip-maybe@npm:^1.4.2": + version: 1.4.2 + resolution: "gunzip-maybe@npm:1.4.2" + dependencies: + browserify-zlib: ^0.1.4 + is-deflate: ^1.0.0 + is-gzip: ^1.0.0 + peek-stream: ^1.1.0 + pumpify: ^1.3.3 + through2: ^2.0.3 + bin: + gunzip-maybe: bin.js + checksum: bc4d4977c24a2860238df271de75d53dd72a359d19f1248d1c613807dc221d3b8ae09624e3085c8106663e3e1b59db62a85b261d1138c2cc24efad9df577d4e1 + languageName: node + linkType: hard + "handlebars@npm:^4.7.8": version: 4.7.8 resolution: "handlebars@npm:4.7.8" @@ -4989,7 +5057,7 @@ __metadata: languageName: node linkType: hard -"inherits@npm:2, inherits@npm:^2.0.3, inherits@npm:~2.0.3": +"inherits@npm:2, inherits@npm:^2.0.1, inherits@npm:^2.0.3, inherits@npm:~2.0.3": version: 2.0.4 resolution: "inherits@npm:2.0.4" checksum: 4a48a733847879d6cf6691860a6b1e3f0f4754176e4d71494c41f3475553768b10f84b5ce1d40fbd0e34e6bfbb864ee35858ad4dd2cf31e02fc4a154b724d7f1 @@ -5153,6 +5221,13 @@ __metadata: languageName: node linkType: hard +"is-deflate@npm:^1.0.0": + version: 1.0.0 + resolution: "is-deflate@npm:1.0.0" + checksum: c2f9f2d3db79ac50c5586697d1e69a55282a2b0cc5e437b3c470dd47f24e40b6216dcd7e024511e21381607bf57afa019343e3bd0e08a119032818b596004262 + languageName: node + linkType: hard + "is-extglob@npm:^2.1.1": version: 2.1.1 resolution: "is-extglob@npm:2.1.1" @@ -5183,6 +5258,13 @@ __metadata: languageName: node linkType: hard +"is-gzip@npm:^1.0.0": + version: 1.0.0 + resolution: "is-gzip@npm:1.0.0" + checksum: 0d28931c1f445fa29c900cf9f48e06e9d1d477a3bf7bd7332e7ce68f1333ccd8cb381de2f0f62a9a262d9c0912608a9a71b4a40e788e201b3dbd67072bb20d86 + languageName: node + linkType: hard + "is-lambda@npm:^1.0.1": version: 1.0.1 resolution: "is-lambda@npm:1.0.1" @@ -6591,7 +6673,7 @@ __metadata: languageName: node linkType: hard -"once@npm:^1.3.0, once@npm:^1.4.0": +"once@npm:^1.3.0, once@npm:^1.3.1, once@npm:^1.4.0": version: 1.4.0 resolution: "once@npm:1.4.0" dependencies: @@ -6675,6 +6757,13 @@ __metadata: languageName: node linkType: hard +"pako@npm:~0.2.0": + version: 0.2.9 + resolution: "pako@npm:0.2.9" + checksum: 055f9487cd57fbb78df84315873bbdd089ba286f3499daed47d2effdc6253e981f5db6898c23486de76d4a781559f890d643bd3a49f70f1b4a18019c98aa5125 + languageName: node + linkType: hard + "parent-module@npm:^1.0.0": version: 1.0.1 resolution: "parent-module@npm:1.0.1" @@ -6758,6 +6847,17 @@ __metadata: languageName: node linkType: hard +"peek-stream@npm:^1.1.0": + version: 1.1.3 + resolution: "peek-stream@npm:1.1.3" + dependencies: + buffer-from: ^1.0.0 + duplexify: ^3.5.0 + through2: ^2.0.3 + checksum: a0e09d6d1a8a01158a3334f20d6b1cdd91747eba24eb06a1d742eefb620385593121a76d4378cc81f77cdce6a66df0575a41041b1189c510254aec91878afc99 + languageName: node + linkType: hard + "picocolors@npm:^1.0.0": version: 1.0.0 resolution: "picocolors@npm:1.0.0" @@ -6888,6 +6988,27 @@ __metadata: languageName: node linkType: hard +"pump@npm:^2.0.0": + version: 2.0.1 + resolution: "pump@npm:2.0.1" + dependencies: + end-of-stream: ^1.1.0 + once: ^1.3.1 + checksum: e9f26a17be00810bff37ad0171edb35f58b242487b0444f92fb7d78bc7d61442fa9b9c5bd93a43fd8fd8ddd3cc75f1221f5e04c790f42907e5baab7cf5e2b931 + languageName: node + linkType: hard + +"pumpify@npm:^1.3.3": + version: 1.5.1 + resolution: "pumpify@npm:1.5.1" + dependencies: + duplexify: ^3.6.0 + inherits: ^2.0.3 + pump: ^2.0.0 + checksum: 26ca412ec8d665bd0d5e185c1b8f627728eff603440d75d22a58e421e3c66eaf86ec6fc6a6efc54808ecef65979279fa8e99b109a23ec1fa8d79f37e6978c9bd + languageName: node + linkType: hard + "punycode@npm:^2.1.0": version: 2.1.1 resolution: "punycode@npm:2.1.1" @@ -6930,7 +7051,7 @@ __metadata: languageName: node linkType: hard -"readable-stream@npm:^2.0.5": +"readable-stream@npm:^2.0.0, readable-stream@npm:^2.0.5, readable-stream@npm:~2.3.6": version: 2.3.8 resolution: "readable-stream@npm:2.3.8" dependencies: @@ -7441,6 +7562,13 @@ __metadata: languageName: node linkType: hard +"stream-shift@npm:^1.0.0": + version: 1.0.3 + resolution: "stream-shift@npm:1.0.3" + checksum: a24c0a3f66a8f9024bd1d579a533a53be283b4475d4e6b4b3211b964031447bdf6532dd1f3c2b0ad66752554391b7c62bd7ca4559193381f766534e723d50242 + languageName: node + linkType: hard + "streamx@npm:^2.15.0": version: 2.16.1 resolution: "streamx@npm:2.16.1" @@ -7682,7 +7810,7 @@ __metadata: languageName: node linkType: hard -"tar-stream@npm:^3.0.0": +"tar-stream@npm:^3.0.0, tar-stream@npm:^3.1.7": version: 3.1.7 resolution: "tar-stream@npm:3.1.7" dependencies: @@ -7725,6 +7853,16 @@ __metadata: languageName: node linkType: hard +"through2@npm:^2.0.3": + version: 2.0.5 + resolution: "through2@npm:2.0.5" + dependencies: + readable-stream: ~2.3.6 + xtend: ~4.0.1 + checksum: beb0f338aa2931e5660ec7bf3ad949e6d2e068c31f4737b9525e5201b824ac40cac6a337224856b56bd1ddd866334bbfb92a9f57cd6f66bc3f18d3d86fc0fe50 + languageName: node + linkType: hard + "tmp@npm:^0.2.3": version: 0.2.3 resolution: "tmp@npm:0.2.3" @@ -8403,6 +8541,13 @@ __metadata: languageName: node linkType: hard +"xtend@npm:~4.0.1": + version: 4.0.2 + resolution: "xtend@npm:4.0.2" + checksum: ac5dfa738b21f6e7f0dd6e65e1b3155036d68104e67e5d5d1bde74892e327d7e5636a076f625599dc394330a731861e87343ff184b0047fef1360a7ec0a5a36a + languageName: node + linkType: hard + "y18n@npm:^5.0.5": version: 5.0.8 resolution: "y18n@npm:5.0.8"