Compare commits

..

119 Commits

Author SHA1 Message Date
CrazyMax 6c87dcca98 Merge pull request #94 from crazy-max/setOutput
Remove workaround for setOutput
2022-10-12 08:34:11 +02:00
CrazyMax 800ee8447d Remove workaround for setOutput
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-10-12 07:02:18 +02:00
CrazyMax a7524f88c3 Merge pull request #93 from crazy-max/fix-links
update links to docs
2022-10-07 16:44:14 +02:00
CrazyMax f589b1f80f update links to docs
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-10-07 16:41:51 +02:00
CrazyMax 1c7934bc60 Merge pull request #92 from docker/dependabot/npm_and_yarn/actions/core-1.10.0
Bump @actions/core from 1.9.1 to 1.10.0
2022-10-07 16:37:13 +02:00
CrazyMax 9e746ade7c Update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-10-07 16:32:46 +02:00
dependabot[bot] 854dbd7db9 Bump @actions/core from 1.9.1 to 1.10.0
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.9.1 to 1.10.0.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-09-29 23:15:18 +00:00
CrazyMax 0ddeddfa93 Merge pull request #89 from gforien/patch-1
docs(README): clarify default value for 'target'
2022-09-01 17:19:14 +02:00
CrazyMax b07b164d66 Merge pull request #90 from docker/dependabot/npm_and_yarn/actions/core-1.9.1
Bump @actions/core from 1.9.0 to 1.9.1
2022-08-24 13:16:34 +02:00
CrazyMax 7ee4a98a55 Update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-08-24 12:30:01 +02:00
dependabot[bot] 8db227756f Bump @actions/core from 1.9.0 to 1.9.1
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.9.0 to 1.9.1.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-08 23:10:12 +00:00
Gabriel Forien d7ce3c3dac docs(README): clarify default value for 'target'
Signed-off-by: Gabriel Forien <gforien@users.noreply.github.com>
2022-08-02 18:23:38 +02:00
CrazyMax e878ca2dca Merge pull request #86 from docker/dependabot/npm_and_yarn/csv-parse-5.3.0
Bump csv-parse from 5.2.0 to 5.3.0
2022-07-19 16:58:28 +02:00
CrazyMax 3123696764 Update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-07-19 16:53:32 +02:00
dependabot[bot] c22ea4a824 Bump csv-parse from 5.2.0 to 5.3.0
Bumps [csv-parse](https://github.com/adaltas/node-csv/tree/HEAD/packages/csv-parse) from 5.2.0 to 5.3.0.
- [Release notes](https://github.com/adaltas/node-csv/releases)
- [Changelog](https://github.com/adaltas/node-csv/blob/master/packages/csv-parse/CHANGELOG.md)
- [Commits](https://github.com/adaltas/node-csv/commits/csv-parse@5.3.0/packages/csv-parse)

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>

---
updated-dependencies:
- dependency-name: csv-parse
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-07-19 16:53:14 +02:00
CrazyMax 5cb4f0eeb6 Merge pull request #76 from tuler/feature/working-directory
Add workdir option
2022-07-19 16:18:47 +02:00
Danilo Tuler e917a42053 Add working-directory option
Signed-off-by: Danilo Tuler <tuler@pobox.com>
2022-07-11 09:40:50 -04:00
CrazyMax c7fa0af149 Merge pull request #80 from docker/dependabot/npm_and_yarn/actions/core-1.9.0
Bump @actions/core from 1.8.2 to 1.9.0
2022-06-25 13:37:49 +02:00
CrazyMax 41e0cbc69d Update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-06-25 13:29:56 +02:00
dependabot[bot] d6fc753959 Bump @actions/core from 1.8.2 to 1.9.0
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.8.2 to 1.9.0.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-25 11:28:54 +00:00
CrazyMax 7c9d36984e Merge pull request #79 from docker/dependabot/npm_and_yarn/csv-parse-5.2.0
Bump csv-parse from 5.1.0 to 5.2.0
2022-06-25 13:24:06 +02:00
CrazyMax 064f6ed0d0 Update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-06-25 13:21:59 +02:00
dependabot[bot] d666a2cf09 Bump csv-parse from 5.1.0 to 5.2.0
Bumps [csv-parse](https://github.com/adaltas/node-csv/tree/HEAD/packages/csv-parse) from 5.1.0 to 5.2.0.
- [Release notes](https://github.com/adaltas/node-csv/releases)
- [Changelog](https://github.com/adaltas/node-csv/blob/master/packages/csv-parse/CHANGELOG.md)
- [Commits](https://github.com/adaltas/node-csv/commits/csv-parse@5.2.0/packages/csv-parse)

---
updated-dependencies:
- dependency-name: csv-parse
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-25 11:19:06 +00:00
CrazyMax eff809a17c Merge pull request #82 from crazy-max/remote
read bake definition files from remote context support
2022-06-25 13:17:32 +02:00
CrazyMax bb2d1b0aab support building from remote bake definition
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-06-24 10:56:57 +02:00
CrazyMax 438d016327 Merge pull request #77 from docker/dependabot/npm_and_yarn/csv-parse-5.1.0
Bump csv-parse from 5.0.4 to 5.1.0
2022-06-07 11:46:20 +02:00
CrazyMax 9e1a3e1d40 Update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-06-07 11:34:55 +02:00
dependabot[bot] 4cfa3a6cb8 Bump csv-parse from 5.0.4 to 5.1.0
Bumps [csv-parse](https://github.com/adaltas/node-csv/tree/HEAD/packages/csv-parse) from 5.0.4 to 5.1.0.
- [Release notes](https://github.com/adaltas/node-csv/releases)
- [Changelog](https://github.com/adaltas/node-csv/blob/master/packages/csv-parse/CHANGELOG.md)
- [Commits](https://github.com/adaltas/node-csv/commits/csv-parse@5.1.0/packages/csv-parse)

---
updated-dependencies:
- dependency-name: csv-parse
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-07 09:30:26 +00:00
CrazyMax e12a6ceedb Merge pull request #75 from docker/dependabot/npm_and_yarn/actions/core-1.8.2
Bump @actions/core from 1.6.0 to 1.8.2
2022-06-07 11:27:19 +02:00
CrazyMax 7138010b3f Update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-06-07 11:25:48 +02:00
CrazyMax dbecd73e13 Merge pull request #78 from crazy-max/bump-actions
Bump actions to latest major
2022-06-07 11:21:34 +02:00
CrazyMax 167801e346 Bump actions to latest major
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-05-28 18:35:39 +02:00
dependabot[bot] d125e2ebd4 Bump @actions/core from 1.6.0 to 1.8.2
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.6.0 to 1.8.2.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-13 23:08:43 +00:00
CrazyMax e073915f07 Merge pull request #72 from crazy-max/update-refs
Bump all Docker actions to latest major
2022-05-05 19:46:05 +02:00
CrazyMax 1721b445f7 Bump all Docker actions to latest major
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-05-05 19:40:03 +02:00
CrazyMax fb56172975 Merge pull request #64 from crazy-max/node-16
Node 16 as default runtime
2022-05-05 18:49:48 +02:00
CrazyMax ca6596ad15 Merge pull request #71 from crazy-max/standalone-mode
Standalone mode
2022-05-05 18:11:43 +02:00
CrazyMax c121dca31f Node 16 as default runtime
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-05-04 14:58:10 +02:00
CrazyMax 9c6bfbc781 Standalone mode
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-05-04 14:53:33 +02:00
CrazyMax 5595f90323 Merge pull request #57 from docker/dependabot/npm_and_yarn/csv-parse-5.0.4
Bump csv-parse from 4.16.3 to 5.0.4
2022-05-04 14:43:26 +02:00
CrazyMax 407697c3b6 Update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-05-04 14:42:14 +02:00
CrazyMax 59dbafda38 Fix csv-parse implementation since major update
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-05-04 14:41:37 +02:00
dependabot[bot] c1f4007e50 Bump csv-parse from 4.16.3 to 5.0.4
Bumps [csv-parse](https://github.com/adaltas/node-csv/tree/HEAD/packages/csv-parse) from 4.16.3 to 5.0.4.
- [Release notes](https://github.com/adaltas/node-csv/releases)
- [Changelog](https://github.com/adaltas/node-csv/blob/master/packages/csv-parse/CHANGELOG.md)
- [Commits](https://github.com/adaltas/node-csv/commits/csv-parse@5.0.4/packages/csv-parse)

---
updated-dependencies:
- dependency-name: csv-parse
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-05-04 12:34:19 +00:00
CrazyMax cd0aebd16f Merge pull request #69 from docker/dependabot/npm_and_yarn/semver-7.3.7
Bump semver from 7.3.5 to 7.3.7
2022-05-04 14:33:14 +02:00
CrazyMax ff957d7e96 Update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-05-04 14:30:52 +02:00
dependabot[bot] d94018588a Bump semver from 7.3.5 to 7.3.7
Bumps [semver](https://github.com/npm/node-semver) from 7.3.5 to 7.3.7.
- [Release notes](https://github.com/npm/node-semver/releases)
- [Changelog](https://github.com/npm/node-semver/blob/main/CHANGELOG.md)
- [Commits](https://github.com/npm/node-semver/compare/v7.3.5...v7.3.7)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-18 17:25:56 +00:00
CrazyMax c530c36c51 Merge pull request #67 from docker/dependabot/github_actions/codecov/codecov-action-3
Bump codecov/codecov-action from 2 to 3
2022-04-18 19:24:37 +02:00
dependabot[bot] 287a08aec7 Bump codecov/codecov-action from 2 to 3
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 2 to 3.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v2...v3)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-04-05 23:07:10 +00:00
CrazyMax 119910966f Merge pull request #66 from docker/dependabot/npm_and_yarn/minimist-1.2.6
Bump minimist from 1.2.5 to 1.2.6
2022-03-28 15:55:45 +02:00
dependabot[bot] b337982c57 Bump minimist from 1.2.5 to 1.2.6
Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6.
- [Release notes](https://github.com/substack/minimist/releases)
- [Commits](https://github.com/substack/minimist/compare/1.2.5...1.2.6)

---
updated-dependencies:
- dependency-name: minimist
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-28 02:52:25 +00:00
CrazyMax c468a05d33 Merge pull request #63 from crazy-max/update-dev
chore: update dev dependencies and workflow
2022-03-21 11:32:37 +01:00
CrazyMax 0be89e2a27 chore: update dev dependencies and workflow
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-03-21 11:28:57 +01:00
CrazyMax aa644192e4 Merge pull request #62 from docker/dependabot/npm_and_yarn/actions/exec-1.1.1
Bump @actions/exec from 1.1.0 to 1.1.1
2022-03-21 08:47:37 +01:00
dependabot[bot] 09f44a64e2 Bump @actions/exec from 1.1.0 to 1.1.1
Bumps [@actions/exec](https://github.com/actions/toolkit/tree/HEAD/packages/exec) from 1.1.0 to 1.1.1.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/exec/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/@actions/tool-cache@1.1.1/packages/exec)

---
updated-dependencies:
- dependency-name: "@actions/exec"
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-17 23:08:28 +00:00
CrazyMax ccbb2dbf9a Merge pull request #60 from docker/dependabot/github_actions/actions/checkout-3
Bump actions/checkout from 2 to 3
2022-03-02 07:33:05 +01:00
dependabot[bot] 4c417fb398 Bump actions/checkout from 2 to 3
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-03-01 23:10:09 +00:00
CrazyMax bbd00fcb02 Merge pull request #59 from crazy-max/outputs
Enhance outputs display
2022-02-09 11:42:06 +01:00
CrazyMax 7ca0f811df Enhance outputs display
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2022-02-09 11:36:24 +01:00
CrazyMax bdefe3d1ff Merge pull request #54 from crazy-max/update-workflow
dev: update workflow
2021-11-16 21:26:20 +01:00
CrazyMax 2f728db4a6 dev: update workflow
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-11-16 21:24:44 +01:00
CrazyMax 5ee43f548f Merge pull request #52 from docker/dependabot/npm_and_yarn/actions/core-1.6.0
Bump @actions/core from 1.5.0 to 1.6.0
2021-10-04 13:09:59 +02:00
CrazyMax fe4ca100f9 Update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-10-04 13:08:57 +02:00
dependabot[bot] 2829b1c434 Bump @actions/core from 1.5.0 to 1.6.0
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.5.0 to 1.6.0.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-28 23:06:58 +00:00
CrazyMax 0496f170c9 Merge pull request #51 from crazy-max/fix-outputs
Don't set outputs if empty or nil
2021-09-24 17:24:20 +02:00
CrazyMax 6bbb1022a9 Don't set outputs if empty or nil
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-09-24 17:22:41 +02:00
CrazyMax 68e5c3e3da Merge pull request #50 from docker/dependabot/npm_and_yarn/ansi-regex-5.0.1
Bump ansi-regex from 5.0.0 to 5.0.1
2021-09-24 14:52:37 +02:00
dependabot[bot] e8895fb882 Bump ansi-regex from 5.0.0 to 5.0.1
Bumps [ansi-regex](https://github.com/chalk/ansi-regex) from 5.0.0 to 5.0.1.
- [Release notes](https://github.com/chalk/ansi-regex/releases)
- [Commits](https://github.com/chalk/ansi-regex/compare/v5.0.0...v5.0.1)

---
updated-dependencies:
- dependency-name: ansi-regex
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-24 12:06:46 +00:00
CrazyMax 004ba1a211 Merge pull request #49 from docker/dependabot/npm_and_yarn/tmpl-1.0.5
Bump tmpl from 1.0.4 to 1.0.5
2021-09-24 14:06:21 +02:00
dependabot[bot] 837b8bf53e Bump tmpl from 1.0.4 to 1.0.5
Bumps [tmpl](https://github.com/daaku/nodejs-tmpl) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/daaku/nodejs-tmpl/releases)
- [Commits](https://github.com/daaku/nodejs-tmpl/commits/v1.0.5)

---
updated-dependencies:
- dependency-name: tmpl
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-22 02:56:01 +00:00
CrazyMax bf8ce2e8a5 Merge pull request #48 from docker/dependabot/npm_and_yarn/csv-parse-4.16.3
Bump csv-parse from 4.16.2 to 4.16.3
2021-09-03 14:06:41 +02:00
CrazyMax 36db8814f9 Update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-09-03 13:32:19 +02:00
dependabot[bot] 21bf2cd4f9 Bump csv-parse from 4.16.2 to 4.16.3
Bumps [csv-parse](https://github.com/wdavidw/node-csv-parse) from 4.16.2 to 4.16.3.
- [Release notes](https://github.com/wdavidw/node-csv-parse/releases)
- [Commits](https://github.com/wdavidw/node-csv-parse/commits)

---
updated-dependencies:
- dependency-name: csv-parse
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-03 11:16:30 +00:00
CrazyMax e9c151ca15 Merge pull request #47 from crazy-max/fix-dep-labels
Fix Dependabot labels
2021-09-03 13:14:36 +02:00
CrazyMax c784c4d8b1 Fix Dependabot labels
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-09-03 13:13:19 +02:00
CrazyMax dcd8d36f88 Merge pull request #46 from crazy-max/metadata-output
Add `metadata` output
2021-09-01 22:48:07 +02:00
CrazyMax a0a15756c1 Add metadata output
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-09-01 22:22:37 +02:00
CrazyMax 98b5deaddd Merge pull request #45 from docker/dependabot/npm_and_yarn/csv-parse-4.16.2
Bump csv-parse from 4.16.0 to 4.16.2
2021-09-01 21:27:35 +02:00
CrazyMax 5b8cde2fbd Update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-09-01 21:26:02 +02:00
dependabot[bot] 410f4f540c Bump csv-parse from 4.16.0 to 4.16.2
Bumps [csv-parse](https://github.com/wdavidw/node-csv-parse) from 4.16.0 to 4.16.2.
- [Release notes](https://github.com/wdavidw/node-csv-parse/releases)
- [Commits](https://github.com/wdavidw/node-csv-parse/commits)

---
updated-dependencies:
- dependency-name: csv-parse
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-27 23:06:10 +00:00
CrazyMax 91c18da590 Merge pull request #43 from docker/dependabot/npm_and_yarn/actions/core-1.5.0
Bump @actions/core from 1.4.0 to 1.5.0
2021-08-20 10:30:48 +02:00
CrazyMax 609f117fec Update generated content
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-08-20 10:28:24 +02:00
dependabot[bot] 2953be5ac1 Bump @actions/core from 1.4.0 to 1.5.0
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.4.0 to 1.5.0.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-19 23:06:17 +00:00
CrazyMax 89abadbeeb Merge pull request #42 from docker/dependabot/github_actions/codecov/codecov-action-2.0.1
Bump codecov/codecov-action from 1 to 2.0.1
2021-07-23 08:13:10 +02:00
CrazyMax 1a17085ee0 Use major
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-07-23 08:03:41 +02:00
CrazyMax 7b94dc08d3 Merge pull request #41 from crazy-max/update-deps
Use official images
2021-07-20 10:35:07 +02:00
dependabot[bot] 20658a308a Bump codecov/codecov-action from 1 to 2.0.1
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 1 to 2.0.1.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v1...v2.0.1)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-19 23:07:55 +00:00
CrazyMax da59009d0e Use official images
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-07-19 22:09:02 +02:00
CrazyMax f7388a10c4 Merge pull request #39 from crazy-max/trim
Ensure trimmed output
2021-07-01 17:10:11 +02:00
CrazyMax 3393b5e7fd Ensure trimmed output
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-07-01 17:02:30 +02:00
CrazyMax 33dc2d98dd Merge pull request #38 from crazy-max/dev-deps
Update dev deps
2021-07-01 16:28:46 +02:00
CrazyMax 4fcbc3332c Update dev deps
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-07-01 16:27:24 +02:00
CrazyMax 3d805bc4f5 Merge pull request #37 from crazy-max/sha-version
Handle git sha version of buildx
2021-07-01 15:49:21 +02:00
CrazyMax c77e0eff0f Handle git sha version of buildx
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
2021-07-01 15:48:15 +02:00
CrazyMax 74b5bf4701 Merge pull request #31 from docker/dependabot/npm_and_yarn/csv-parse-4.16.0
Bump csv-parse from 4.15.4 to 4.16.0
2021-06-23 09:45:25 +02:00
CrazyMax 4a1f508591 Update generated content 2021-06-23 09:43:36 +02:00
dependabot[bot] 8d5272f093 Bump csv-parse from 4.15.4 to 4.16.0
Bumps [csv-parse](https://github.com/wdavidw/node-csv-parse) from 4.15.4 to 4.16.0.
- [Release notes](https://github.com/wdavidw/node-csv-parse/releases)
- [Changelog](https://github.com/adaltas/node-csv-parse/blob/master/CHANGELOG.md)
- [Commits](https://github.com/wdavidw/node-csv-parse/compare/v4.15.4...v4.16.0)

---
updated-dependencies:
- dependency-name: csv-parse
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-22 20:59:51 +00:00
CrazyMax c908037be2 Merge pull request #35 from docker/dependabot/npm_and_yarn/y18n-4.0.3
Bump y18n from 4.0.0 to 4.0.3
2021-06-22 22:57:17 +02:00
dependabot[bot] 5ceddd8495 Bump y18n from 4.0.0 to 4.0.3
Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.3.
- [Release notes](https://github.com/yargs/y18n/releases)
- [Changelog](https://github.com/yargs/y18n/blob/y18n-v4.0.3/CHANGELOG.md)
- [Commits](https://github.com/yargs/y18n/compare/v4.0.0...y18n-v4.0.3)

---
updated-dependencies:
- dependency-name: y18n
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-22 20:55:50 +00:00
CrazyMax 38982d27cc Merge pull request #34 from docker/dependabot/npm_and_yarn/hosted-git-info-2.8.9
Bump hosted-git-info from 2.8.8 to 2.8.9
2021-06-22 22:55:17 +02:00
CrazyMax 033443ab2c Merge pull request #33 from docker/dependabot/npm_and_yarn/lodash-4.17.21
Bump lodash from 4.17.20 to 4.17.21
2021-06-22 22:54:58 +02:00
CrazyMax a7b14f646b Merge pull request #32 from docker/dependabot/npm_and_yarn/ws-7.5.0
Bump ws from 7.3.1 to 7.5.0
2021-06-22 22:54:39 +02:00
dependabot[bot] 880189ca1f Bump hosted-git-info from 2.8.8 to 2.8.9
Bumps [hosted-git-info](https://github.com/npm/hosted-git-info) from 2.8.8 to 2.8.9.
- [Release notes](https://github.com/npm/hosted-git-info/releases)
- [Changelog](https://github.com/npm/hosted-git-info/blob/v2.8.9/CHANGELOG.md)
- [Commits](https://github.com/npm/hosted-git-info/compare/v2.8.8...v2.8.9)

---
updated-dependencies:
- dependency-name: hosted-git-info
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-22 20:50:25 +00:00
dependabot[bot] a2b91d7672 Bump lodash from 4.17.20 to 4.17.21
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.20 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.20...4.17.21)

---
updated-dependencies:
- dependency-name: lodash
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-22 20:50:23 +00:00
dependabot[bot] 7f1b11fb20 Bump ws from 7.3.1 to 7.5.0
Bumps [ws](https://github.com/websockets/ws) from 7.3.1 to 7.5.0.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.3.1...7.5.0)

---
updated-dependencies:
- dependency-name: ws
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-22 20:50:21 +00:00
CrazyMax 824561b50c Merge pull request #30 from crazy-max/exec-output
Use built-in `getExecOutput`
2021-06-08 20:42:16 +02:00
CrazyMax daeb9547f2 Use built-in getExecOutput 2021-06-08 20:40:26 +02:00
CrazyMax 707dc1fa84 Merge pull request #28 from docker/dependabot/npm_and_yarn/actions/exec-1.1.0
Bump @actions/exec from 1.0.4 to 1.1.0
2021-06-08 19:25:46 +02:00
CrazyMax 58a8cb0c8c Update generated content 2021-06-08 19:24:33 +02:00
dependabot[bot] df5b1778c1 Bump @actions/exec from 1.0.4 to 1.1.0
Bumps [@actions/exec](https://github.com/actions/toolkit/tree/HEAD/packages/exec) from 1.0.4 to 1.1.0.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/exec/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/@actions/core@1.1.0/packages/exec)

---
updated-dependencies:
- dependency-name: "@actions/exec"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-08 17:13:44 +00:00
CrazyMax bb694a8953 Merge pull request #29 from docker/dependabot/npm_and_yarn/actions/core-1.4.0
Bump @actions/core from 1.3.0 to 1.4.0
2021-06-08 19:12:17 +02:00
CrazyMax c27391d5ef Update generated content 2021-06-08 19:08:32 +02:00
dependabot[bot] 05e2f42a81 Bump @actions/core from 1.3.0 to 1.4.0
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.3.0 to 1.4.0.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

---
updated-dependencies:
- dependency-name: "@actions/core"
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-08 06:16:32 +00:00
CrazyMax 03bdd49965 Merge pull request #27 from crazy-max/bool-input
Use `core.getBooleanInput`
2021-05-26 15:25:24 +02:00
CrazyMax 41a29e21ad Use core.getBooleanInput 2021-05-26 15:22:22 +02:00
CrazyMax e0c37242bd Merge pull request #26 from docker/dependabot/npm_and_yarn/actions/core-1.3.0
Bump @actions/core from 1.2.7 to 1.3.0
2021-05-24 23:54:54 +02:00
CrazyMax 68d82b0527 Update generated content 2021-05-24 23:51:39 +02:00
dependabot[bot] 422e39df00 Bump @actions/core from 1.2.7 to 1.3.0
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.2.7 to 1.3.0.
- [Release notes](https://github.com/actions/toolkit/releases)
- [Changelog](https://github.com/actions/toolkit/blob/main/packages/core/RELEASES.md)
- [Commits](https://github.com/actions/toolkit/commits/HEAD/packages/core)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-24 07:28:36 +00:00
CrazyMax 180a839280 Merge pull request #25 from crazy-max/throw-error
Throw error message instead of exit code
2021-05-14 02:26:52 +02:00
CrazyMax a2173f5d12 Throw error message instead of exit code 2021-05-14 02:10:58 +02:00
32 changed files with 3053 additions and 8994 deletions
+23
View File
@@ -0,0 +1,23 @@
{
"env": {
"node": true,
"es2021": true,
"jest/globals": true
},
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
"plugin:jest/recommended",
"plugin:prettier/recommended"
],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": "latest",
"sourceType": "module"
},
"plugins": [
"@typescript-eslint",
"jest",
"prettier"
]
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

+4 -4
View File
@@ -5,8 +5,8 @@ updates:
schedule: schedule:
interval: "daily" interval: "daily"
labels: labels:
- ":game_die: dependencies" - "dependencies"
- ":robot: bot" - "bot"
- package-ecosystem: "npm" - package-ecosystem: "npm"
directory: "/" directory: "/"
schedule: schedule:
@@ -14,5 +14,5 @@ updates:
allow: allow:
- dependency-type: "production" - dependency-type: "production"
labels: labels:
- ":game_die: dependencies" - "dependencies"
- ":robot: bot" - "bot"
+53 -12
View File
@@ -31,14 +31,14 @@ jobs:
steps: steps:
- -
name: Checkout name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
- -
name: Set up QEMU name: Set up QEMU
uses: docker/setup-qemu-action@v1 uses: docker/setup-qemu-action@v2
- -
name: Set up Docker Buildx name: Set up Docker Buildx
id: buildx id: buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v2
with: with:
driver-opts: network=host driver-opts: network=host
- -
@@ -51,17 +51,29 @@ jobs:
targets: | targets: |
${{ matrix.target }} ${{ matrix.target }}
push: false # set to true when https://github.com/docker/buildx/issues/179 is fixed push: false # set to true when https://github.com/docker/buildx/issues/179 is fixed
-
name: Dump context
if: always()
uses: crazy-max/ghaction-dump-context@v1
error: error-msg:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- -
name: Checkout name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
-
name: Build
continue-on-error: true
uses: ./
with:
files: |
./test/config.hcl
set: |
*.platform=linux/amd64,linux/ppc64le,linux/s390x
error-check:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
- -
name: Stop docker name: Stop docker
run: | run: |
@@ -82,7 +94,36 @@ jobs:
echo "::error::Should have failed" echo "::error::Should have failed"
exit 1 exit 1
fi fi
standalone:
runs-on: ubuntu-latest
steps:
- -
name: Dump context name: Checkout
if: always() uses: actions/checkout@v3
uses: crazy-max/ghaction-dump-context@v1 -
name: Uninstall moby cli
run: |
sudo apt-get purge -y moby-cli moby-buildx
-
name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
-
name: Build
uses: ./
with:
files: |
./test/config.hcl
source:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v3
-
name: Build
uses: ./
with:
source: https://github.com/docker/buildx.git#v0.8.2
targets: update-docs
+3 -3
View File
@@ -16,14 +16,14 @@ jobs:
steps: steps:
- -
name: Checkout name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
- -
name: Test name: Test
uses: docker/bake-action@v1 uses: docker/bake-action@v2
with: with:
targets: test targets: test
- -
name: Upload coverage name: Upload coverage
uses: codecov/codecov-action@v1 uses: codecov/codecov-action@v3
with: with:
file: ./coverage/clover.xml file: ./coverage/clover.xml
+2 -2
View File
@@ -16,9 +16,9 @@ jobs:
steps: steps:
- -
name: Checkout name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
- -
name: Validate name: Validate
uses: docker/bake-action@v1 uses: docker/bake-action@v2
with: with:
targets: validate targets: validate
+1 -1
View File
@@ -1,5 +1,5 @@
{ {
"printWidth": 120, "printWidth": 240,
"tabWidth": 2, "tabWidth": 2,
"useTabs": false, "useTabs": false,
"semi": true, "semi": true,
+35 -32
View File
@@ -5,21 +5,25 @@
## :test_tube: Experimental ## :test_tube: Experimental
This repository is considered **EXPERIMENTAL** and under active development until further notice. It is subject to This repository is considered **EXPERIMENTAL** and under active development
non-backward compatible changes or removal in any future version so you should [pin to a specific tag/commit](https://docs.github.com/en/actions/creating-actions/about-actions#using-tags-for-release-management) until further notice. It is subject to non-backward compatible changes or
of this action in your workflow (i.e `docker/bake-action@v1.1.3`). removal in any future version, so you should [pin to a specific tag/commit](https://docs.github.com/en/actions/creating-actions/about-actions#using-tags-for-release-management)
of this action in your workflow (i.e `docker/bake-action@v1.1.3`).
## About ## About
GitHub Action to use Docker [Buildx Bake](https://github.com/docker/buildx/blob/master/docs/reference/buildx_bake.md) GitHub Action to use Docker [Buildx Bake](https://docs.docker.com/build/customize/bake/)
as a high-level build command. as a high-level build command.
![Screenshot](.github/bake-action.png)
___ ___
* [Usage](#usage) * [Usage](#usage)
* [Customizing](#customizing) * [Customizing](#customizing)
* [inputs](#inputs) * [inputs](#inputs)
* [Keep up-to-date with GitHub Dependabot](#keep-up-to-date-with-github-dependabot) * [outputs](#outputs)
* [Contributing](#contributing)
## Usage ## Usage
@@ -37,19 +41,19 @@ jobs:
steps: steps:
- -
name: Checkout name: Checkout
uses: actions/checkout@v2 uses: actions/checkout@v3
- -
name: Set up Docker Buildx name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1 uses: docker/setup-buildx-action@v2
- -
name: Login to DockerHub name: Login to DockerHub
uses: docker/login-action@v1 uses: docker/login-action@v2
with: with:
username: ${{ secrets.DOCKERHUB_USERNAME }} username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }} password: ${{ secrets.DOCKERHUB_TOKEN }}
- -
name: Build and push name: Build and push
uses: docker/bake-action@master uses: docker/bake-action@v2
with: with:
push: true push: true
``` ```
@@ -75,29 +79,28 @@ Following inputs can be used as `step.with` keys
> targets: default,release > targets: default,release
> ``` > ```
| Name | Type | Description | | Name | Type | Description |
|------------------|----------|------------------------------------| |------------|----------|---------------------------------------------------------------------------------------------------------------------------------------------|
| `builder` | String | Builder instance (see [setup-buildx](https://github.com/docker/setup-buildx-action) action) | | `builder` | String | Builder instance (see [setup-buildx](https://github.com/docker/setup-buildx-action) action) |
| `files` | List/CSV | List of [bake definition files](https://github.com/docker/buildx/blob/master/docs/reference/buildx_bake.md#file) | | `files` | List/CSV | List of [bake definition files](https://docs.docker.com/build/customize/bake/file-definition/) |
| `targets` | List/CSV | List of bake targets | | `workdir` | String | Working directory of execution |
| `no-cache` | Bool | Do not use cache when building the image (default `false`) | | `targets` | List/CSV | List of bake targets (`default` target used if empty) |
| `pull` | Bool | Always attempt to pull a newer version of the image (default `false`) | | `no-cache` | Bool | Do not use cache when building the image (default `false`) |
| `load` | Bool | Load is a shorthand for `--set=*.output=type=docker` (default `false`) | | `pull` | Bool | Always attempt to pull a newer version of the image (default `false`) |
| `push` | Bool | Push is a shorthand for `--set=*.output=type=registry` (default `false`) | | `load` | Bool | Load is a shorthand for `--set=*.output=type=docker` (default `false`) |
| `set` | List | List of [targets values to override](https://github.com/docker/buildx/blob/master/docs/reference/buildx_bake.md#set) (eg: `targetpattern.key=value`) | | `push` | Bool | Push is a shorthand for `--set=*.output=type=registry` (default `false`) |
| `set` | List | List of [targets values to override](https://docs.docker.com/engine/reference/commandline/buildx_bake/#set) (eg: `targetpattern.key=value`) |
| `source` | String | [Remote bake definition](https://docs.docker.com/build/customize/bake/file-definition/#remote-definition) to build from |
## Keep up-to-date with GitHub Dependabot ### outputs
Since [Dependabot](https://docs.github.com/en/github/administering-a-repository/keeping-your-actions-up-to-date-with-github-dependabot) Following outputs are available
has [native GitHub Actions support](https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#package-ecosystem),
to enable it on your GitHub repo all you need to do is add the `.github/dependabot.yml` file:
```yaml | Name | Type | Description |
version: 2 |------------|------|-----------------------|
updates: | `metadata` | JSON | Build result metadata |
# Maintain dependencies for GitHub Actions
- package-ecosystem: "github-actions" ## Contributing
directory: "/"
schedule: Want to contribute? Awesome! You can find information about contributing to
interval: "daily" this project in the [CONTRIBUTING.md](/.github/CONTRIBUTING.md)
```
+57 -5
View File
@@ -1,12 +1,63 @@
import {describe, expect, it, jest, test} from '@jest/globals';
import * as fs from 'fs';
import * as path from 'path';
import * as semver from 'semver'; import * as semver from 'semver';
import * as buildx from '../src/buildx';
import * as exec from '@actions/exec'; import * as exec from '@actions/exec';
import * as buildx from '../src/buildx';
import * as context from '../src/context';
const tmpNameSync = path.join('/tmp/.docker-bake-jest', '.tmpname-jest').split(path.sep).join(path.posix.sep);
const metadata = `{
"containerimage.config.digest": "sha256:059b68a595b22564a1cbc167af369349fdc2ecc1f7bc092c2235cbf601a795fd",
"containerimage.digest": "sha256:b09b9482c72371486bb2c1d2c2a2633ed1d0b8389e12c8d52b9e052725c0c83c"
}`;
jest.spyOn(context, 'tmpDir').mockImplementation((): string => {
const tmpDir = path.join('/tmp/.docker-bake-jest').split(path.sep).join(path.posix.sep);
if (!fs.existsSync(tmpDir)) {
fs.mkdirSync(tmpDir, {recursive: true});
}
return tmpDir;
});
jest.spyOn(context, 'tmpNameSync').mockImplementation((): string => {
return tmpNameSync;
});
describe('getMetadata', () => {
it('matches', async () => {
const metadataFile = await buildx.getMetadataFile();
await fs.writeFileSync(metadataFile, metadata);
const expected = await buildx.getMetadata();
expect(expected).toEqual(metadata);
});
});
describe('isAvailable', () => {
const execSpy = jest.spyOn(exec, 'getExecOutput');
buildx.isAvailable();
// eslint-disable-next-line jest/no-standalone-expect
expect(execSpy).toHaveBeenCalledWith(`docker`, ['buildx'], {
silent: true,
ignoreReturnCode: true
});
});
describe('isAvailable standalone', () => {
const execSpy = jest.spyOn(exec, 'getExecOutput');
buildx.isAvailable(true);
// eslint-disable-next-line jest/no-standalone-expect
expect(execSpy).toHaveBeenCalledWith(`buildx`, [], {
silent: true,
ignoreReturnCode: true
});
});
describe('getVersion', () => { describe('getVersion', () => {
it('valid', async () => { it('valid', async () => {
await exec.exec('docker', ['buildx', 'version']);
const version = await buildx.getVersion(); const version = await buildx.getVersion();
console.log(`version: ${version}`);
expect(semver.valid(version)).not.toBeNull(); expect(semver.valid(version)).not.toBeNull();
}, 100000); }, 100000);
}); });
@@ -15,8 +66,9 @@ describe('parseVersion', () => {
test.each([ test.each([
['github.com/docker/buildx 0.4.1+azure bda4882a65349ca359216b135896bddc1d92461c', '0.4.1'], ['github.com/docker/buildx 0.4.1+azure bda4882a65349ca359216b135896bddc1d92461c', '0.4.1'],
['github.com/docker/buildx v0.4.1 bda4882a65349ca359216b135896bddc1d92461c', '0.4.1'], ['github.com/docker/buildx v0.4.1 bda4882a65349ca359216b135896bddc1d92461c', '0.4.1'],
['github.com/docker/buildx v0.4.2 fb7b670b764764dc4716df3eba07ffdae4cc47b2', '0.4.2'] ['github.com/docker/buildx v0.4.2 fb7b670b764764dc4716df3eba07ffdae4cc47b2', '0.4.2'],
['github.com/docker/buildx f117971 f11797113e5a9b86bd976329c5dbb8a8bfdfadfa', 'f117971']
])('given %p', async (stdout, expected) => { ])('given %p', async (stdout, expected) => {
expect(await buildx.parseVersion(stdout)).toEqual(expected); expect(buildx.parseVersion(stdout)).toEqual(expected);
}); });
}); });
+17 -65
View File
@@ -1,67 +1,58 @@
import * as os from 'os'; import {describe, expect, it} from '@jest/globals';
import * as context from '../src/context'; import * as context from '../src/context';
describe('getInputList', () => { describe('getInputList', () => {
it('single line correctly', async () => { it('single line correctly', async () => {
await setInput('foo', 'bar'); await setInput('foo', 'bar');
const res = await context.getInputList('foo'); const res = context.getInputList('foo');
console.log(res);
expect(res).toEqual(['bar']); expect(res).toEqual(['bar']);
}); });
it('multiline correctly', async () => { it('multiline correctly', async () => {
setInput('foo', 'bar\nbaz'); setInput('foo', 'bar\nbaz');
const res = await context.getInputList('foo'); const res = context.getInputList('foo');
console.log(res);
expect(res).toEqual(['bar', 'baz']); expect(res).toEqual(['bar', 'baz']);
}); });
it('empty lines correctly', async () => { it('empty lines correctly', async () => {
setInput('foo', 'bar\n\nbaz'); setInput('foo', 'bar\n\nbaz');
const res = await context.getInputList('foo'); const res = context.getInputList('foo');
console.log(res);
expect(res).toEqual(['bar', 'baz']); expect(res).toEqual(['bar', 'baz']);
}); });
it('comma correctly', async () => { it('comma correctly', async () => {
setInput('foo', 'bar,baz'); setInput('foo', 'bar,baz');
const res = await context.getInputList('foo'); const res = context.getInputList('foo');
console.log(res);
expect(res).toEqual(['bar', 'baz']); expect(res).toEqual(['bar', 'baz']);
}); });
it('empty result correctly', async () => { it('empty result correctly', async () => {
setInput('foo', 'bar,baz,'); setInput('foo', 'bar,baz,');
const res = await context.getInputList('foo'); const res = context.getInputList('foo');
console.log(res);
expect(res).toEqual(['bar', 'baz']); expect(res).toEqual(['bar', 'baz']);
}); });
it('different new lines correctly', async () => { it('different new lines correctly', async () => {
setInput('foo', 'bar\r\nbaz'); setInput('foo', 'bar\r\nbaz');
const res = await context.getInputList('foo'); const res = context.getInputList('foo');
console.log(res);
expect(res).toEqual(['bar', 'baz']); expect(res).toEqual(['bar', 'baz']);
}); });
it('different new lines and comma correctly', async () => { it('different new lines and comma correctly', async () => {
setInput('foo', 'bar\r\nbaz,bat'); setInput('foo', 'bar\r\nbaz,bat');
const res = await context.getInputList('foo'); const res = context.getInputList('foo');
console.log(res);
expect(res).toEqual(['bar', 'baz', 'bat']); expect(res).toEqual(['bar', 'baz', 'bat']);
}); });
it('multiline and ignoring comma correctly', async () => { it('multiline and ignoring comma correctly', async () => {
setInput('cache-from', 'user/app:cache\ntype=local,src=path/to/dir'); setInput('cache-from', 'user/app:cache\ntype=local,src=path/to/dir');
const res = await context.getInputList('cache-from', true); const res = context.getInputList('cache-from', true);
console.log(res);
expect(res).toEqual(['user/app:cache', 'type=local,src=path/to/dir']); expect(res).toEqual(['user/app:cache', 'type=local,src=path/to/dir']);
}); });
it('different new lines and ignoring comma correctly', async () => { it('different new lines and ignoring comma correctly', async () => {
setInput('cache-from', 'user/app:cache\r\ntype=local,src=path/to/dir'); setInput('cache-from', 'user/app:cache\r\ntype=local,src=path/to/dir');
const res = await context.getInputList('cache-from', true); const res = context.getInputList('cache-from', true);
console.log(res);
expect(res).toEqual(['user/app:cache', 'type=local,src=path/to/dir']); expect(res).toEqual(['user/app:cache', 'type=local,src=path/to/dir']);
}); });
@@ -74,8 +65,7 @@ bbbbbbb
ccccccccc" ccccccccc"
FOO=bar` FOO=bar`
); );
const res = await context.getInputList('secrets', true); const res = context.getInputList('secrets', true);
console.log(res);
expect(res).toEqual([ expect(res).toEqual([
'GIT_AUTH_TOKEN=abcdefgh,ijklmno=0123456789', 'GIT_AUTH_TOKEN=abcdefgh,ijklmno=0123456789',
`MYSECRET=aaaaaaaa `MYSECRET=aaaaaaaa
@@ -98,8 +88,7 @@ FOO=bar
bbbb bbbb
ccc"` ccc"`
); );
const res = await context.getInputList('secrets', true); const res = context.getInputList('secrets', true);
console.log(res);
expect(res).toEqual([ expect(res).toEqual([
'GIT_AUTH_TOKEN=abcdefgh,ijklmno=0123456789', 'GIT_AUTH_TOKEN=abcdefgh,ijklmno=0123456789',
`MYSECRET=aaaaaaaa `MYSECRET=aaaaaaaa
@@ -122,15 +111,8 @@ bbbbbbb
ccccccccc ccccccccc
FOO=bar` FOO=bar`
); );
const res = await context.getInputList('secrets', true); const res = context.getInputList('secrets', true);
console.log(res); expect(res).toEqual(['GIT_AUTH_TOKEN=abcdefgh,ijklmno=0123456789', 'MYSECRET=aaaaaaaa', 'bbbbbbb', 'ccccccccc', 'FOO=bar']);
expect(res).toEqual([
'GIT_AUTH_TOKEN=abcdefgh,ijklmno=0123456789',
'MYSECRET=aaaaaaaa',
'bbbbbbb',
'ccccccccc',
'FOO=bar'
]);
}); });
it('multiline values escape quotes', async () => { it('multiline values escape quotes', async () => {
@@ -142,12 +124,11 @@ bbbb""bbb
ccccccccc" ccccccccc"
FOO=bar` FOO=bar`
); );
const res = await context.getInputList('secrets', true); const res = context.getInputList('secrets', true);
console.log(res);
expect(res).toEqual([ expect(res).toEqual([
'GIT_AUTH_TOKEN=abcdefgh,ijklmno=0123456789', 'GIT_AUTH_TOKEN=abcdefgh,ijklmno=0123456789',
`MYSECRET=aaaaaaaa `MYSECRET=aaaaaaaa
bbbb\"bbb bbbb"bbb
ccccccccc`, ccccccccc`,
'FOO=bar' 'FOO=bar'
]); ]);
@@ -167,28 +148,7 @@ describe('asyncForEach', () => {
}); });
}); });
describe('setOutput', () => { // See: https://github.com/actions/toolkit/blob/a1b068ec31a042ff1e10a522d8fdf0b8869d53ca/packages/core/src/core.ts#L89
beforeEach(() => {
process.stdout.write = jest.fn();
});
it('setOutput produces the correct command', () => {
context.setOutput('some output', 'some value');
assertWriteCalls([`::set-output name=some output::some value${os.EOL}`]);
});
it('setOutput handles bools', () => {
context.setOutput('some output', false);
assertWriteCalls([`::set-output name=some output::false${os.EOL}`]);
});
it('setOutput handles numbers', () => {
context.setOutput('some output', 1.01);
assertWriteCalls([`::set-output name=some output::1.01${os.EOL}`]);
});
});
// See: https://github.com/actions/toolkit/blob/master/packages/core/src/core.ts#L67
function getInputName(name: string): string { function getInputName(name: string): string {
return `INPUT_${name.replace(/ /g, '_').toUpperCase()}`; return `INPUT_${name.replace(/ /g, '_').toUpperCase()}`;
} }
@@ -196,11 +156,3 @@ function getInputName(name: string): string {
function setInput(name: string, value: string): void { function setInput(name: string, value: string): void {
process.env[getInputName(name)] = value; process.env[getInputName(name)] = value;
} }
// Assert that process.stdout.write calls called only with the given arguments.
function assertWriteCalls(calls: string[]): void {
expect(process.stdout.write).toHaveBeenCalledTimes(calls.length);
for (let i = 0; i < calls.length; i++) {
expect(process.stdout.write).toHaveBeenNthCalledWith(i + 1, calls[i]);
}
}
+16
View File
@@ -0,0 +1,16 @@
import {describe, expect, it, jest} from '@jest/globals';
import * as docker from '../src/docker';
import * as exec from '@actions/exec';
describe('isAvailable', () => {
it('cli', () => {
const execSpy = jest.spyOn(exec, 'getExecOutput');
docker.isAvailable();
// eslint-disable-next-line jest/no-standalone-expect
expect(execSpy).toHaveBeenCalledWith(`docker`, undefined, {
silent: true,
ignoreReturnCode: true
});
});
});
+12 -1
View File
@@ -13,6 +13,10 @@ inputs:
files: files:
description: "List of bake definition files" description: "List of bake definition files"
required: true required: true
workdir:
description: "Working directory of bake execution"
required: false
default: '.'
targets: targets:
description: "List of bake targets" description: "List of bake targets"
required: false required: false
@@ -35,7 +39,14 @@ inputs:
set: set:
description: "List of targets values to override (eg. targetpattern.key=value)" description: "List of targets values to override (eg. targetpattern.key=value)"
required: false required: false
source:
description: "Remote bake definition to build from"
required: false
outputs:
metadata:
description: 'Build result metadata'
runs: runs:
using: 'node12' using: 'node16'
main: 'dist/index.js' main: 'dist/index.js'
+3
View File
@@ -0,0 +1,3 @@
comment: false
github_checks:
annotations: false
+78
View File
@@ -0,0 +1,78 @@
# syntax=docker/dockerfile:1
ARG NODE_VERSION=16
ARG DOCKER_VERSION=20.10.13
ARG BUILDX_VERSION=0.8.1
FROM node:${NODE_VERSION}-alpine AS base
RUN apk add --no-cache cpio findutils git
WORKDIR /src
FROM base AS deps
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/node_modules \
yarn install && mkdir /vendor && cp yarn.lock /vendor
FROM scratch AS vendor-update
COPY --from=deps /vendor /
FROM deps AS vendor-validate
RUN --mount=type=bind,target=.,rw <<EOT
set -e
git add -A
cp -rf /vendor/* .
if [ -n "$(git status --porcelain -- yarn.lock)" ]; then
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor-update"'
git status --porcelain -- yarn.lock
exit 1
fi
EOT
FROM deps AS build
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/node_modules \
yarn run build && mkdir /out && cp -Rf dist /out/
FROM scratch AS build-update
COPY --from=build /out /
FROM build AS build-validate
RUN --mount=type=bind,target=.,rw <<EOT
set -e
git add -A
cp -rf /out/* .
if [ -n "$(git status --porcelain -- dist)" ]; then
echo >&2 'ERROR: Build result differs. Please build first with "docker buildx bake build"'
git status --porcelain -- dist
exit 1
fi
EOT
FROM deps AS format
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/node_modules \
yarn run format \
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' | cpio -pdm /out
FROM scratch AS format-update
COPY --from=format /out /
FROM deps AS lint
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/node_modules \
yarn run lint
FROM docker:${DOCKER_VERSION} as docker
FROM docker/buildx-bin:${BUILDX_VERSION} as buildx
FROM deps AS test
ENV RUNNER_TEMP=/tmp/github_runner
ENV RUNNER_TOOL_CACHE=/tmp/github_tool_cache
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/node_modules \
--mount=type=bind,from=docker,source=/usr/local/bin/docker,target=/usr/bin/docker \
--mount=type=bind,from=buildx,source=/buildx,target=/usr/libexec/docker/cli-plugins/docker-buildx \
yarn run test --coverageDirectory=/tmp/coverage
FROM scratch AS test-coverage
COPY --from=test /tmp/coverage /
Generated Vendored
+7 -6414
View File
File diff suppressed because one or more lines are too long
Generated Vendored
+1
View File
File diff suppressed because one or more lines are too long
Generated Vendored
+479
View File
@@ -0,0 +1,479 @@
@actions/core
MIT
The MIT License (MIT)
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@actions/exec
MIT
The MIT License (MIT)
Copyright 2019 GitHub
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@actions/http-client
MIT
Actions Http Client for Node.js
Copyright (c) GitHub, Inc.
All rights reserved.
MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@actions/io
MIT
balanced-match
MIT
(MIT)
Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
brace-expansion
MIT
MIT License
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
concat-map
MIT
This software is released under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
csv-parse
MIT
The MIT License (MIT)
Copyright (c) 2010 Adaltas
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
fs.realpath
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
----
This library bundles a version of the `fs.realpath` and `fs.realpathSync`
methods from Node.js v0.10 under the terms of the Node.js MIT license.
Node's license follows, also included at the header of `old.js` which contains
the licensed code:
Copyright Joyent, Inc. and other Node contributors.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, copy, modify, merge, publish, distribute, sublicense,
and/or sell copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
DEALINGS IN THE SOFTWARE.
glob
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
## Glob Logo
Glob's logo created by Tanya Brassie <http://tanyabrassie.com/>, licensed
under a Creative Commons Attribution-ShareAlike 4.0 International License
https://creativecommons.org/licenses/by-sa/4.0/
inflight
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
inherits
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
lru-cache
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
minimatch
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
once
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
path-is-absolute
MIT
The MIT License (MIT)
Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
rimraf
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
semver
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
tmp
MIT
The MIT License (MIT)
Copyright (c) 2014 KARASZI István
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
tunnel
MIT
The MIT License (MIT)
Copyright (c) 2012 Koichi Kobayashi
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
uuid
MIT
The MIT License (MIT)
Copyright (c) 2010-2020 Robert Kieffer and other contributors
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
wrappy
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
yallist
ISC
The ISC License
Copyright (c) Isaac Z. Schlueter and Contributors
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Generated Vendored
+1
View File
File diff suppressed because one or more lines are too long
+15 -29
View File
@@ -1,13 +1,3 @@
variable "NODE_VERSION" {
default = "12"
}
target "node-version" {
args = {
NODE_VERSION = NODE_VERSION
}
}
group "default" { group "default" {
targets = ["build"] targets = ["build"]
} }
@@ -17,51 +7,47 @@ group "pre-checkin" {
} }
group "validate" { group "validate" {
targets = ["format-validate", "build-validate", "vendor-validate"] targets = ["lint", "build-validate", "vendor-validate"]
} }
target "build" { target "build" {
inherits = ["node-version"] dockerfile = "dev.Dockerfile"
dockerfile = "./hack/build.Dockerfile"
target = "build-update" target = "build-update"
output = ["."] output = ["."]
} }
target "build-validate" { target "build-validate" {
inherits = ["node-version"] dockerfile = "dev.Dockerfile"
dockerfile = "./hack/build.Dockerfile"
target = "build-validate" target = "build-validate"
output = ["type=cacheonly"]
} }
target "format" { target "format" {
inherits = ["node-version"] dockerfile = "dev.Dockerfile"
dockerfile = "./hack/build.Dockerfile"
target = "format-update" target = "format-update"
output = ["."] output = ["."]
} }
target "format-validate" { target "lint" {
inherits = ["node-version"] dockerfile = "dev.Dockerfile"
dockerfile = "./hack/build.Dockerfile" target = "lint"
target = "format-validate" output = ["type=cacheonly"]
} }
target "vendor-update" { target "vendor-update" {
inherits = ["node-version"] dockerfile = "dev.Dockerfile"
dockerfile = "./hack/vendor.Dockerfile" target = "vendor-update"
target = "update"
output = ["."] output = ["."]
} }
target "vendor-validate" { target "vendor-validate" {
inherits = ["node-version"] dockerfile = "dev.Dockerfile"
dockerfile = "./hack/vendor.Dockerfile" target = "vendor-validate"
target = "validate" output = ["type=cacheonly"]
} }
target "test" { target "test" {
inherits = ["node-version"] dockerfile = "dev.Dockerfile"
dockerfile = "./hack/test.Dockerfile"
target = "test-coverage" target = "test-coverage"
output = ["./coverage"] output = ["./coverage"]
} }
-42
View File
@@ -1,42 +0,0 @@
# syntax=docker/dockerfile:1.2
ARG NODE_VERSION
FROM node:${NODE_VERSION}-alpine AS base
RUN apk add --no-cache cpio findutils git
WORKDIR /src
FROM base AS deps
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/node_modules \
yarn install
FROM deps AS build
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/node_modules \
yarn run build && mkdir /out && cp -Rf dist /out/
FROM scratch AS build-update
COPY --from=build /out /
FROM build AS build-validate
RUN --mount=type=bind,target=.,rw \
git add -A && cp -rf /out/* .; \
if [ -n "$(git status --porcelain -- dist)" ]; then \
echo >&2 'ERROR: Build result differs. Please build first with "docker buildx bake build"'; \
git status --porcelain -- dist; \
exit 1; \
fi
FROM deps AS format
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/node_modules \
yarn run format \
&& mkdir /out && find . -name '*.ts' -not -path './node_modules/*' | cpio -pdm /out
FROM scratch AS format-update
COPY --from=format /out /
FROM deps AS format-validate
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/node_modules \
yarn run format-check \
-23
View File
@@ -1,23 +0,0 @@
# syntax=docker/dockerfile:1.2
ARG NODE_VERSION
FROM node:${NODE_VERSION}-alpine AS base
RUN apk add --no-cache git
WORKDIR /src
FROM base AS deps
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/node_modules \
yarn install
FROM deps AS test
ENV RUNNER_TEMP=/tmp/github_runner
ENV RUNNER_TOOL_CACHE=/tmp/github_tool_cache
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/node_modules \
--mount=type=bind,from=crazymax/docker,source=/usr/libexec/docker/cli-plugins/docker-buildx,target=/usr/libexec/docker/cli-plugins/docker-buildx \
--mount=type=bind,from=crazymax/docker,source=/usr/local/bin/docker,target=/usr/bin/docker \
yarn run test --coverageDirectory=/tmp/coverage
FROM scratch AS test-coverage
COPY --from=test /tmp/coverage /
-23
View File
@@ -1,23 +0,0 @@
# syntax=docker/dockerfile:1.2
ARG NODE_VERSION
FROM node:${NODE_VERSION}-alpine AS base
RUN apk add --no-cache git
WORKDIR /src
FROM base AS vendored
RUN --mount=type=bind,target=.,rw \
--mount=type=cache,target=/src/node_modules \
yarn install && mkdir /out && cp yarn.lock /out
FROM scratch AS update
COPY --from=vendored /out /
FROM vendored AS validate
RUN --mount=type=bind,target=.,rw \
git add -A && cp -rf /out/* .; \
if [ -n "$(git status --porcelain -- yarn.lock)" ]; then \
echo >&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor-update"'; \
git status --porcelain -- yarn.lock; \
exit 1; \
fi
+6 -5
View File
@@ -1,12 +1,13 @@
module.exports = { module.exports = {
clearMocks: true, clearMocks: true,
moduleFileExtensions: ['js', 'ts'], moduleFileExtensions: ['js', 'ts'],
setupFiles: ["dotenv/config"], setupFiles: ['dotenv/config'],
testEnvironment: 'node',
testMatch: ['**/*.test.ts'], testMatch: ['**/*.test.ts'],
testRunner: 'jest-circus/runner',
transform: { transform: {
'^.+\\.ts$': 'ts-jest' '^.+\\.ts$': 'ts-jest'
}, },
verbose: false moduleNameMapper: {
} '^csv-parse/sync': '<rootDir>/node_modules/csv-parse/dist/cjs/sync.cjs'
},
verbose: true
};
+26 -20
View File
@@ -3,11 +3,11 @@
"description": "GitHub Action to use Docker Buildx Bake as a high-level build command", "description": "GitHub Action to use Docker Buildx Bake as a high-level build command",
"main": "lib/main.js", "main": "lib/main.js",
"scripts": { "scripts": {
"build": "tsc && ncc build", "build": "ncc build src/main.ts --source-map --minify --license licenses.txt",
"format": "prettier --write **/*.ts", "lint": "eslint src/**/*.ts __tests__/**/*.ts",
"format-check": "prettier --check **/*.ts", "format": "eslint --fix src/**/*.ts __tests__/**/*.ts",
"test": "jest --coverage", "test": "jest --coverage",
"pre-checkin": "yarn run format && yarn run build" "all": "yarn run build && yarn run format && yarn test"
}, },
"repository": { "repository": {
"type": "git", "type": "git",
@@ -28,23 +28,29 @@
], ],
"license": "Apache-2.0", "license": "Apache-2.0",
"dependencies": { "dependencies": {
"@actions/core": "^1.2.7", "@actions/core": "^1.10.0",
"@actions/exec": "^1.0.4", "@actions/exec": "^1.1.1",
"csv-parse": "^4.15.4", "csv-parse": "^5.3.0",
"semver": "^7.3.5" "semver": "^7.3.7",
"tmp": "^0.2.1"
}, },
"devDependencies": { "devDependencies": {
"@types/jest": "^26.0.3", "@types/csv-parse": "^1.2.2",
"@types/node": "^14.0.14", "@types/node": "^16.11.26",
"@types/tmp": "^0.2.0", "@types/semver": "^7.3.9",
"@vercel/ncc": "^0.23.0", "@types/tmp": "^0.2.3",
"dotenv": "^8.2.0", "@typescript-eslint/eslint-plugin": "^5.14.0",
"jest": "^26.1.0", "@typescript-eslint/parser": "^5.14.0",
"jest-circus": "^26.1.0", "@vercel/ncc": "^0.33.3",
"jest-runtime": "^26.1.0", "dotenv": "^16.0.0",
"prettier": "^2.0.5", "eslint": "^8.11.0",
"ts-jest": "^26.1.1", "eslint-config-prettier": "^8.5.0",
"typescript": "^3.9.5", "eslint-plugin-jest": "^26.1.1",
"typescript-formatter": "^7.2.2" "eslint-plugin-prettier": "^4.0.0",
"jest": "^27.2.5",
"prettier": "^2.3.1",
"ts-jest": "^27.1.2",
"ts-node": "^10.7.0",
"typescript": "^4.4.4"
} }
} }
+69 -22
View File
@@ -1,28 +1,75 @@
import fs from 'fs';
import path from 'path';
import * as semver from 'semver'; import * as semver from 'semver';
import * as exec from './exec'; import * as exec from '@actions/exec';
export async function isAvailable(): Promise<Boolean> { import * as context from './context';
return await exec.exec(`docker`, ['buildx'], true).then(res => {
if (res.stderr != '' && !res.success) { export async function getMetadataFile(): Promise<string> {
return false; return path.join(context.tmpDir(), 'metadata-file').split(path.sep).join(path.posix.sep);
}
return res.success;
});
} }
export async function getVersion(): Promise<string> { export async function getMetadata(): Promise<string | undefined> {
return await exec.exec(`docker`, ['buildx', 'version'], true).then(res => { const metadataFile = await getMetadataFile();
if (res.stderr != '' && !res.success) { if (!fs.existsSync(metadataFile)) {
throw new Error(res.stderr); return undefined;
}
return parseVersion(res.stdout);
});
}
export async function parseVersion(stdout: string): Promise<string> {
const matches = /\sv?([0-9.]+)/.exec(stdout);
if (!matches) {
throw new Error(`Cannot parse Buildx version`);
} }
return semver.clean(matches[1]); const content = fs.readFileSync(metadataFile, {encoding: 'utf-8'}).trim();
if (content === 'null') {
return undefined;
}
return content;
}
export async function isAvailable(standalone?: boolean): Promise<boolean> {
const cmd = getCommand([], standalone);
return await exec
.getExecOutput(cmd.command, cmd.args, {
ignoreReturnCode: true,
silent: true
})
.then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
return false;
}
return res.exitCode == 0;
})
// eslint-disable-next-line @typescript-eslint/no-unused-vars
.catch(error => {
return false;
});
}
export async function getVersion(standalone?: boolean): Promise<string> {
const cmd = getCommand(['version'], standalone);
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 parseVersion(res.stdout.trim());
});
}
export function parseVersion(stdout: string): string {
const matches = /\sv?([0-9a-f]{7}|[0-9.]+)/.exec(stdout);
if (!matches) {
throw new Error(`Cannot parse buildx version`);
}
return matches[1];
}
export function satisfies(version: string, range: string): boolean {
return semver.satisfies(version, range) || /^[0-9a-f]{7}$/.exec(version) !== null;
}
export function getCommand(args: Array<string>, standalone?: boolean) {
return {
command: standalone ? 'buildx' : 'docker',
args: standalone ? args : ['buildx', ...args]
};
} }
+51 -27
View File
@@ -1,53 +1,80 @@
import csvparse from 'csv-parse/lib/sync'; import * as fs from 'fs';
import * as os from 'os';
import * as path from 'path';
import * as tmp from 'tmp';
import * as buildx from './buildx'; import * as buildx from './buildx';
import * as core from '@actions/core'; import * as core from '@actions/core';
import {issueCommand} from '@actions/core/lib/command'; import {parse} from 'csv-parse/sync';
let _tmpDir: string;
export interface Inputs { export interface Inputs {
builder: string; builder: string;
files: string[]; files: string[];
workdir: string;
targets: string[]; targets: string[];
noCache: boolean; noCache: boolean;
pull: boolean; pull: boolean;
load: boolean; load: boolean;
push: boolean; push: boolean;
set: string[]; set: string[];
source: string;
}
export function tmpDir(): string {
if (!_tmpDir) {
_tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'docker-build-push-')).split(path.sep).join(path.posix.sep);
}
return _tmpDir;
}
export function tmpNameSync(options?: tmp.TmpNameOptions): string {
return tmp.tmpNameSync(options);
} }
export async function getInputs(): Promise<Inputs> { export async function getInputs(): Promise<Inputs> {
return { return {
builder: core.getInput('builder'), builder: core.getInput('builder'),
files: getInputList('files'), files: getInputList('files'),
workdir: core.getInput('workdir') || '.',
targets: getInputList('targets'), targets: getInputList('targets'),
noCache: /true/i.test(core.getInput('no-cache')), noCache: core.getBooleanInput('no-cache'),
pull: /true/i.test(core.getInput('pull')), pull: core.getBooleanInput('pull'),
load: /true/i.test(core.getInput('load')), load: core.getBooleanInput('load'),
push: /true/i.test(core.getInput('push')), push: core.getBooleanInput('push'),
set: getInputList('set', true) set: getInputList('set', true),
source: core.getInput('source')
}; };
} }
export async function getArgs(inputs: Inputs, buildxVersion: string): Promise<Array<string>> { export async function getArgs(inputs: Inputs, buildxVersion: string): Promise<Array<string>> {
let args: Array<string> = ['buildx']; // prettier-ignore
args.push.apply(args, await getBakeArgs(inputs, buildxVersion)); return [
args.push.apply(args, await getCommonArgs(inputs)); ...await getBakeArgs(inputs, buildxVersion),
args.push.apply(args, inputs.targets); ...await getCommonArgs(inputs),
return args; ...inputs.targets
];
} }
async function getBakeArgs(inputs: Inputs, buildxVersion: string): Promise<Array<string>> { async function getBakeArgs(inputs: Inputs, buildxVersion: string): Promise<Array<string>> {
let args: Array<string> = ['bake']; const args: Array<string> = ['bake'];
if (inputs.source) {
args.push(inputs.source);
}
await asyncForEach(inputs.files, async file => { await asyncForEach(inputs.files, async file => {
args.push('--file', file); args.push('--file', file);
}); });
await asyncForEach(inputs.set, async set => { await asyncForEach(inputs.set, async set => {
args.push('--set', set); args.push('--set', set);
}); });
if (buildx.satisfies(buildxVersion, '>=0.6.0')) {
args.push('--metadata-file', await buildx.getMetadataFile());
}
return args; return args;
} }
async function getCommonArgs(inputs: Inputs): Promise<Array<string>> { async function getCommonArgs(inputs: Inputs): Promise<Array<string>> {
let args: Array<string> = []; const args: Array<string> = [];
if (inputs.noCache) { if (inputs.noCache) {
args.push('--no-cache'); args.push('--no-cache');
} }
@@ -67,26 +94,28 @@ async function getCommonArgs(inputs: Inputs): Promise<Array<string>> {
} }
export function getInputList(name: string, ignoreComma?: boolean): string[] { export function getInputList(name: string, ignoreComma?: boolean): string[] {
let res: Array<string> = []; const res: Array<string> = [];
const items = core.getInput(name); const items = core.getInput(name);
if (items == '') { if (items == '') {
return res; return res;
} }
for (let output of csvparse(items, { const records = parse(items, {
columns: false, columns: false,
relaxColumnCount: true, relaxColumnCount: true,
skipLinesWithEmptyValues: true skipEmptyLines: true
}) as Array<string[]>) { });
if (output.length == 1) {
res.push(output[0]); for (const record of records as Array<string[]>) {
if (record.length == 1) {
res.push(record[0]);
continue; continue;
} else if (!ignoreComma) { } else if (!ignoreComma) {
res.push(...output); res.push(...record);
continue; continue;
} }
res.push(output.join(',')); res.push(record.join(','));
} }
return res.filter(item => item).map(pat => pat.trim()); return res.filter(item => item).map(pat => pat.trim());
@@ -97,8 +126,3 @@ export const asyncForEach = async (array, callback) => {
await callback(array[index], index, array); await callback(array[index], index, array);
} }
}; };
// FIXME: Temp fix https://github.com/actions/toolkit/issues/777
export function setOutput(name: string, value: any): void {
issueCommand('set-output', {name}, value);
}
+19
View File
@@ -0,0 +1,19 @@
import * as exec from '@actions/exec';
export async function isAvailable(): Promise<boolean> {
return await exec
.getExecOutput('docker', undefined, {
ignoreReturnCode: true,
silent: true
})
.then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
return false;
}
return res.exitCode == 0;
})
// eslint-disable-next-line @typescript-eslint/no-unused-vars
.catch(error => {
return false;
});
}
-34
View File
@@ -1,34 +0,0 @@
import * as aexec from '@actions/exec';
import {ExecOptions} from '@actions/exec';
export interface ExecResult {
success: boolean;
stdout: string;
stderr: string;
}
export const exec = async (command: string, args: string[] = [], silent: boolean): Promise<ExecResult> => {
let stdout: string = '';
let stderr: string = '';
const options: ExecOptions = {
silent: silent,
ignoreReturnCode: true
};
options.listeners = {
stdout: (data: Buffer) => {
stdout += data.toString();
},
stderr: (data: Buffer) => {
stderr += data.toString();
}
};
const returnCode: number = await aexec.exec(command, args, options);
return {
success: returnCode === 0,
stdout: stdout.trim(),
stderr: stderr.trim()
};
};
+62 -10
View File
@@ -1,35 +1,87 @@
import * as fs from 'fs';
import * as buildx from './buildx'; import * as buildx from './buildx';
import * as context from './context'; import * as context from './context';
import * as docker from './docker';
import * as stateHelper from './state-helper';
import * as core from '@actions/core'; import * as core from '@actions/core';
import * as exec from '@actions/exec'; import * as exec from '@actions/exec';
async function run(): Promise<void> { async function run(): Promise<void> {
try { try {
const inputs: context.Inputs = await context.getInputs();
// standalone if docker cli not available
const standalone = !(await docker.isAvailable());
core.startGroup(`Docker info`); core.startGroup(`Docker info`);
await exec.exec('docker', ['version']); if (standalone) {
await exec.exec('docker', ['info']); core.info(`Docker info skipped in standalone mode`);
} else {
await exec.exec('docker', ['version'], {
failOnStdErr: false
});
await exec.exec('docker', ['info'], {
failOnStdErr: false
});
}
core.endGroup(); core.endGroup();
if (!(await buildx.isAvailable())) { if (!(await buildx.isAvailable(standalone))) {
core.setFailed(`Docker buildx is required. See https://github.com/docker/setup-buildx-action to set up buildx.`); core.setFailed(`Docker buildx is required. See https://github.com/docker/setup-buildx-action to set up buildx.`);
return; return;
} }
stateHelper.setTmpDir(context.tmpDir());
const buildxVersion = await buildx.getVersion(); const buildxVersion = await buildx.getVersion(standalone);
core.info(`Using buildx ${buildxVersion}`); await core.group(`Buildx version`, async () => {
const versionCmd = buildx.getCommand(['version'], standalone);
await exec.exec(versionCmd.command, versionCmd.args, {
failOnStdErr: false
});
});
let inputs: context.Inputs = await context.getInputs();
const args: string[] = await context.getArgs(inputs, buildxVersion); const args: string[] = await context.getArgs(inputs, buildxVersion);
const buildCmd = buildx.getCommand(args, standalone);
core.startGroup(`Bake definition`); core.startGroup(`Bake definition`);
await exec.exec('docker', [...args, '--print']); await exec.exec(buildCmd.command, [...buildCmd.args, '--print'], {
cwd: inputs.workdir
});
core.endGroup(); core.endGroup();
core.info(`Building...`); await exec
await exec.exec('docker', args); .getExecOutput(buildCmd.command, buildCmd.args, {
cwd: inputs.workdir,
ignoreReturnCode: true
})
.then(res => {
if (res.stderr.length > 0 && res.exitCode != 0) {
throw new Error(`buildx bake failed with: ${res.stderr.match(/(.*)\s*$/)?.[0]?.trim() ?? 'unknown error'}`);
}
});
const metadata = await buildx.getMetadata();
if (metadata) {
await core.group(`Metadata output`, async () => {
core.info(metadata);
core.setOutput('metadata', metadata);
});
}
} catch (error) { } catch (error) {
core.setFailed(error.message); core.setFailed(error.message);
} }
} }
run(); async function cleanup(): Promise<void> {
if (stateHelper.tmpDir.length > 0) {
core.startGroup(`Removing temp folder ${stateHelper.tmpDir}`);
fs.rmdirSync(stateHelper.tmpDir, {recursive: true});
core.endGroup();
}
}
if (!stateHelper.IsPost) {
run();
} else {
cleanup();
}
+12
View File
@@ -0,0 +1,12 @@
import * as core from '@actions/core';
export const IsPost = !!process.env['STATE_isPost'];
export const tmpDir = process.env['STATE_tmpDir'] || '';
export function setTmpDir(tmpDir: string) {
core.saveState('tmpDir', tmpDir);
}
if (!IsPost) {
core.saveState('isPost', 'true');
}
+5 -7
View File
@@ -2,20 +2,18 @@
"compilerOptions": { "compilerOptions": {
"target": "es6", "target": "es6",
"module": "commonjs", "module": "commonjs",
"lib": [
"es6",
"dom"
],
"newLine": "lf", "newLine": "lf",
"outDir": "./lib", "outDir": "./lib",
"rootDir": "./src", "rootDir": "./src",
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"strict": true, "strict": true,
"noImplicitAny": false, "noImplicitAny": false,
"esModuleInterop": true, "useUnknownInCatchVariables": false,
"sourceMap": true
}, },
"exclude": [ "exclude": [
"node_modules", "node_modules",
"**/*.test.ts" "**/*.test.ts",
"jest.config.ts"
] ]
} }
+1996 -2213
View File
File diff suppressed because it is too large Load Diff