88 Commits
v1.1 ... v2

Author SHA1 Message Date
Aleksei Igrychev
6ad28e741a docs(readme): fix broken link 2025-11-01 17:57:09 +03:00
Aleksei Igrychev
b3b83d531c docs(readme): fix broken link 2025-11-01 17:55:49 +03:00
Evgeniy Frolov
f3a12bd69b chore(actions): set stable channel as default
Signed-off-by: Evgeniy Frolov <evgeniy.frolov@flant.com>
2025-10-13 14:13:49 +01:00
Evgeniy Frolov
af48145692 docs(readme, faq): use only one driver (#83)
Signed-off-by: Evgeniy Frolov <evgeniy.frolov@flant.com>
Co-authored-by: Aleksei Igrychev <alexey.igrychev@flant.com>
2025-04-14 22:06:17 +01:00
Evgeniy Frolov
4cd91e1efe docs(readme, faq): add section about using werf with docker buildx (#82)
Signed-off-by: Evgeniy Frolov <evgeniy.frolov@flant.com>
Co-authored-by: Aleksei Igrychev <alexey.igrychev@flant.com>
2025-04-08 09:46:54 +01:00
Aleksei Igrychev
6ada024d50 chore: test 2025-04-03 12:19:17 +01:00
Evgeniy Frolov
598155cd9d chore(README): add working with container registry section in FAQ (#78)
Signed-off-by: Evgeniy Frolov <evgeniy.frolov@flant.com>
Co-authored-by: Aleksei Igrychev <alexey.igrychev@flant.com>
2024-12-06 15:07:53 +00:00
Aleksei Igrychev
41f4b68701 feat: working within 2 major version
Signed-off-by: Aleksei Igrychev <aleksei.igrychev@palark.com>
2024-04-24 14:03:13 +01:00
Aleksei Igrychev
43d2310151 docs: use actions/checkout@v4
Signed-off-by: Aleksei Igrychev <aleksei.igrychev@palark.com>
2024-02-14 15:30:46 +00:00
Aleksei Igrychev
0980fb9532 feat: use Node.js v20
Signed-off-by: Aleksei Igrychev <aleksei.igrychev@palark.com>
2024-02-14 15:30:21 +00:00
Aleksei Igrychev
ed26ed00c3 feat: ignore initialization of virtual merge commits
Signed-off-by: Aleksei Igrychev <aleksei.igrychev@palark.com>
2023-12-21 22:15:20 +00:00
Aleksei Igrychev
123d59749a Merge pull request #68 from werf/dependabot/npm_and_yarn/cookiejar-2.1.4
build(deps): bump cookiejar from 2.1.3 to 2.1.4
2023-12-21 22:14:58 +00:00
Aleksei Igrychev
6a22d9889e Merge pull request #69 from werf/dependabot/npm_and_yarn/semver-7.5.2
build(deps): bump semver from 7.3.5 to 7.5.2
2023-12-21 22:14:49 +00:00
Aleksei Igrychev
c3991e000a Merge pull request #70 from werf/dependabot/npm_and_yarn/word-wrap-1.2.4
build(deps-dev): bump word-wrap from 1.2.3 to 1.2.4
2023-12-21 22:14:39 +00:00
dependabot[bot]
8114de503a build(deps-dev): bump word-wrap from 1.2.3 to 1.2.4
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-07-18 22:16:55 +00:00
dependabot[bot]
5db804bda8 build(deps): bump semver from 7.3.5 to 7.5.2
Bumps [semver](https://github.com/npm/node-semver) from 7.3.5 to 7.5.2.
- [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.5.2)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-06-25 19:23:50 +00:00
dependabot[bot]
49d9f0474c build(deps): bump cookiejar from 2.1.3 to 2.1.4
Bumps [cookiejar](https://github.com/bmeck/node-cookiejar) from 2.1.3 to 2.1.4.
- [Release notes](https://github.com/bmeck/node-cookiejar/releases)
- [Commits](https://github.com/bmeck/node-cookiejar/commits)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-24 08:56:10 +00:00
Alexey Igrychev
249bcf41aa chore(README): simplify example 2023-01-20 12:04:20 +00:00
Alexey Igrychev
9ef247eabe Update README.md 2023-01-20 11:56:37 +00:00
Alexey Igrychev
a8aa170653 Merge pull request #67 from werf/chore_readme_focus_on_install_action
chore(README): focus on install action
2023-01-20 11:56:11 +00:00
Alexey Igrychev
51f5846897 chore: up actions/checkout to v3
Signed-off-by: Alexey Igrychev <alexey.igrychev@flant.com>
2023-01-20 11:54:59 +00:00
Alexey Igrychev
6b2343319a chore(README): focus on install action
Signed-off-by: Alexey Igrychev <alexey.igrychev@flant.com>
2023-01-20 11:54:59 +00:00
Alexey Igrychev
04d17c706c Merge pull request #66 from werf/chore_install_export_github_context_variables
chore(install): export virtual merge commits
2023-01-20 11:50:01 +00:00
Alexey Igrychev
9039bc0466 chore(install): export virtual merge commits
Signed-off-by: Alexey Igrychev <alexey.igrychev@flant.com>
2023-01-20 11:49:01 +00:00
Alexey Igrychev
c8117305fa Merge pull request #65 from werf/feat_export_ci_env_variables
feat: export ci-env variables to the next steps
2023-01-20 11:47:18 +00:00
Alexey Igrychev
bbed6a352f feat: export ci-env variables to the next steps
Signed-off-by: Alexey Igrychev <alexey.igrychev@flant.com>
2023-01-20 11:46:17 +00:00
Alexey Igrychev
28fbbd1431 Merge pull request #56 from jayesh100/v1.2
feat(action): use node 16
2023-01-10 16:32:15 +00:00
Alexey Igrychev
3f75d958ee Merge pull request #61 from werf/dependabot/npm_and_yarn/minimatch-3.1.2
build(deps): bump minimatch from 3.0.4 to 3.1.2
2023-01-10 16:31:50 +00:00
Alexey Igrychev
d70c5589dc Merge pull request #62 from werf/dependabot/npm_and_yarn/node-fetch-3.2.10
build(deps-dev): bump node-fetch from 3.1.1 to 3.2.10
2023-01-10 16:31:39 +00:00
dependabot[bot]
97dd67885d build(deps): bump minimatch from 3.0.4 to 3.1.2
Bumps [minimatch](https://github.com/isaacs/minimatch) from 3.0.4 to 3.1.2.
- [Release notes](https://github.com/isaacs/minimatch/releases)
- [Changelog](https://github.com/isaacs/minimatch/blob/main/changelog.md)
- [Commits](https://github.com/isaacs/minimatch/compare/v3.0.4...v3.1.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-10 16:31:26 +00:00
dependabot[bot]
32d35676c4 build(deps-dev): bump node-fetch from 3.1.1 to 3.2.10
Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 3.1.1 to 3.2.10.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Commits](https://github.com/node-fetch/node-fetch/compare/v3.1.1...v3.2.10)

---
updated-dependencies:
- dependency-name: node-fetch
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-10 16:31:26 +00:00
Alexey Igrychev
f97e5aaef8 Merge pull request #55 from werf/dependabot/npm_and_yarn/actions/core-1.9.1
Bump @actions/core from 1.6.0 to 1.9.1
2023-01-10 16:31:21 +00:00
Alexey Igrychev
5bad6adea1 Merge pull request #59 from werf/dependabot/npm_and_yarn/qs-6.11.0
build(deps): bump qs from 6.10.1 to 6.11.0
2023-01-10 16:31:12 +00:00
Alexey Igrychev
b6cb5eb2b8 Merge pull request #60 from werf/dependabot/npm_and_yarn/json5-1.0.2
build(deps): bump json5 from 1.0.1 to 1.0.2
2023-01-10 16:31:00 +00:00
dependabot[bot]
dc1f37e772 build(deps): bump json5 from 1.0.1 to 1.0.2
Bumps [json5](https://github.com/json5/json5) from 1.0.1 to 1.0.2.
- [Release notes](https://github.com/json5/json5/releases)
- [Changelog](https://github.com/json5/json5/blob/main/CHANGELOG.md)
- [Commits](https://github.com/json5/json5/compare/v1.0.1...v1.0.2)

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

Signed-off-by: dependabot[bot] <support@github.com>
2023-01-07 20:43:54 +00:00
dependabot[bot]
61d4c969a9 build(deps): bump qs from 6.10.1 to 6.11.0
Bumps [qs](https://github.com/ljharb/qs) from 6.10.1 to 6.11.0.
- [Release notes](https://github.com/ljharb/qs/releases)
- [Changelog](https://github.com/ljharb/qs/blob/main/CHANGELOG.md)
- [Commits](https://github.com/ljharb/qs/compare/v6.10.1...v6.11.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
2022-12-06 14:44:23 +00:00
Timofey Kirillov
4cbd75c9ef docs: add notice about fetch-depth into README
Signed-off-by: Timofey Kirillov <timofey.kirillov@flant.com>
2022-10-21 12:36:58 +03:00
jayesh100
66381be661 feat(action): use node 16 2022-10-21 12:41:04 +11:00
dependabot[bot]
434520bcb6 Bump @actions/core from 1.6.0 to 1.9.1
Bumps [@actions/core](https://github.com/actions/toolkit/tree/HEAD/packages/core) from 1.6.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
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-08-18 19:27:57 +00:00
Alexey Igrychev
e5e6d49cdd Merge pull request #54 from werf/chore_readme_fix_links
chore(readme): fix links
2022-08-15 08:03:57 +01:00
Alexey Igrychev
124534d1bb chore(readme): fix links
Signed-off-by: Alexey Igrychev <alexey.igrychev@flant.com>
2022-08-15 08:03:16 +01:00
Alexey Igrychev
5b66dc4131 Merge pull request #52 from werf/dependabot/npm_and_yarn/minimist-1.2.6
Bump minimist from 1.2.5 to 1.2.6
2022-08-15 07:58:12 +01:00
Alexey Igrychev
ed5a3d1e9b chore: update install action description
Signed-off-by: Alexey Igrychev <alexey.igrychev@flant.com>
2022-07-06 15:39:16 +01:00
dependabot[bot]
3729ed90a5 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-26 18:57:31 +00:00
Alexey Igrychev
e1fbd124d8 Merge pull request #50 from werf/dependabot/npm_and_yarn/node-fetch-3.1.1
Bump node-fetch from 2.6.5 to 3.1.1
2022-02-21 13:06:07 +00:00
dependabot[bot]
0617fd4cf8 Bump node-fetch from 2.6.5 to 3.1.1
Bumps [node-fetch](https://github.com/node-fetch/node-fetch) from 2.6.5 to 3.1.1.
- [Release notes](https://github.com/node-fetch/node-fetch/releases)
- [Changelog](https://github.com/node-fetch/node-fetch/blob/main/docs/CHANGELOG.md)
- [Commits](https://github.com/node-fetch/node-fetch/compare/v2.6.5...v3.1.1)

---
updated-dependencies:
- dependency-name: node-fetch
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-01-22 12:18:24 +00:00
Alexey Igrychev
c05acfa9d8 Merge pull request #49 from werf/fix-dismiss-action
fix: converge and dismiss actions should not require env param
2021-12-17 13:26:27 +00:00
Timofey Kirillov
5b9769fd62 chore: npm repack 2021-12-17 13:37:08 +03:00
Timofey Kirillov
6545aa68e3 fix: converge and dismiss actions should not require env param 2021-12-17 13:23:54 +03:00
Alexey Igrychev
bd2180a34d Merge pull request #48 from werf/chore_readme_fix_werf_logo
chore(readme): fix failed to load werf logo
2021-12-07 15:17:07 +00:00
Alexey Igrychev
efd32e8190 chore(readme): fix failed to load werf logo 2021-12-07 16:16:52 +01:00
Alexey Igrychev
0fed75c13c Merge pull request #46 from werf/docs_fix_werf_logo_in_readme
docs: fix werf logo in README.md
2021-11-10 13:27:47 +00:00
Alexey Igrychev
5aa19beb9e docs: fix werf logo in README.md 2021-11-10 14:27:35 +01:00
Alexey Igrychev
84fc1961b2 Merge pull request #44 from werf/feat_use_trdl_binaries
feat: download binaries directly from the trdl repository
2021-10-28 12:24:38 +01:00
Alexey Igrychev
8f92bdfbf0 feat: download binaries directly from the trdl repository 2021-10-27 22:11:56 +01:00
Alexey Igrychev
c8d9dcbd53 ci(test): add Test workflow 2021-10-27 21:57:05 +01:00
Alexey Igrychev
6f7411b1c0 build: update dependencies and lint configuration 2021-10-25 15:49:36 +01:00
Alexey Igrychev
00a90c715d Merge pull request #39 from werf/chore_update_readme
chore(docs): update README.md
2021-08-17 01:12:03 +02:00
Alexey Igrychev
cae57c1fe2 chore(docs): update README.md 2021-08-17 01:10:33 +02:00
Alexey Igrychev
5201be8745 Merge pull request #38 from werf/dependabot/npm_and_yarn/path-parse-1.0.7
Bump path-parse from 1.0.6 to 1.0.7
2021-08-16 10:47:46 +02:00
dependabot[bot]
86a1f64ff2 Bump path-parse from 1.0.6 to 1.0.7
Bumps [path-parse](https://github.com/jbgutierrez/path-parse) from 1.0.6 to 1.0.7.
- [Release notes](https://github.com/jbgutierrez/path-parse/releases)
- [Commits](https://github.com/jbgutierrez/path-parse/commits/v1.0.7)

---
updated-dependencies:
- dependency-name: path-parse
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-08-12 12:09:04 +00:00
Alexey Igrychev
d498415460 Merge pull request #37 from werf/alexey-igrychev-patch-1
chore(readme): tiny fix
2021-08-06 19:35:41 +02:00
Alexey Igrychev
850bbb65ad chore(readme): tiny fix 2021-08-06 19:35:29 +02:00
Alexey Igrychev
a73b4d34fd Merge pull request #36 from werf/alexey-igrychev-patch-1
chore(readme): fix typo
2021-08-06 17:10:55 +02:00
Alexey Igrychev
3dbf8c10c0 chore(readme): fix typo 2021-08-06 17:10:39 +02:00
Alexey Igrychev
01d8c1ceea Merge pull request #35 from werf/chore_readme_update_versions
chore(readme): update according to the latest versions
2021-08-06 16:42:28 +02:00
Alexey Igrychev
b7ed64f2df chore(readme): update according to the latest versions 2021-08-06 15:19:17 +02:00
Alexey Igrychev
2b23b0c4ff Merge pull request #32 from werf/dependabot/npm_and_yarn/ws-7.4.6
Bump ws from 7.3.1 to 7.4.6
2021-08-04 22:42:54 +02:00
Alexey Igrychev
283070759b Merge pull request #33 from werf/dependabot/npm_and_yarn/glob-parent-5.1.2
Bump glob-parent from 5.1.1 to 5.1.2
2021-08-04 22:42:46 +02:00
dependabot[bot]
56a4bc82d3 Bump glob-parent from 5.1.1 to 5.1.2
Bumps [glob-parent](https://github.com/gulpjs/glob-parent) from 5.1.1 to 5.1.2.
- [Release notes](https://github.com/gulpjs/glob-parent/releases)
- [Changelog](https://github.com/gulpjs/glob-parent/blob/main/CHANGELOG.md)
- [Commits](https://github.com/gulpjs/glob-parent/compare/v5.1.1...v5.1.2)

---
updated-dependencies:
- dependency-name: glob-parent
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-06-12 04:12:57 +00:00
dependabot[bot]
7c46a8aac9 Bump ws from 7.3.1 to 7.4.6
Bumps [ws](https://github.com/websockets/ws) from 7.3.1 to 7.4.6.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/7.3.1...7.4.6)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-30 11:41:28 +00:00
Alexey Igrychev
3e6d892594 Merge pull request #31 from werf/dependabot/npm_and_yarn/hosted-git-info-2.8.9
Bump hosted-git-info from 2.8.8 to 2.8.9
2021-05-12 09:40:44 +01:00
Alexey Igrychev
b03f6749c6 Merge pull request #30 from werf/dependabot/npm_and_yarn/lodash-4.17.21
Bump lodash from 4.17.19 to 4.17.21
2021-05-12 09:40:26 +01:00
dependabot[bot]
2ce1908426 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)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-11 18:43:43 +00:00
dependabot[bot]
3869de4804 Bump lodash from 4.17.19 to 4.17.21
Bumps [lodash](https://github.com/lodash/lodash) from 4.17.19 to 4.17.21.
- [Release notes](https://github.com/lodash/lodash/releases)
- [Commits](https://github.com/lodash/lodash/compare/4.17.19...4.17.21)

Signed-off-by: dependabot[bot] <support@github.com>
2021-05-11 15:31:26 +00:00
Alexey Igrychev
b2e09d839f Merge pull request #29 from werf/output_dotenv_instead_of_catting_source_file
Output envs loaded by the dotenv instead of printing a source file content
2021-03-18 16:14:43 -01:00
Alexey Igrychev
23596d318c Output envs loaded by the dotenv instead of printing a source file content 2021-03-18 17:12:32 +00:00
Alexey Igrychev
1802a119b1 Merge pull request #27 from werf/readme_update_links
[readme] Update links to werf documentation
2021-03-10 16:17:13 +00:00
Alexey Igrychev
8f134231c2 [readme] Update links to werf documentation 2021-03-10 16:16:10 +00:00
Alexey Igrychev
2bf444c364 [readme] Remove broken link 2021-03-10 16:12:57 +00:00
Alexey Igrychev
8e55e7d93d [readme] Add "Versioning" section 2021-03-10 15:47:08 +00:00
Alexey Igrychev
4d1cac7064 Merge pull request #25 from werf/readme_small_improvements
[readme] Small improvements
2021-03-10 14:55:49 +00:00
Alexey Igrychev
d8c14de78e [readme] Add "Working with container registry" section 2021-03-10 14:53:46 +00:00
Alexey Igrychev
ca52a4e8ec [readme] Update channels, werf release cycle and compatibility promise link 2021-03-10 14:37:41 +00:00
Alexey Igrychev
6e29948fe2 Merge pull request #24 from werf/readme_default_version
[readme] Update default MAJOR.MINOR group and channel
2021-03-10 14:34:20 +00:00
Alexey Igrychev
8037e10244 [readme] Update default MAJOR.MINOR group and channel 2021-03-10 14:33:13 +00:00
Alexey Igrychev
432a3754b4 Merge pull request #23 from werf/v1.2_actions
Actions for v1.2 werf versions
2021-03-10 14:24:58 +00:00
Alexey Igrychev
2df7b68580 Actions for v1.2 werf version
- remove actions not used in v1.2
- update the example arbitrary version
- embed v1.2 MAJOR.MINOR
2021-03-10 14:21:40 +00:00
41 changed files with 168638 additions and 373784 deletions

View File

@@ -1,6 +1,6 @@
{
"plugins": ["@typescript-eslint"],
"extends": ["plugin:github/es6"],
"plugins": ["@typescript-eslint", "github"],
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended","plugin:github/recommended"],
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaVersion": 9,
@@ -13,43 +13,10 @@
"eslint-comments/no-use": "off",
"import/no-namespace": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": "error",
"@typescript-eslint/no-require-imports": "error",
"@typescript-eslint/array-type": "error",
"@typescript-eslint/await-thenable": "error",
"@typescript-eslint/ban-ts-ignore": "error",
"camelcase": "off",
"@typescript-eslint/camelcase": "error",
"@typescript-eslint/class-name-casing": "error",
"@typescript-eslint/explicit-function-return-type": ["error", {"allowExpressions": true}],
"@typescript-eslint/func-call-spacing": ["error", "never"],
"@typescript-eslint/generic-type-naming": ["error", "^[A-Z][A-Za-z]*$"],
"@typescript-eslint/no-array-constructor": "error",
"@typescript-eslint/no-empty-interface": "error",
"@typescript-eslint/no-explicit-any": "error",
"@typescript-eslint/no-extraneous-class": "error",
"@typescript-eslint/no-for-in-array": "error",
"@typescript-eslint/no-inferrable-types": "error",
"@typescript-eslint/no-misused-new": "error",
"@typescript-eslint/no-namespace": "error",
"@typescript-eslint/no-non-null-assertion": "warn",
"@typescript-eslint/no-object-literal-type-assertion": "error",
"@typescript-eslint/no-unnecessary-qualifier": "error",
"@typescript-eslint/no-unnecessary-type-assertion": "error",
"@typescript-eslint/no-useless-constructor": "error",
"@typescript-eslint/no-var-requires": "error",
"@typescript-eslint/prefer-for-of": "warn",
"@typescript-eslint/prefer-function-type": "warn",
"@typescript-eslint/prefer-includes": "error",
"@typescript-eslint/prefer-interface": "error",
"@typescript-eslint/prefer-string-starts-ends-with": "error",
"@typescript-eslint/promise-function-async": "error",
"@typescript-eslint/require-array-sort-compare": "error",
"@typescript-eslint/restrict-plus-operands": "error",
"semi": "off",
"@typescript-eslint/semi": ["error", "never"],
"@typescript-eslint/type-annotation-spacing": "error",
"@typescript-eslint/unbound-method": "error"
"i18n-text/no-en": "off",
"sort-imports": "off"
},
"env": {
"node": true,

43
.github/workflows/test.yaml vendored Normal file
View File

@@ -0,0 +1,43 @@
name: Test
on:
push:
jobs:
channel:
name: By channel
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install
uses: ./install
- run: werf version
version:
name: By version
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macOS-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install
uses: ./install
with:
version: v2.31.1
- run: werf version

331
README.md
View File

@@ -1,85 +1,13 @@
<p align="center">
<img src="https://github.com/werf/werf/raw/master/docs/images/werf-logo.svg?sanitize=true" style="max-height:100%;" height="175">
<img src="https://werf.io/assets/images/werf-logo.svg?sanitize=true" style="max-height:100%;" height="175">
</p>
___
This action set allows you to organize CI/CD with GitHub Actions and [werf](https://github.com/werf/werf). The set consists of several independent and complex actions:
This action allows you to organize CI/CD with GitHub Actions and [werf](https://github.com/werf/werf).
- [werf/actions/converge](https://github.com/werf/actions/tree/master/converge)
- [werf/actions/build-and-publish](https://github.com/werf/actions/tree/master/build-and-publish)
- [werf/actions/build](https://github.com/werf/actions/tree/master/build)
- [werf/actions/publish](https://github.com/werf/actions/tree/master/build)
- [werf/actions/deploy](https://github.com/werf/actions/tree/master/deploy)
- [werf/actions/dismiss](https://github.com/werf/actions/tree/master/dismiss)
- [werf/actions/run](https://github.com/werf/actions/tree/master/run)
- [werf/actions/cleanup](https://github.com/werf/actions/tree/master/cleanup)
**Ready-to-use GitHub Actions Workflows** for different CI/CD workflows are available [here](https://werf.io/getting_started/?usage=ci&ci=githubActions&runnerType=hostRunner&os=linux&buildBackend=buildah&projectType=simplified&sharedCICD=no&repoType=application).
Each action combines all the necessary steps in itself and logic may be divided into environment setup and launching the corresponding command.
**Ready-to-use GitHub Actions Workflows** for different CI/CD workflows are available [here](https://werf.io/documentation/advanced/ci_cd/github_actions.html#complete-set-of-configurations-for-ready-made-workflows).
> Also, there is another action — [werf/actions/install](https://github.com/werf/actions/tree/master/install). With this action a user can just install werf and use binary within job steps for own purposes
## Environment setup in details
### werf binary setup
By default, all actions setup actual werf version for [1.1 alpha channel](https://werf.io/releases.html) (more details about channels, werf release cycle and compatibility promise [here](https://github.com/werf/werf#backward-compatibility-promise)).
Using the `channel` input the user can switch the release channel.
> This is recommended approach to be up-to-date and to use actual werf version without changing configurations
```yaml
- uses: werf/actions/converge@v1.1
with:
channel: alpha
```
Withal, it is not necessary to work within release channels, and the user might specify certain werf version with `version` input.
```yaml
- uses: werf/actions/converge@v1.1
with:
version: v1.1.23
```
### kubeconfig setup (*optional*)
The _kubeconfig_ may be used for deployment, cleanup, distributed locks and caches. Thus, the configuration should be added before step with the action or passed as base64 encoded data with `kube-config-base64-data` input:
* Prepare _kubeconfig_ (e.g. `cat ~/.kube/config | base64`) and save in GitHub Project Secrets (e.g. with name `KUBE_CONFIG_BASE64_DATA`).
* Pass secret with `kube-config-base64-data` input:
```yaml
- uses: werf/actions/build-and-publish@v1.1
with:
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
```
### werf ci-env
This command performs _docker login_ using `github-token`, sets up predefined variables based on GitHub Workflow context.
**Note** that `github-token` is optional in this action, and the input is there in case you need to use a non-default token.
By default, action will use the token provided to your workflow.
## Working with werf options
Any werf option can be defined with environment variables:
```yaml
- uses: werf/actions/build-and-publish@v1.1
env:
WERF_LOG_VERBOSE: "on"
WERF_TAG_CUSTOM_TAG1: tag1
WERF_TAG_CUSTOM_TAG2: tag2
```
## Examples
### converge
## How to use
```yaml
converge:
@@ -88,147 +16,130 @@ converge:
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Converge
uses: werf/actions/converge@v1.1
with:
env: production
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
```
### build, publish and deploy
```yaml
build-and-publish:
name: Build and Publish
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Build and Publish
uses: werf/actions/build-and-publish@v1.1
with:
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
deploy:
name: Deploy
needs: build-and-publish
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Deploy
uses: werf/actions/deploy@v1.1
with:
env: production
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
```
### dismiss
```yaml
dismiss:
name: Dismiss
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Dismiss
uses: werf/actions/dismiss@v1.1
with:
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
env: production
```
### run
```yaml
run:
name: Run
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Run
uses: werf/actions/run@v1.1
with:
image: backend
args: rails server
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
env:
WERF_DOCKER_OPTIONS: "-d -p 3000:3000"
```
### cleanup
```yaml
cleanup:
name: Cleanup
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow
- name: Cleanup
uses: werf/actions/cleanup@v1.1
with:
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
```
### install
```yaml
werf:
name: werf
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install werf CLI
uses: werf/actions/install@v1.1
# for deploy and distributed locks
- name: Create kube config
- name: Install werf
uses: werf/actions/install@v2
- name: Run script
run: |
KUBECONFIG=$(mktemp -d)/config
base64 -d <(printf "%s" $KUBE_CONFIG_BASE64_DATA) > $KUBECONFIG
echo KUBECONFIG=$KUBECONFIG >> $GITHUB_ENV
. $(werf ci-env github --as-file)
werf converge
env:
KUBE_CONFIG_BASE64_DATA: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
- name: Run werf commands
run: |
source $(werf ci-env github --as-file)
werf build-and-publish
werf deploy
env:
GITHUB_TOKEN: ${{ github.token }}
WERF_KUBECONFIG_BASE64: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
WERF_ENV: production
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
# License
## Versioning
When using action, select the version corresponding to the required `MAJOR` version of werf.
By default, the action installs actual werf version within alpha channel (more details about channels, werf release cycle and compatibility promise [here](https://werf.io/installation.html#all-changes-in-werf-go-through-all-stability-channels)).
Using the `channel` input the user can switch the release channel.
> This is recommended approach to be up-to-date and to use actual werf version without changing configurations.
```yaml
- uses: werf/actions/install@v2
with:
channel: alpha
```
Withal, it is not necessary to work within release channels, and the user might specify certain werf version with `version` input.
```yaml
- uses: werf/actions/install@v2
with:
version: v2.1.0
```
## FAQ
### werf always rebuilds images on new commit
Make sure to use `fetch-depth: 0` setting in the checkout action, like follows:
```yaml
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
```
By default, fetch-depth set to `1` which disables git history when checking out code. werf cache selection algorithm uses git history to determine whether some image bound to some commit could be used as a cache when building current commit (current commit should be descendant to the cache commit).
Setting `fetch-depth` to `0` enables full fetch of git history, and it is a **recommended** approach. It is also possible to limit fetch history with some decent number of commits, which would enable images caching limited to that number of commits, but this would have a negative impact on cache reproducibility.
### Working with container registry
If there is a need to perform authorization using custom credentials or in an external container registry, then you have to use a ready-made action tailored to your container registry (or just run `werf cr login`).
```yaml
converge:
name: Converge
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install werf
uses: werf/actions/install@v2
- name: cr login
run: werf cr login -u ${{ secrets.REGISTRY_USER }} -p ${{ secrets.REGISTRY_TOKEN }} registry.example.com
- name: converge
run: werf converge
env:
WERF_KUBECONFIG_BASE64: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
WERF_ENV: production
WERF_REPO: registry.example.com/repo
```
> Environment variables **`WERF_REPO`** and **`GITHUB_TOKEN`** for converge should only be used if building images is required otherwise they can be omitted
In the simplest case, if an [integrated GitHub Packages-like container registry](https://help.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-docker-for-use-with-github-packages) is used, then the authorization is performed automatically when the `werf ci-env` command is invoked. This command is run with several required arguments such as GitHub environment variables, the [`GITHUB_TOKEN` secret](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#about-the-github_token-secret) (you have to explicitly declare it).
### Building multi-platform images
To build multi-platform images or customize the build environment, you can use [docker/setup-buildx-action@v3](https://github.com/docker/setup-buildx-action).
```yaml
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Install werf
uses: werf/actions/install@v2
- name: cr login
run: werf cr login -u ${{ secrets.REGISTRY_USER }} -p ${{ secrets.REGISTRY_TOKEN }} registry.example.com
- name: converge
run: |
. $(werf ci-env github --as-file)
werf converge
env:
WERF_KUBECONFIG_BASE64: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
WERF_ENV: production
```
> No additional configuration is required, and QEMU is automatically used for cross-platform builds.
## License
Apache License 2.0, see [LICENSE](LICENSE)

View File

@@ -7,7 +7,7 @@ branding:
inputs:
channel:
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
default: 'alpha'
default: 'stable'
required: false
version:
description: 'The certain version'
@@ -23,5 +23,5 @@ inputs:
description: 'Base64 encoded kubeconfig data used for deployment, cleanup and distributed locks'
required: false
runs:
using: 'node12'
using: 'node20'
main: 'converge/index.js'

View File

@@ -1,101 +0,0 @@
<p align="center">
<img src="https://github.com/werf/werf/raw/master/docs/images/werf-logo.svg?sanitize=true" style="max-height:100%;" height="175">
</p>
___
The action combines all the necessary steps in itself and logic may be divided into environment setup and launching `werf build-and-publish`.
## Action in Details
### werf binary setup
By default, all actions setup actual werf version for [1.1 alpha channel](https://werf.io/releases.html) (more details about channels, werf release cycle and compatibility promise [here](https://github.com/werf/werf#backward-compatibility-promise)).
Using the `channel` input the user can switch the release channel.
> This is recommended approach to be up-to-date and to use actual werf version without changing configurations
```yaml
- uses: werf/actions/build-and-publish@v1.1
with:
channel: alpha
```
Withal, it is not necessary to work within release channels, and the user might specify certain werf version with `version` input.
```yaml
- uses: werf/actions/build-and-publish@v1.1
with:
version: v1.1.23
```
### kubeconfig setup (*optional*)
The _kubeconfig_ may be used for deployment, cleanup, distributed locks and caches. Thus, the configuration should be added before step with the action or passed as base64 encoded data with `kube-config-base64-data` input:
* Prepare _kubeconfig_ (e.g. `cat ~/.kube/config | base64`) and save in GitHub Project Secrets (e.g. with name `KUBE_CONFIG_BASE64_DATA`).
* Pass secret with `kube-config-base64-data` input:
```yaml
- uses: werf/actions/build-and-publish@v1.1
with:
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
```
### werf ci-env
This command performs _docker login_ using `github-token`, sets up predefined variables based on GitHub Workflow context.
**Note** that `github-token` is optional in this action, and the input is there in case you need to use a non-default token.
By default, action will use the token provided to your workflow.
## Working with werf options
Any werf option can be defined with environment variables:
```yaml
- uses: werf/actions/build-and-publish@v1.1
env:
WERF_LOG_VERBOSE: "on"
WERF_TAG_CUSTOM_TAG1: tag1
WERF_TAG_CUSTOM_TAG2: tag2
```
## Inputs
```yaml
channel:
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
default: 'alpha'
required: false
version:
description: 'The certain version'
required: false
github-token:
description: 'The GitHub token used to login and to interact with Docker Github Packages'
default: ${{ github.token }}
required: false
kube-config-base64-data:
description: 'Base64 encoded kubeconfig data used for deployment, cleanup and distributed locks'
required: false
```
## Example
```yaml
build-and-publish:
name: Build and Publish
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Build and Publish
uses: werf/actions/build-and-publish@v1.1
with:
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
```

View File

@@ -1,24 +0,0 @@
name: werf build-and-publish
author: 'Flant'
description: 'Prepare the environment and perform image building and publishing with werf'
branding:
color: blue
icon: anchor
inputs:
channel:
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
default: 'alpha'
required: false
version:
description: 'The certain version'
required: false
github-token:
description: 'The GitHub token used to login and to interact with Docker Github Packages'
default: ${{ github.token }}
required: false
kube-config-base64-data:
description: 'Base64 encoded kubeconfig data used for deployment, cleanup and distributed locks'
required: false
runs:
using: 'node12'
main: 'index.js'

File diff suppressed because one or more lines are too long

View File

@@ -5,69 +5,12 @@ ___
The action combines all the necessary steps in itself and logic may be divided into environment setup and launching `werf build`.
## Action in Details
### werf binary setup
By default, all actions setup actual werf version for [1.1 alpha channel](https://werf.io/releases.html) (more details about channels, werf release cycle and compatibility promise [here](https://github.com/werf/werf#backward-compatibility-promise)).
Using the `channel` input the user can switch the release channel.
> This is recommended approach to be up-to-date and to use actual werf version without changing configurations
```yaml
- uses: werf/actions/build@v1.1
with:
channel: alpha
```
Withal, it is not necessary to work within release channels, and the user might specify certain werf version with `version` input.
```yaml
- uses: werf/actions/build@v1.1
with:
version: v1.1.23
```
### kubeconfig setup (*optional*)
The _kubeconfig_ may be used for deployment, cleanup, distributed locks and caches. Thus, the configuration should be added before step with the action or passed as base64 encoded data with `kube-config-base64-data` input:
* Prepare _kubeconfig_ (e.g. `cat ~/.kube/config | base64`) and save in GitHub Project Secrets (e.g. with name `KUBE_CONFIG_BASE64_DATA`).
* Pass secret with `kube-config-base64-data` input:
```yaml
- uses: werf/actions/build@v1.1
with:
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
```
### werf ci-env
This command performs _docker login_ using `github-token`, sets up predefined variables based on GitHub Workflow context.
**Note** that `github-token` is optional in this action, and the input is there in case you need to use a non-default token.
By default, action will use the token provided to your workflow.
## Working with werf options
Any werf option can be defined with environment variables:
```yaml
- uses: werf/actions/build@v1.1
env:
WERF_LOG_VERBOSE: "on"
WERF_TAG_CUSTOM_TAG1: tag1
WERF_TAG_CUSTOM_TAG2: tag2
```
## Inputs
```yaml
channel:
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
default: 'alpha'
default: 'stable'
required: false
version:
description: 'The certain version'
@@ -90,12 +33,12 @@ build:
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Build
uses: werf/actions/build@v1.1
uses: werf/actions/build@v2
with:
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
```

View File

@@ -7,7 +7,7 @@ branding:
inputs:
channel:
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
default: 'alpha'
default: 'stable'
required: false
version:
description: 'The certain version'
@@ -20,5 +20,5 @@ inputs:
description: 'Base64 encoded kubeconfig data used for deployment, cleanup and distributed locks'
required: false
runs:
using: 'node12'
using: 'node20'
main: 'index.js'

File diff suppressed because one or more lines are too long

View File

@@ -5,67 +5,12 @@ ___
The action combines all the necessary steps in itself and logic may be divided into environment setup and launching `werf cleanup`.
## Action in Details
### werf binary setup
By default, all actions setup actual werf version for [1.1 alpha channel](https://werf.io/releases.html) (more details about channels, werf release cycle and compatibility promise [here](https://github.com/werf/werf#backward-compatibility-promise)).
Using the `channel` input the user can switch the release channel.
> This is recommended approach to be up-to-date and to use actual werf version without changing configurations
```yaml
- uses: werf/actions/cleanup@v1.1
with:
channel: alpha
```
Withal, it is not necessary to work within release channels, and the user might specify certain werf version with `version` input.
```yaml
- uses: werf/actions/cleanup@v1.1
with:
version: v1.1.23
```
### kubeconfig setup (*optional*)
The _kubeconfig_ may be used for deployment, cleanup, distributed locks and caches. Thus, the configuration should be added before step with the action or passed as base64 encoded data with `kube-config-base64-data` input:
* Prepare _kubeconfig_ (e.g. `cat ~/.kube/config | base64`) and save in GitHub Project Secrets (e.g. with name `KUBE_CONFIG_BASE64_DATA`).
* Pass secret with `kube-config-base64-data` input:
```yaml
- uses: werf/actions/cleanup@v1.1
with:
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
```
### werf ci-env
This command performs _docker login_ using `github-token`, sets up predefined variables based on GitHub Workflow context.
**Note** that `github-token` is optional in this action, and the input is there in case you need to use a non-default token.
By default, action will use the token provided to your workflow.
## Working with werf options
Any werf option can be defined with environment variables:
```yaml
- uses: werf/actions/cleanup@v1.1
env:
WERF_LOG_VERBOSE: "on"
```
## Inputs
```yaml
channel:
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
default: 'alpha'
default: 'stable'
required: false
version:
description: 'The certain version'
@@ -88,13 +33,15 @@ cleanup:
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Fetch all history for all tags and branches
run: git fetch --prune --unshallow
- name: Cleanup
uses: werf/actions/cleanup@v1.1
uses: werf/actions/cleanup@v2
with:
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
env:
WERF_REPO_GITHUB_TOKEN: ${{ secrets.WERF_CLEANUP_PAM }}
```

View File

@@ -7,7 +7,7 @@ branding:
inputs:
channel:
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
default: 'alpha'
default: 'stable'
required: false
version:
description: 'The certain version'
@@ -20,5 +20,5 @@ inputs:
description: 'Base64 encoded kubeconfig data used for deployment, cleanup and distributed locks'
required: false
runs:
using: 'node12'
using: 'node20'
main: 'index.js'

File diff suppressed because one or more lines are too long

View File

@@ -5,69 +5,12 @@ ___
The action combines all the necessary steps in itself and logic may be divided into environment setup and launching `werf converge`.
## Action in Details
### werf binary setup
By default, all actions setup actual werf version for [1.1 alpha channel](https://werf.io/releases.html) (more details about channels, werf release cycle and compatibility promise [here](https://github.com/werf/werf#backward-compatibility-promise)).
Using the `channel` input the user can switch the release channel.
> This is recommended approach to be up-to-date and to use actual werf version without changing configurations
```yaml
- uses: werf/actions/converge@v1.1
with:
channel: alpha
```
Withal, it is not necessary to work within release channels, and the user might specify certain werf version with `version` input.
```yaml
- uses: werf/actions/converge@v1.1
with:
version: v1.1.23
```
### kubeconfig setup (*optional*)
The _kubeconfig_ may be used for deployment, cleanup, distributed locks and caches. Thus, the configuration should be added before step with the action or passed as base64 encoded data with `kube-config-base64-data` input:
* Prepare _kubeconfig_ (e.g. `cat ~/.kube/config | base64`) and save in GitHub Project Secrets (e.g. with name `KUBE_CONFIG_BASE64_DATA`).
* Pass secret with `kube-config-base64-data` input:
```yaml
- uses: werf/actions/converge@v1.1
with:
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
```
### werf ci-env
This command performs _docker login_ using `github-token`, sets up predefined variables based on GitHub Workflow context.
**Note** that `github-token` is optional in this action, and the input is there in case you need to use a non-default token.
By default, action will use the token provided to your workflow.
## Working with werf options
Any werf option can be defined with environment variables:
```yaml
- uses: werf/actions/converge@v1.1
with:
env: production
env:
WERF_LOG_VERBOSE: "on"
```
## Inputs
```yaml
channel:
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
default: 'alpha'
default: 'stable'
required: false
version:
description: 'The certain version'
@@ -93,12 +36,12 @@ converge:
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Converge
uses: werf/actions/converge@v1.1
uses: werf/actions/converge@v2
with:
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
env: production

View File

@@ -7,14 +7,14 @@ branding:
inputs:
channel:
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
default: 'alpha'
default: 'stable'
required: false
version:
description: 'The certain version'
required: false
env:
env: # TODO: Remove this deprecated werf option, which is not required anymore (use WERF_ENV variable instead)
description: 'Specific deployment environment'
required: true
required: false
github-token:
description: 'The GitHub token used to login and to interact with Docker Github Packages'
default: ${{ github.token }}
@@ -23,5 +23,5 @@ inputs:
description: 'Base64 encoded kubeconfig data used for deployment, cleanup and distributed locks'
required: false
runs:
using: 'node12'
using: 'node20'
main: 'index.js'

File diff suppressed because one or more lines are too long

View File

@@ -1,105 +0,0 @@
<p align="center">
<img src="https://github.com/werf/werf/raw/master/docs/images/werf-logo.svg?sanitize=true" style="max-height:100%;" height="175">
</p>
___
The action combines all the necessary steps in itself and logic may be divided into environment setup and launching `werf deploy`.
## Action in Details
### werf binary setup
By default, all actions setup actual werf version for [1.1 alpha channel](https://werf.io/releases.html) (more details about channels, werf release cycle and compatibility promise [here](https://github.com/werf/werf#backward-compatibility-promise)).
Using the `channel` input the user can switch the release channel.
> This is recommended approach to be up-to-date and to use actual werf version without changing configurations
```yaml
- uses: werf/actions/deploy@v1.1
with:
channel: alpha
```
Withal, it is not necessary to work within release channels, and the user might specify certain werf version with `version` input.
```yaml
- uses: werf/actions/deploy@v1.1
with:
version: v1.1.23
```
### kubeconfig setup (*optional*)
The _kubeconfig_ may be used for deployment, cleanup, distributed locks and caches. Thus, the configuration should be added before step with the action or passed as base64 encoded data with `kube-config-base64-data` input:
* Prepare _kubeconfig_ (e.g. `cat ~/.kube/config | base64`) and save in GitHub Project Secrets (e.g. with name `KUBE_CONFIG_BASE64_DATA`).
* Pass secret with `kube-config-base64-data` input:
```yaml
- uses: werf/actions/deploy@v1.1
with:
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
```
### werf ci-env
This command performs _docker login_ using `github-token`, sets up predefined variables based on GitHub Workflow context.
**Note** that `github-token` is optional in this action, and the input is there in case you need to use a non-default token.
By default, action will use the token provided to your workflow.
## Working with werf options
Any werf option can be defined with environment variables:
```yaml
- uses: werf/actions/deploy@v1.1
with:
env: production
env:
WERF_LOG_VERBOSE: "on"
```
## Inputs
```yaml
channel:
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
default: 'alpha'
required: false
version:
description: 'The certain version'
required: false
env:
description: 'Specific deployment environment'
required: true
github-token:
description: 'The GitHub token used to login and to interact with Docker Github Packages'
default: ${{ github.token }}
required: false
kube-config-base64-data:
description: 'Base64 encoded kubeconfig data used for deployment, cleanup and distributed locks'
required: false
```
## Example
```yaml
deploy:
name: Deploy
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Deploy
uses: werf/actions/deploy@v1.1
with:
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
env: production
```

View File

@@ -1,27 +0,0 @@
name: werf build-and-publish
author: 'Flant'
description: 'Prepare the environment and perform deployment with werf'
branding:
color: blue
icon: anchor
inputs:
channel:
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
default: 'alpha'
required: false
version:
description: 'The certain version'
required: false
env:
description: 'Specific deployment environment'
required: true
github-token:
description: 'The GitHub token used to login and to interact with Docker Github Packages'
default: ${{ github.token }}
required: false
kube-config-base64-data:
description: 'Base64 encoded kubeconfig data used for deployment, cleanup and distributed locks'
required: false
runs:
using: 'node12'
main: 'index.js'

File diff suppressed because one or more lines are too long

View File

@@ -5,69 +5,12 @@ ___
The action combines all the necessary steps in itself and logic may be divided into environment setup and launching `werf dismiss`.
## Action in Details
### werf binary setup
By default, all actions setup actual werf version for [1.1 alpha channel](https://werf.io/releases.html) (more details about channels, werf release cycle and compatibility promise [here](https://github.com/werf/werf#backward-compatibility-promise)).
Using the `channel` input the user can switch the release channel.
> This is recommended approach to be up-to-date and to use actual werf version without changing configurations
```yaml
- uses: werf/actions/converge@v1.1
with:
channel: alpha
```
Withal, it is not necessary to work within release channels, and the user might specify certain werf version with `version` input.
```yaml
- uses: werf/actions/converge@v1.1
with:
version: v1.1.23
```
### kubeconfig setup (*optional*)
The _kubeconfig_ may be used for deployment, cleanup, distributed locks and caches. Thus, the configuration should be added before step with the action or passed as base64 encoded data with `kube-config-base64-data` input:
* Prepare _kubeconfig_ (e.g. `cat ~/.kube/config | base64`) and save in GitHub Project Secrets (e.g. with name `KUBE_CONFIG_BASE64_DATA`).
* Pass secret with `kube-config-base64-data` input:
```yaml
- uses: werf/actions/converge@v1.1
with:
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
```
### werf ci-env
This command performs _docker login_ using `github-token`, sets up predefined variables based on GitHub Workflow context.
**Note** that `github-token` is optional in this action, and the input is there in case you need to use a non-default token.
By default, action will use the token provided to your workflow.
## Working with werf options
Any werf option can be defined with environment variables:
```yaml
- uses: werf/actions/converge@v1.1
with:
env: production
env:
WERF_LOG_VERBOSE: "on"
```
## Inputs
```yaml
channel:
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
default: 'alpha'
default: 'stable'
required: false
version:
description: 'The certain version'
@@ -93,10 +36,10 @@ dismiss:
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Dismiss
uses: werf/actions/dismiss@v1.1
uses: werf/actions/dismiss@v2
with:
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
env: production

View File

@@ -7,14 +7,14 @@ branding:
inputs:
channel:
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
default: 'alpha'
default: 'stable'
required: false
version:
description: 'The certain version'
required: false
env:
env: # TODO: Remove this deprecated werf option, which is not required anymore (use WERF_ENV variable instead)
description: 'Specific deployment environment'
required: true
required: false
github-token:
description: 'The GitHub token used to login and to interact with Docker Github Packages'
default: ${{ github.token }}
@@ -23,5 +23,5 @@ inputs:
description: 'Base64 encoded kubeconfig data used for deployment, cleanup and distributed locks'
required: false
runs:
using: 'node12'
using: 'node20'
main: 'index.js'

File diff suppressed because one or more lines are too long

View File

@@ -3,13 +3,13 @@
</p>
___
By default, all actions setup actual werf version for [1.1 alpha channel](https://werf.io/releases.html) (more details about channels, werf release cycle and compatibility promise [here](https://github.com/werf/werf#backward-compatibility-promise)).
By default, all actions setup actual werf version for 1.2 alpha channel (more details about channels, werf release cycle and compatibility promise [here](https://werf.io/installation.html#all-changes-in-werf-go-through-all-stability-channels)).
Using the `channel` input the user can switch the release channel.
> This is recommended approach to be up-to-date and to use actual werf version without changing configurations
```yaml
- uses: werf/actions/install@v1.1
- uses: werf/actions/install@v2
with:
channel: alpha
```
@@ -17,9 +17,9 @@ Using the `channel` input the user can switch the release channel.
Withal, it is not necessary to work within release channels, and the user might specify certain werf version with `version` input.
```yaml
- uses: werf/actions/install@v1.1
- uses: werf/actions/install@v2
with:
version: v1.1.23
version: v2.1.0
```
## Inputs
@@ -27,7 +27,7 @@ Withal, it is not necessary to work within release channels, and the user might
```yaml
channel:
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
default: 'alpha'
default: 'stable'
required: false
version:
description: 'The certain version'
@@ -43,12 +43,12 @@ werf:
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install werf CLI
uses: werf/actions/install@v1.1
uses: werf/actions/install@v2
# for deploy and distributed locks
# For deploy and distributed locks.
- name: Create kube config
run: |
KUBECONFIG=$(mktemp -d)/config
@@ -60,9 +60,9 @@ werf:
- name: Run werf commands
run: |
source $(werf ci-env github --as-file)
werf build-and-publish
werf deploy
werf render
werf converge
env:
GITHUB_TOKEN: ${{ github.token }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WERF_ENV: production
```

View File

@@ -1,13 +1,13 @@
name: Install werf CLI
author: 'Flant'
description: 'Install actual channel werf version, like multiwerf does, or specified one'
description: 'Install werf CLI'
branding:
color: blue
icon: anchor
inputs:
channel:
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
default: 'alpha'
default: 'stable'
required: false
version:
description: 'The certain version'
@@ -17,5 +17,5 @@ inputs:
default: '0'
required: false
runs:
using: 'node12'
using: 'node20'
main: 'index.js'

File diff suppressed because one or more lines are too long

View File

@@ -1,3 +1,3 @@
#!/bin/bash -e
for pkg in build build-and-publish cleanup converge deploy dismiss install publish run; do ncc build src/$pkg.ts -o $pkg; done
for pkg in build cleanup converge dismiss install run; do ncc build src/$pkg.ts -o $pkg; done

7581
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@@ -1,31 +1,31 @@
{
"name": "werf-actions",
"version": "1.1.0",
"version": "1.2.1",
"description": "",
"main": "lib",
"dependencies": {
"@actions/core": "^1.2.6",
"@actions/github": "2.x",
"@actions/tool-cache": "1.x",
"dotenv": "8.2.x",
"ncc": "^0.3.6",
"semver": "^7.3.2",
"@actions/core": "^1.9.1",
"@actions/github": "^5.0.0",
"@actions/tool-cache": "^1.7.1",
"dotenv": "10.0.x",
"semver": "^7.5.2",
"string-argv": "^0.3.1",
"superagent": "^3.8.3",
"superagent": "^6.1.0",
"tmp": "^0.2.1",
"typescript-string-operations": "^1.4.0",
"ws": ">=3.3.1"
"ws": ">=8.2.3"
},
"devDependencies": {
"@types/node": "^12.19.1",
"@types/semver": "^7.3.4",
"@types/superagent": "^4.1.10",
"@types/tmp": "^0.2.0",
"@typescript-eslint/parser": "^2.8.0",
"eslint": "^5.x",
"eslint-plugin-github": "^2.0.0",
"@typescript-eslint/eslint-plugin": "^5.1.0",
"@typescript-eslint/parser": "^5.1.0",
"eslint": "^7.32.0",
"eslint-plugin-github": "^4.3.2",
"js-yaml": "^3.13.1",
"node-fetch": ">=2.6.1",
"node-fetch": ">=3.2.10",
"prettier": "^1.19.1",
"typescript": "^3.6.4"
},
@@ -34,7 +34,7 @@
"format": "prettier --write **/*.ts",
"format-check": "prettier --check **/*.ts",
"lint": "eslint src/**/*.ts",
"pack": "pack.sh",
"pack": "./pack.sh",
"all": "npm run build && npm run format && npm run lint && npm run pack"
},
"repository": {

View File

@@ -1,101 +0,0 @@
<p align="center">
<img src="https://github.com/werf/werf/raw/master/docs/images/werf-logo.svg?sanitize=true" style="max-height:100%;" height="175">
</p>
___
The action combines all the necessary steps in itself and logic may be divided into environment setup and launching `werf publish`.
## Action in Details
### werf binary setup
By default, all actions setup actual werf version for [1.1 alpha channel](https://werf.io/releases.html) (more details about channels, werf release cycle and compatibility promise [here](https://github.com/werf/werf#backward-compatibility-promise)).
Using the `channel` input the user can switch the release channel.
> This is recommended approach to be up-to-date and to use actual werf version without changing configurations
```yaml
- uses: werf/actions/publish@v1.1
with:
channel: alpha
```
Withal, it is not necessary to work within release channels, and the user might specify certain werf version with `version` input.
```yaml
- uses: werf/actions/publish@v1.1
with:
version: v1.1.23
```
### kubeconfig setup (*optional*)
The _kubeconfig_ may be used for deployment, cleanup, distributed locks and caches. Thus, the configuration should be added before step with the action or passed as base64 encoded data with `kube-config-base64-data` input:
* Prepare _kubeconfig_ (e.g. `cat ~/.kube/config | base64`) and save in GitHub Project Secrets (e.g. with name `KUBE_CONFIG_BASE64_DATA`).
* Pass secret with `kube-config-base64-data` input:
```yaml
- uses: werf/actions/publish@v1.1
with:
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
```
### werf ci-env
This command performs _docker login_ using `github-token`, sets up predefined variables based on GitHub Workflow context.
**Note** that `github-token` is optional in this action, and the input is there in case you need to use a non-default token.
By default, action will use the token provided to your workflow.
## Working with werf options
Any werf option can be defined with environment variables:
```yaml
- uses: werf/actions/publish@v1.1
env:
WERF_LOG_VERBOSE: "on"
WERF_TAG_CUSTOM_TAG1: tag1
WERF_TAG_CUSTOM_TAG2: tag2
```
## Inputs
```yaml
channel:
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
default: 'alpha'
required: false
version:
description: 'The certain version'
required: false
github-token:
description: 'The GitHub token used to login and to interact with Docker Github Packages'
default: ${{ github.token }}
required: false
kube-config-base64-data:
description: 'Base64 encoded kubeconfig data used for deployment, cleanup and distributed locks'
required: false
```
## Example
```yaml
publish:
name: Publish
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Publish
uses: werf/actions/publish@v1.1
with:
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
```

View File

@@ -1,24 +0,0 @@
name: werf publish
author: 'Flant'
description: 'Prepare the environment and perform image publishing with werf'
branding:
color: blue
icon: anchor
inputs:
channel:
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
default: 'alpha'
required: false
version:
description: 'The certain version'
required: false
github-token:
description: 'The GitHub token used to login and to interact with Docker Github Packages'
default: ${{ github.token }}
required: false
kube-config-base64-data:
description: 'Base64 encoded kubeconfig data used for deployment, cleanup and distributed locks'
required: false
runs:
using: 'node12'
main: 'index.js'

File diff suppressed because one or more lines are too long

View File

@@ -5,70 +5,13 @@ ___
The action combines all the necessary steps in itself and logic may be divided into environment setup and launching `werf run`.
## Action in Details
### werf binary setup
By default, all actions setup actual werf version for [1.1 alpha channel](https://werf.io/releases.html) (more details about channels, werf release cycle and compatibility promise [here](https://github.com/werf/werf#backward-compatibility-promise)).
Using the `channel` input the user can switch the release channel.
> This is recommended approach to be up-to-date and to use actual werf version without changing configurations
```yaml
- uses: werf/actions/run@v1.1
with:
channel: alpha
```
Withal, it is not necessary to work within release channels, and the user might specify certain werf version with `version` input.
```yaml
- uses: werf/actions/run@v1.1
with:
version: v1.1.23
```
### kubeconfig setup (*optional*)
The _kubeconfig_ may be used for deployment, cleanup, distributed locks and caches. Thus, the configuration should be added before step with the action or passed as base64 encoded data with `kube-config-base64-data` input:
* Prepare _kubeconfig_ (e.g. `cat ~/.kube/config | base64`) and save in GitHub Project Secrets (e.g. with name `KUBE_CONFIG_BASE64_DATA`).
* Pass secret with `kube-config-base64-data` input:
```yaml
- uses: werf/actions/run@v1.1
with:
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
```
### werf ci-env
This command performs _docker login_ using `github-token`, sets up predefined variables based on GitHub Workflow context.
**Note** that `github-token` is optional in this action, and the input is there in case you need to use a non-default token.
By default, action will use the token provided to your workflow.
## Working with werf options
Any werf option can be defined with environment variables:
```yaml
- uses: werf/actions/run@v1.1
env:
WERF_LOG_VERBOSE: "on"
WERF_TAG_CUSTOM_TAG1: tag1
WERF_TAG_CUSTOM_TAG2: tag2
```
## Inputs
```yaml
inputs:
channel:
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
default: 'alpha'
default: 'stable'
required: false
version:
description: 'The certain version'
@@ -97,12 +40,12 @@ run:
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run
uses: werf/actions/run@v1.1
uses: werf/actions/run@v2
with:
image: backend
args: rails server

View File

@@ -7,7 +7,7 @@ branding:
inputs:
channel:
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
default: 'alpha'
default: 'stable'
required: false
version:
description: 'The certain version'
@@ -26,5 +26,5 @@ inputs:
description: 'Base64 encoded kubeconfig data used for deployment, cleanup and distributed locks'
required: false
runs:
using: 'node12'
using: 'node20'
main: 'index.js'

66498
run/index.js

File diff suppressed because one or more lines are too long

View File

@@ -1,12 +0,0 @@
import * as core from '@actions/core'
import {PrepareEnvironAndRunWerfCommand} from './common'
async function run(): Promise<void> {
try {
await PrepareEnvironAndRunWerfCommand(['build-and-publish'])
} catch (error) {
core.setFailed(error.message)
}
}
run()

View File

@@ -7,8 +7,6 @@ import {String} from 'typescript-string-operations'
import {Manager} from './manager'
import * as werf from './werf'
const minimalWerfVersion = 'v1.1.17'
export async function PrepareEnvironAndRunWerfCommand(
args: string[]
): Promise<void> {
@@ -47,13 +45,17 @@ export async function SetupKubeConfig(
export function ProcessGitHubContext(): void {
if (context.eventName === 'pull_request') {
if (context.payload.pull_request) {
// Do nothing if virtual merge variable is already set
if (process.env.WERF_VIRTUAL_MERGE) {
return
}
const baseSha = context.payload.pull_request.base.sha
const headSha = context.payload.pull_request.head.sha
process.env.WERF_VIRTUAL_MERGE = '1'
process.env.WERF_VIRTUAL_MERGE_FROM_COMMIT = headSha
process.env.WERF_VIRTUAL_MERGE_INTO_COMMIT = baseSha
core.exportVariable('WERF_VIRTUAL_MERGE', '1')
core.exportVariable('WERF_VIRTUAL_MERGE_FROM_COMMIT', headSha)
core.exportVariable('WERF_VIRTUAL_MERGE_INTO_COMMIT', baseSha)
@@ -63,27 +65,15 @@ export function ProcessGitHubContext(): void {
export function ValidateWerfVersion(version: string): void {
const ver = semver.coerce(version)
if (ver) {
if (ver.major !== werf.MAJOR || ver.minor !== werf.MINOR) {
throw new Error(
String.Format(
'The arbitrary version ({0}) must be within the MAJOR.MINOR ({1})',
version.trim(),
werf.MAJOR_MINOR_GROUP
)
)
}
if (semver.gte(ver, minimalWerfVersion)) {
return
}
if (ver && ver.major === werf.MAJOR) {
return
}
throw new Error(
String.Format(
'werf version {0} is not supported (expected version must be equal or greater than {1})',
'werf version {0} is not supported: the version must be semver and within the MAJOR ({1})',
version.trim(),
minimalWerfVersion
werf.GROUP
)
)
}

View File

@@ -1,13 +0,0 @@
import * as core from '@actions/core'
import {PrepareEnvironAndRunWerfCommand} from './common'
async function run(): Promise<void> {
try {
process.env.WERF_ENV = core.getInput('env')
await PrepareEnvironAndRunWerfCommand(['deploy'])
} catch (error) {
core.setFailed(error.message)
}
}
run()

View File

@@ -1,8 +1,11 @@
import * as core from '@actions/core'
import {Manager} from './manager'
import {ProcessGitHubContext} from './common'
async function run(): Promise<void> {
try {
ProcessGitHubContext()
const m = new Manager()
await m.Install()
} catch (error) {

View File

@@ -12,9 +12,9 @@ import * as dotenv from 'dotenv'
import * as werf from './werf'
import {ValidateWerfVersion} from './common'
const WERF_API_GET_CHANNEL_VERSION_URL_METHOD =
'https://werf.io/api/getChannelVersionURL'
const WERF_API_GET_VERSION_URL_METHOD = 'https://werf.io/api/getVersionURL'
const WERF_TUF_SERVER_URL = 'https://tuf.werf.io'
const CACHE_TOOL_NAME = 'werf'
const CACHE_TOOL_DIR = 'werf-tools'
export class Manager {
private readonly channel: string
@@ -32,24 +32,44 @@ export class Manager {
ValidateWerfVersion(this.version)
}
if (process.platform.toString() === 'win32') {
this.os = 'windows'
} else {
this.os = process.platform.toString()
const platform = process.platform.toString()
switch (platform) {
case 'linux':
case 'darwin':
this.os = platform
break
case 'win32':
this.os = 'windows'
break
default:
throw new Error(String.Format(`The platform ${platform} not supported`))
}
this.arch = process.arch
const arch = process.arch
switch (arch) {
case 'x64':
this.arch = 'amd64'
break
case 'arm64':
this.arch = 'arm64'
break
default:
throw new Error(String.Format(`The architecture ${arch} not supported`))
}
}
public async Install(): Promise<void> {
const actualBinaryUrl = await this._getActualBinaryUrl()
const binaryName = actualBinaryUrl.substring(
actualBinaryUrl.lastIndexOf('/') + 1
)
const cachedPath = cache.find(
'werf',
CACHE_TOOL_NAME,
Manager._toolVersionCacheID(actualBinaryUrl)
)
if (cachedPath) {
this.binaryPath = path.join(cachedPath, 'werf')
this.binaryPath = path.join(cachedPath, binaryName)
} else {
this.binaryPath = await this._downloadAndCache(actualBinaryUrl)
}
@@ -62,16 +82,13 @@ export class Manager {
const tmpFile = tmp.fileSync()
const tmpFilePath = tmpFile.name
await this.Exec(['ci-env', 'github', '--as-env-file', '-o', tmpFilePath])
dotenv.config({path: tmpFilePath})
fs.readFile(tmpFilePath, null, function(err, contents) {
if (err) {
console.error(err)
} else {
console.log(contents.toString())
const res = dotenv.config({path: tmpFilePath})
if (res.parsed) {
for (const [key, value] of Object.entries(res.parsed)) {
core.exportVariable(key, value)
}
})
}
console.log(res.parsed)
tmpFile.removeCallback()
}
@@ -103,35 +120,29 @@ export class Manager {
}
private async _getActualBinaryUrl(): Promise<string> {
if (this.version !== '') {
const version = this.version.slice('v'.length)
return this._constructReleaseUrl(version)
}
const url = `${WERF_TUF_SERVER_URL}/targets/channels/${werf.GROUP}/${this.channel}`
try {
let url: string
let query: {}
if (this.version !== '') {
url = WERF_API_GET_VERSION_URL_METHOD
query = {
version: this.version,
os: this.os,
arch: this.arch
}
} else {
url = WERF_API_GET_CHANNEL_VERSION_URL_METHOD
query = {
group: werf.MAJOR_MINOR_GROUP,
channel: this.channel,
os: this.os,
arch: this.arch
}
}
const resp = await request.get(url).query(query)
return resp.body.data.toString()
const resp = await request
.get(url)
.buffer(true)
.parse(request.parse['application/octet-stream'])
const version = resp.body.toString().trim()
return this._constructReleaseUrl(version)
} catch (err) {
if (err.response && err.response.error) {
let errMessage = err.response.error.message
if (err.response.text) {
errMessage = String.Format('{0}\n{1}', errMessage, err.response.text)
errMessage = String.Format(
'{0}: {1}\n{2}',
url,
errMessage,
err.response.text
)
}
throw Error(errMessage)
@@ -141,19 +152,32 @@ export class Manager {
}
}
private _constructReleaseUrl(version: string): string {
let ext = ''
if (this.os === 'windows') {
ext = '.exe'
}
return String.Format(
'{0}/targets/releases/{1}/{2}-{3}/bin/werf{4}',
WERF_TUF_SERVER_URL,
version,
this.os,
this.arch,
ext
)
}
private async _downloadAndCache(binaryUrl: string): Promise<string> {
const binaryName = binaryUrl.substring(binaryUrl.lastIndexOf('/') + 1)
const downloadedBinaryPath = await cache.downloadTool(binaryUrl)
const parsedDownloadedBinaryPath = path.parse(downloadedBinaryPath)
const cacheDownloadToolDir = parsedDownloadedBinaryPath.dir
const tmpWerfVersionBinaryPath = path.join(cacheDownloadToolDir, 'werf.tmp')
const werfVersionDir = path.join(
const cacheDownloadToolDir = path.dirname(downloadedBinaryPath)
const tmpWerfVersionBinaryPath = path.join(
cacheDownloadToolDir,
parsedDownloadedBinaryPath.name
)
const werfVersionBinaryPath = path.join(
werfVersionDir,
String.Format('werf{0}', parsedDownloadedBinaryPath.ext)
`${binaryName}.tmp`
)
const werfVersionDir = path.join(cacheDownloadToolDir, CACHE_TOOL_DIR)
const werfVersionBinaryPath = path.join(werfVersionDir, binaryName)
// werf-x.x.x -> werf.tmp
// werf.tmp -> werf-x.x.x/werf
@@ -167,7 +191,7 @@ export class Manager {
await cache.cacheDir(
werfVersionDir,
'werf',
CACHE_TOOL_NAME,
Manager._toolVersionCacheID(binaryUrl)
)

View File

@@ -1,12 +0,0 @@
import * as core from '@actions/core'
import {PrepareEnvironAndRunWerfCommand} from './common'
async function run(): Promise<void> {
try {
await PrepareEnvironAndRunWerfCommand(['publish'])
} catch (error) {
core.setFailed(error.message)
}
}
run()

View File

@@ -1,3 +1,2 @@
export const MAJOR_MINOR_GROUP = '1.1'
export const MAJOR = 1
export const MINOR = 1
export const GROUP = '2'
export const MAJOR = 2