Compare commits

...

17 Commits

Author SHA1 Message Date
CrazyMax
433952b109 Merge pull request #10 from crazy-max/update-readme
Some checks failed
publish / publish (push) Has been cancelled
Update README
2023-01-31 10:53:06 +01:00
CrazyMax
1d52cba4ed Merge pull request #9 from crazy-max/license-headers
set license headers
2023-01-31 10:50:09 +01:00
CrazyMax
00f55b8385 chore: set license headers
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-01-31 03:34:59 +01:00
CrazyMax
063d88c841 ci: update validate job
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-01-31 03:34:59 +01:00
CrazyMax
152b37e0f7 hack: add license headers tool
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-01-31 03:34:59 +01:00
CrazyMax
28b6e2512c Update README
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-01-31 03:23:38 +01:00
CrazyMax
e218647127 Merge pull request #8 from crazy-max/ci-disable-job
ci: disable open-pr job for now
2023-01-31 02:48:05 +01:00
CrazyMax
a9c554ec83 ci: disable open-pr job for now
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-01-31 02:46:48 +01:00
CrazyMax
48fba6e0d9 Merge pull request #7 from crazy-max/buildx-releases-json
ci: generate buildx-releases.json
2023-01-31 02:40:56 +01:00
CrazyMax
bd4df13130 buildx: add fixme for releases url
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-01-31 02:38:44 +01:00
CrazyMax
201b1942bf ci: generate buildx-releases.json
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-01-31 02:35:21 +01:00
CrazyMax
b40e86b8f4 Merge pull request #6 from crazy-max/buildx-getrelease
buildx: getRelease
2023-01-31 02:23:00 +01:00
CrazyMax
96c92fc206 buildx: getRelease
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-01-31 00:11:16 +01:00
CrazyMax
e070c13d66 Merge pull request #5 from crazy-max/improve-ci
ci: split validate and test targets
2023-01-30 20:34:27 +01:00
CrazyMax
9df71fe601 ci: split validate and test targets
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-01-30 20:30:44 +01:00
CrazyMax
f9b34f0e95 Merge pull request #4 from crazy-max/buildx-version
buildx: do not set version in constructor
2023-01-30 20:11:23 +01:00
CrazyMax
32a260e6e5 buildx: do not set version in constructor
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2023-01-30 20:08:54 +01:00
27 changed files with 590 additions and 20 deletions

View File

@@ -0,0 +1,59 @@
name: buildx-releases-json
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
schedule:
- cron: '0 */12 * * *'
push:
branches:
- 'main'
pull_request:
paths-ignore:
- '.github/buildx-releases.json'
jobs:
generate:
uses: crazy-max/.github/.github/workflows/releases-json.yml@2a596c917a8ad3e6203ae99b777148525a2e00d5
with:
repository: docker/buildx
artifact_name: buildx-releases-json
filename: buildx-releases.json
secrets: inherit
# FIXME: Uncomment when repo public
# open-pr:
# runs-on: ubuntu-22.04
# if: github.event_name != 'pull_request'
# needs:
# - generate
# steps:
# -
# name: Checkout
# uses: actions/checkout@v3
# -
# name: Download
# uses: actions/download-artifact@v3
# with:
# name: buildx-releases-json
# path: .github
# -
# name: Commit changes
# run: |
# git add -A .
# -
# name: Create PR
# uses: peter-evans/create-pull-request@2b011faafdcbc9ceb11414d64d0573f37c774b04
# with:
# base: master
# branch: bot/buildx-releases-json
# commit-message: "github: update .github/buildx-releases.json"
# signoff: true
# delete-branch: true
# title: "Update `.github/buildx-releases.json`"
# body: |
# Update `.github/buildx-releases.json` to keep in sync with [https://github.com/docker/buildx](https://github.com/docker/buildx).
# draft: false

View File

@@ -5,10 +5,19 @@ on:
branches:
- 'main'
pull_request:
paths-ignore:
- '.github/buildx-releases.json'
jobs:
test:
validate:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- lint
- vendor-validate
- license-validate
steps:
-
name: Checkout
@@ -17,7 +26,14 @@ jobs:
name: Validate
uses: docker/bake-action@v2
with:
targets: validate
targets: ${{ matrix.target }}
test:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Test
uses: docker/bake-action@v2

View File

@@ -1,3 +1,44 @@
# Actions Toolkit
Toolkit for Docker (GitHub) Actions.
## :test_tube: Experimental
This repository is considered **EXPERIMENTAL** and under active development
until further notice. It is subject to non-backward compatible changes or
removal in any future version.
## About
This repository contains the source code for the toolkit that is consumed as
a library by most of our GitHub Actions:
* [docker/bake-action](https://github.com/docker/bake-action)
* [docker/build-push-action](https://github.com/docker/build-push-action)
* [docker/login-action](https://github.com/docker/login-action)
* [docker/metadata-action](https://github.com/docker/metadata-action)
* [docker/setup-buildx-action](https://github.com/docker/setup-buildx-action)
* [docker/setup-qemu-action](https://github.com/docker/setup-qemu-action)
This toolkit provides some utilities and common logic when developing GitHub
Actions and also acts as a minimal wrapper around our build tooling such as
[Buildx](https://github.com/docker/buildx) and [BuildKit](https://github.com/moby/buildkit)
and provides an easier API for interacting with them.
## Installation
```console
$ npm install @docker/actions-toolkit
```
## Usage
```js
const { Toolkit } = require('@docker/actions-toolkit')
const toolkit = new Toolkit()
```
## Contributing
Want to contribute to the Actions Toolkit? Awesome! You can find information
about contributing to this project in the [CONTRIBUTING.md](/.github/CONTRIBUTING.md)

View File

@@ -1,3 +1,19 @@
/**
* Copyright 2023 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 {jest} from '@jest/globals';
export const context = {

View File

@@ -1,3 +1,19 @@
/**
* Copyright 2023 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 {beforeEach, describe, expect, it, jest, test} from '@jest/globals';
import * as fs from 'fs';
import * as path from 'path';

View File

@@ -1,3 +1,19 @@
/**
* Copyright 2023 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 {describe, expect, it, jest, test, beforeEach, afterEach} from '@jest/globals';
import * as fs from 'fs';
import * as path from 'path';

View File

@@ -1,3 +1,19 @@
/**
* Copyright 2023 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 {describe, expect, it, jest, test, beforeEach, afterEach} from '@jest/globals';
import * as fs from 'fs';
import * as path from 'path';
@@ -107,12 +123,12 @@ describe('printVersion', () => {
});
});
describe('getVersion', () => {
describe('version', () => {
it('valid', async () => {
const buildx = new Buildx({
context: new Context()
});
expect(semver.valid(await buildx.version)).not.toBeNull();
expect(semver.valid(await buildx.version)).not.toBeUndefined();
});
});
@@ -257,6 +273,34 @@ describe('getProvenanceAttrs', () => {
});
});
describe('getRelease', () => {
it('returns latest buildx GitHub release', async () => {
const release = await Buildx.getRelease('latest');
expect(release).not.toBeNull();
expect(release?.tag_name).not.toEqual('');
});
it('returns v0.10.1 buildx GitHub release', async () => {
const release = await Buildx.getRelease('v0.10.1');
expect(release).not.toBeNull();
expect(release?.id).toEqual(90346950);
expect(release?.tag_name).toEqual('v0.10.1');
expect(release?.html_url).toEqual('https://github.com/docker/buildx/releases/tag/v0.10.1');
});
it('returns v0.2.2 buildx GitHub release', async () => {
const release = await Buildx.getRelease('v0.2.2');
expect(release).not.toBeNull();
expect(release?.id).toEqual(17671545);
expect(release?.tag_name).toEqual('v0.2.2');
expect(release?.html_url).toEqual('https://github.com/docker/buildx/releases/tag/v0.2.2');
});
it('unknown release', async () => {
await expect(Buildx.getRelease('foo')).rejects.toThrowError(new Error('Cannot find Buildx release foo in https://raw.githubusercontent.com/docker/buildx/master/.github/releases.json'));
});
});
describe('generateBuildSecret', () => {
test.each([
['A_SECRET=abcdef0123456789', false, 'A_SECRET', 'abcdef0123456789', null],

View File

@@ -1,3 +1,19 @@
/**
* Copyright 2023 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 path from 'path';
import rimraf from 'rimraf';

View File

@@ -1,3 +1,19 @@
/**
* Copyright 2023 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 {beforeEach, describe, expect, it, jest} from '@jest/globals';
import * as exec from '@actions/exec';

View File

@@ -1,3 +1,19 @@
/**
* Copyright 2023 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 {beforeEach, describe, expect, it, jest} from '@jest/globals';
import {Git} from '../src/git';

View File

@@ -1,3 +1,19 @@
/**
* Copyright 2023 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 {describe, expect, jest, it, beforeEach, afterEach} from '@jest/globals';
import * as fs from 'fs';
import * as path from 'path';

View File

@@ -1,3 +1,19 @@
/**
* Copyright 2023 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 {beforeEach, describe, expect, it, jest, test} from '@jest/globals';
import * as fs from 'fs';
import * as path from 'path';

View File

@@ -1,5 +1,19 @@
# syntax=docker/dockerfile:1
# Copyright 2023 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.
ARG NODE_VERSION=16
ARG DOCKER_VERSION=20.10.22
ARG BUILDX_VERSION=0.10.0

View File

@@ -1,3 +1,17 @@
// Copyright 2023 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.
group "default" {
targets = ["build"]
}
@@ -7,7 +21,7 @@ group "pre-checkin" {
}
group "validate" {
targets = ["lint", "vendor-validate"]
targets = ["lint", "vendor-validate", "license-validate"]
}
target "build" {
@@ -69,3 +83,15 @@ target "publish" {
output = ["type=cacheonly"]
secret = ["id=NODE_AUTH_TOKEN,env=NODE_AUTH_TOKEN"]
}
target "license-validate" {
dockerfile = "./hack/dockerfiles/license.Dockerfile"
target = "validate"
output = ["type=cacheonly"]
}
target "license-update" {
dockerfile = "./hack/dockerfiles/license.Dockerfile"
target = "update"
output = ["."]
}

View File

@@ -0,0 +1,47 @@
# syntax=docker/dockerfile:1
# Copyright 2023 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.
ARG LICENSE_HOLDER="actions-toolkit authors"
ARG LICENSE_TYPE="apache"
ARG LICENSE_FILES=".*\(Dockerfile\|Makefile\|\.js\|\.ts\|\.hcl\|\.sh\)"
ARG ADDLICENSE_VERSION="v1.0.0"
FROM ghcr.io/google/addlicense:${ADDLICENSE_VERSION} AS addlicense
FROM alpine:3.17 AS base
WORKDIR /src
RUN apk add --no-cache cpio findutils git
FROM base AS set
ARG LICENSE_HOLDER
ARG LICENSE_TYPE
ARG LICENSE_FILES
RUN --mount=type=bind,target=.,rw \
--mount=from=addlicense,source=/app/addlicense,target=/usr/bin/addlicense \
find . -regex "${LICENSE_FILES}" -not -path "./.yarn/*" -not -path "./node_modules/*" | xargs addlicense -c "$LICENSE_HOLDER" -l "$LICENSE_TYPE" && \
mkdir /out && \
find . -regex "${LICENSE_FILES}" -not -path "./.yarn/*" -not -path "./node_modules/*" | cpio -pdm /out
FROM scratch AS update
COPY --from=set /out /
FROM base AS validate
ARG LICENSE_HOLDER
ARG LICENSE_TYPE
ARG LICENSE_FILES
RUN --mount=type=bind,target=. \
--mount=from=addlicense,source=/app/addlicense,target=/usr/bin/addlicense \
find . -regex "${LICENSE_FILES}" -not -path "./.yarn/*" -not -path "./node_modules/*" | xargs addlicense -check -c "$LICENSE_HOLDER" -l "$LICENSE_TYPE"

View File

@@ -1,3 +1,19 @@
/**
* Copyright 2023 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.
*/
process.env = Object.assign({}, process.env, {
GITHUB_REPOSITORY: 'docker/actions-toolkit',
RUNNER_TEMP: '/tmp/github_runner',

View File

@@ -40,6 +40,7 @@
"@actions/core": "^1.10.0",
"@actions/exec": "^1.1.1",
"@actions/github": "^5.1.1",
"@actions/http-client": "^2.0.1",
"csv-parse": "^5.3.3",
"jwt-decode": "^3.1.2",
"semver": "^7.3.8",

View File

@@ -1,3 +1,19 @@
/**
* Copyright 2023 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 * as exec from '@actions/exec';
import {Buildx} from './buildx';

View File

@@ -1,3 +1,19 @@
/**
* Copyright 2023 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 * as core from '@actions/core';
import * as exec from '@actions/exec';

View File

@@ -1,13 +1,37 @@
/**
* Copyright 2023 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 path from 'path';
import * as core from '@actions/core';
import * as exec from '@actions/exec';
import * as httpm from '@actions/http-client';
import {parse} from 'csv-parse/sync';
import * as semver from 'semver';
import {Docker} from './docker';
import {Context} from './context';
export interface GitHubRelease {
id: number;
tag_name: string;
html_url: string;
assets: Array<string>;
}
export interface BuildxOpts {
context: Context;
standalone?: boolean;
@@ -15,13 +39,13 @@ export interface BuildxOpts {
export class Buildx {
private readonly context: Context;
private _version: string | undefined;
public standalone: boolean;
public version: Promise<string>;
constructor(opts: BuildxOpts) {
this.context = opts.context;
this.standalone = opts?.standalone ?? !Docker.isAvailable();
this.version = this.getVersion();
}
public getCommand(args: Array<string>) {
@@ -57,19 +81,24 @@ export class Buildx {
});
}
private async getVersion(): Promise<string> {
const cmd = this.getCommand(['version']);
return await exec
.getExecOutput(cmd.command, cmd.args, {
ignoreReturnCode: true,
silent: true
})
.then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
throw new Error(res.stderr.trim());
}
return Buildx.parseVersion(res.stdout.trim());
});
get version() {
return (async () => {
if (!this._version) {
const cmd = this.getCommand(['version']);
this._version = await exec
.getExecOutput(cmd.command, cmd.args, {
ignoreReturnCode: true,
silent: true
})
.then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
throw new Error(res.stderr.trim());
}
return Buildx.parseVersion(res.stdout.trim());
});
}
return this._version;
})();
}
public async printVersion() {
@@ -89,6 +118,9 @@ export class Buildx {
public async versionSatisfies(range: string, version?: string): Promise<boolean> {
const ver = version ?? (await this.version);
if (!ver) {
return false;
}
return semver.satisfies(ver, range) || /^[0-9a-f]{7}$/.exec(ver) !== null;
}
@@ -196,6 +228,23 @@ export class Buildx {
return `${input},builder-id=${this.context.provenanceBuilderID}`;
}
public static async getRelease(version: string): Promise<GitHubRelease> {
// FIXME: Use https://raw.githubusercontent.com/docker/actions-toolkit/main/.github/buildx-releases.json when repo public
const url = `https://raw.githubusercontent.com/docker/buildx/master/.github/releases.json`;
const http: httpm.HttpClient = new httpm.HttpClient('docker-actions-toolkit');
const resp: httpm.HttpClientResponse = await http.get(url);
const body = await resp.readBody();
const statusCode = resp.message.statusCode || 500;
if (statusCode >= 400) {
throw new Error(`Failed to get Buildx release ${version} from ${url} with status code ${statusCode}: ${body}`);
}
const releases = <Record<string, GitHubRelease>>JSON.parse(body);
if (!releases[version]) {
throw new Error(`Cannot find Buildx release ${version} in ${url}`);
}
return releases[version];
}
public static hasLocalExporter(exporters: string[]): boolean {
return Buildx.hasExporterType('local', exporters);
}

View File

@@ -1,3 +1,19 @@
/**
* Copyright 2023 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 os from 'os';
import path from 'path';

View File

@@ -1,3 +1,19 @@
/**
* Copyright 2023 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 * as exec from '@actions/exec';
export class Docker {

View File

@@ -1,3 +1,19 @@
/**
* Copyright 2023 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 * as exec from '@actions/exec';
export class Git {

View File

@@ -1,3 +1,19 @@
/**
* Copyright 2023 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 {GitHub as Octokit} from '@actions/github/lib/utils';
import * as github from '@actions/github';
import {components as OctoOpenApiTypes} from '@octokit/openapi-types';

View File

@@ -1,3 +1,19 @@
/**
* Copyright 2023 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 {Context} from './context';
import {Buildx} from './buildx';
import {BuildKit} from './buildkit';

View File

@@ -1,3 +1,19 @@
/**
* Copyright 2023 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 * as core from '@actions/core';
import {parse} from 'csv-parse/sync';

View File

@@ -744,6 +744,7 @@ __metadata:
"@actions/core": ^1.10.0
"@actions/exec": ^1.1.1
"@actions/github": ^5.1.1
"@actions/http-client": ^2.0.1
"@types/csv-parse": ^1.2.2
"@types/node": ^16.18.11
"@types/semver": ^7.3.13