39 Commits

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
27 changed files with 69725 additions and 57906 deletions

View File

@@ -12,7 +12,7 @@ jobs:
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
@@ -31,13 +31,13 @@ jobs:
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install
uses: ./install
with:
version: v1.2.35
version: v2.31.1
- run: werf version

335
README.md
View File

@@ -3,127 +3,11 @@
</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/v1.2/converge)
- [werf/actions/dismiss](https://github.com/werf/actions/tree/v1.2/dismiss)
- [werf/actions/build](https://github.com/werf/actions/tree/v1.2/build)
- [werf/actions/run](https://github.com/werf/actions/tree/v1.2/run)
- [werf/actions/cleanup](https://github.com/werf/actions/tree/v1.2/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](#environment-setup-in-details) and launching the corresponding command.
**Ready-to-use GitHub Actions Workflows** for different CI/CD workflows are available [here](https://werf.io/documentation/v1.2/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/v1.2/install). With this action, the user can install werf and use binary within job steps for own purposes.
## Versioning
When using actions, select the version corresponding to the required `MAJOR.MINOR` version of werf:
```yaml
# Run converge using actual werf version within 1.1 alpha channel.
- uses: werf/actions/converge@v1.1
# Run converge using actual werf version within 1.2 alpha channel.
- uses: werf/actions/converge@v1.2
```
## Environment setup in details
### werf binary installation
By default, all actions install actual werf version within 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/converge@v1.2
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.2
with:
version: v1.2.9
```
### werf ci-env
This is the step where an action:
- sets the defaults for werf command options based on [GitHub Workflow environment variables](https://docs.github.com/en/actions/reference/environment-variables) (e.g. container repository address to the `WERF_REPO` environment variable using the following pattern: `ghcr.io/$GITHUB_REPOSITORY/<project-from-werf.yaml>`).
- performs _docker login_ to `ghcr.io` using the `github-token` input (only if `ghcr.io` used as `WERF_REPO`).
> The `github-token` input is optional, and the input is there in case you need to use a non-default token. By default, an action will use [the token provided to your workflow](https://docs.github.com/en/actions/reference/authentication-in-a-workflow#about-the-github_token-secret).
### 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 Secrets](https://docs.github.com/en/actions/reference/encrypted-secrets) (e.g. with name `KUBE_CONFIG_BASE64_DATA`).
* Pass secret with `kube-config-base64-data` input:
```yaml
- uses: werf/actions/converge@v1.2
with:
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
```
## Working with werf options
All werf options can be defined with environment variables:
```yaml
- uses: werf/actions/converge@v1.2
env:
WERF_LOG_VERBOSE: "on" # The same as using the option --log-verbose=on.
```
## Working with container registry
### Default container repository
An action generates the default container repository address and performs _docker login_ to the registry within [werf ci-env step](#werf-ci-env).
For cleanup action, the user needs [to create personal access token](https://docs.github.com/en/github/authenticating-to-github/keeping-your-account-and-data-secure/creating-a-personal-access-token) with `read:packages` and `delete:packages` scope and uses it as the `WERF_REPO_GITHUB_TOKEN` environment variable or the `github-token` input. It is recommended [to store the token as a secret](https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets).
```yaml
- uses: werf/actions/cleanup@v1.2
with:
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
env:
WERF_REPO_GITHUB_TOKEN: ${{ secrets.WERF_CLEANUP_PAM }}
```
### Custom container repository
An arbitrary container repository can be specified with the `WERF_REPO` and `WERF_REPO_CONTAINER_REGISTRY` environment variables. For instance, steps for GCR:
```yaml
- name: Login to GCR
uses: docker/login-action@v1
with:
registry: gcr.io
username: _json_key
password: ${{ secrets.GCR_JSON_KEY }}
- uses: werf/actions/converge@v1.2
env:
WERF_REPO: "gcr.io/company/app"
WERF_REPO_CONTAINER_REGISTRY: "gcr"
```
> To learn more about how to work with the different container registries, see the appropriate [article in the werf documentation](https://werf.io/documentation/v1.2/advanced/supported_container_registries.html).
## Examples
### converge
## How to use
```yaml
converge:
@@ -132,113 +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.2
with:
env: production
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
```
- name: Install werf
uses: werf/actions/install@v2
### dismiss
```yaml
dismiss:
name: Dismiss
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Dismiss
uses: werf/actions/dismiss@v1.2
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.2
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.2
with:
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
env:
WERF_REPO_GITHUB_TOKEN: ${{ secrets.WERF_CLEANUP_PAM }}
```
### 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.2
# For deploy and distributed locks.
- name: Create kube config
- name: Run script
run: |
KUBECONFIG=$(mktemp -d)/config
base64 -d <(printf "%s" $KUBE_CONFIG_BASE64_DATA) > $KUBECONFIG
echo KUBECONFIG=$KUBECONFIG >> $GITHUB_ENV
env:
KUBE_CONFIG_BASE64_DATA: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
- name: Run werf commands
run: |
source $(werf ci-env github --as-file)
werf render
. $(werf ci-env github --as-file)
werf converge
env:
GITHUB_TOKEN: ${{ github.token }}
WERF_KUBECONFIG_BASE64: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
WERF_ENV: production
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
```
## 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
```
# License
> 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

@@ -10,7 +10,7 @@ The action combines all the necessary steps in itself and logic may be divided i
```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'
@@ -33,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.2
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

@@ -10,7 +10,7 @@ The action combines all the necessary steps in itself and logic may be divided i
```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'
@@ -33,13 +33,13 @@ 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.2
uses: werf/actions/cleanup@v2
with:
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
env:

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

@@ -10,7 +10,7 @@ The action combines all the necessary steps in itself and logic may be divided i
```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'
@@ -36,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.2
uses: werf/actions/converge@v2
with:
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
env: production

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: 'index.js'

File diff suppressed because one or more lines are too long

View File

@@ -10,7 +10,7 @@ The action combines all the necessary steps in itself and logic may be divided i
```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'
@@ -36,10 +36,10 @@ dismiss:
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Dismiss
uses: werf/actions/dismiss@v1.2
uses: werf/actions/dismiss@v2
with:
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
env: production

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: 'index.js'

File diff suppressed because one or more lines are too long

View File

@@ -9,7 +9,7 @@ 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.2
- 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.2
- uses: werf/actions/install@v2
with:
version: v1.2.9
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,10 +43,10 @@ werf:
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
- name: Install werf CLI
uses: werf/actions/install@v1.2
uses: werf/actions/install@v2
# For deploy and distributed locks.
- name: Create kube config
@@ -63,6 +63,6 @@ werf:
werf render
werf converge
env:
GITHUB_TOKEN: ${{ github.token }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
WERF_ENV: production
```

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'
@@ -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

143
package-lock.json generated
View File

@@ -9,11 +9,11 @@
"version": "1.2.1",
"license": "Apache-2.0",
"dependencies": {
"@actions/core": "^1.6.0",
"@actions/core": "^1.9.1",
"@actions/github": "^5.0.0",
"@actions/tool-cache": "^1.7.1",
"dotenv": "10.0.x",
"semver": "^7.3.5",
"semver": "^7.5.2",
"string-argv": "^0.3.1",
"superagent": "^6.1.0",
"tmp": "^0.2.1",
@@ -30,17 +30,34 @@
"eslint": "^7.32.0",
"eslint-plugin-github": "^4.3.2",
"js-yaml": "^3.13.1",
"node-fetch": ">=3.1.1",
"node-fetch": ">=3.2.10",
"prettier": "^1.19.1",
"typescript": "^3.6.4"
}
},
"node_modules/@actions/core": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.6.0.tgz",
"integrity": "sha512-NB1UAZomZlCV/LmJqkLhNTqtKfFXJZAUPcfl/zqG7EfsQdeUJtaWO98SGbuQ3pydJ3fHl2CvI/51OKYlCYYcaw==",
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.1.tgz",
"integrity": "sha512-5ad+U2YGrmmiw6du20AQW5XuWo7UKN2052FjSV7MX+Wfjf8sCqcsZe62NfgHys4QI4/Y+vQvLKYL8jWtA1ZBTA==",
"dependencies": {
"@actions/http-client": "^1.0.11"
"@actions/http-client": "^2.0.1",
"uuid": "^8.3.2"
}
},
"node_modules/@actions/core/node_modules/@actions/http-client": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
"integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
"dependencies": {
"tunnel": "^0.0.6"
}
},
"node_modules/@actions/core/node_modules/uuid": {
"version": "8.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==",
"bin": {
"uuid": "dist/bin/uuid"
}
},
"node_modules/@actions/exec": {
@@ -1004,9 +1021,9 @@
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
},
"node_modules/cookiejar": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.3.tgz",
"integrity": "sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ=="
"version": "2.1.4",
"resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz",
"integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw=="
},
"node_modules/cross-spawn": {
"version": "7.0.3",
@@ -2417,9 +2434,9 @@
"dev": true
},
"node_modules/json5": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz",
"integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
"dev": true,
"dependencies": {
"minimist": "^1.2.0"
@@ -2568,9 +2585,9 @@
}
},
"node_modules/minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
"dependencies": {
"brace-expansion": "^1.1.7"
},
@@ -2615,13 +2632,13 @@
}
},
"node_modules/node-fetch": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.1.1.tgz",
"integrity": "sha512-SMk+vKgU77PYotRdWzqZGTZeuFKlsJ0hu4KPviQKkfY+N3vn2MIzr0rvpnYpR8MtB3IEuhlEcuOLbGvLRlA+yg==",
"version": "3.2.10",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.10.tgz",
"integrity": "sha512-MhuzNwdURnZ1Cp4XTazr69K0BTizsBroX7Zx3UgDSVcZYKF/6p0CBe4EUb/hLqmzVhl0UpYfgRljQ4yxE+iCxA==",
"dev": true,
"dependencies": {
"data-uri-to-buffer": "^4.0.0",
"fetch-blob": "^3.1.3",
"fetch-blob": "^3.1.4",
"formdata-polyfill": "^4.0.10"
},
"engines": {
@@ -2871,9 +2888,9 @@
}
},
"node_modules/qs": {
"version": "6.10.1",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.10.1.tgz",
"integrity": "sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg==",
"version": "6.11.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
"integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
"dependencies": {
"side-channel": "^1.0.4"
},
@@ -3027,9 +3044,9 @@
]
},
"node_modules/semver": {
"version": "7.3.5",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
"integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
"version": "7.5.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.2.tgz",
"integrity": "sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ==",
"dependencies": {
"lru-cache": "^6.0.0"
},
@@ -3498,9 +3515,9 @@
}
},
"node_modules/word-wrap": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
"integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz",
"integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==",
"dev": true,
"engines": {
"node": ">=0.10.0"
@@ -3539,11 +3556,27 @@
},
"dependencies": {
"@actions/core": {
"version": "1.6.0",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.6.0.tgz",
"integrity": "sha512-NB1UAZomZlCV/LmJqkLhNTqtKfFXJZAUPcfl/zqG7EfsQdeUJtaWO98SGbuQ3pydJ3fHl2CvI/51OKYlCYYcaw==",
"version": "1.9.1",
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.1.tgz",
"integrity": "sha512-5ad+U2YGrmmiw6du20AQW5XuWo7UKN2052FjSV7MX+Wfjf8sCqcsZe62NfgHys4QI4/Y+vQvLKYL8jWtA1ZBTA==",
"requires": {
"@actions/http-client": "^1.0.11"
"@actions/http-client": "^2.0.1",
"uuid": "^8.3.2"
},
"dependencies": {
"@actions/http-client": {
"version": "2.0.1",
"resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz",
"integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==",
"requires": {
"tunnel": "^0.0.6"
}
},
"uuid": {
"version": "8.3.2",
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz",
"integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg=="
}
}
},
"@actions/exec": {
@@ -4256,9 +4289,9 @@
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
},
"cookiejar": {
"version": "2.1.3",
"resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.3.tgz",
"integrity": "sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ=="
"version": "2.1.4",
"resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz",
"integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw=="
},
"cross-spawn": {
"version": "7.0.3",
@@ -5267,9 +5300,9 @@
"dev": true
},
"json5": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz",
"integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
"dev": true,
"requires": {
"minimist": "^1.2.0"
@@ -5385,9 +5418,9 @@
}
},
"minimatch": {
"version": "3.0.4",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
"version": "3.1.2",
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
"requires": {
"brace-expansion": "^1.1.7"
}
@@ -5416,13 +5449,13 @@
"dev": true
},
"node-fetch": {
"version": "3.1.1",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.1.1.tgz",
"integrity": "sha512-SMk+vKgU77PYotRdWzqZGTZeuFKlsJ0hu4KPviQKkfY+N3vn2MIzr0rvpnYpR8MtB3IEuhlEcuOLbGvLRlA+yg==",
"version": "3.2.10",
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.10.tgz",
"integrity": "sha512-MhuzNwdURnZ1Cp4XTazr69K0BTizsBroX7Zx3UgDSVcZYKF/6p0CBe4EUb/hLqmzVhl0UpYfgRljQ4yxE+iCxA==",
"dev": true,
"requires": {
"data-uri-to-buffer": "^4.0.0",
"fetch-blob": "^3.1.3",
"fetch-blob": "^3.1.4",
"formdata-polyfill": "^4.0.10"
}
},
@@ -5593,9 +5626,9 @@
"dev": true
},
"qs": {
"version": "6.10.1",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.10.1.tgz",
"integrity": "sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg==",
"version": "6.11.0",
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
"integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
"requires": {
"side-channel": "^1.0.4"
}
@@ -5673,9 +5706,9 @@
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
},
"semver": {
"version": "7.3.5",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
"integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
"version": "7.5.2",
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.2.tgz",
"integrity": "sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ==",
"requires": {
"lru-cache": "^6.0.0"
}
@@ -6031,9 +6064,9 @@
}
},
"word-wrap": {
"version": "1.2.3",
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
"integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
"version": "1.2.4",
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz",
"integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==",
"dev": true
},
"wrappy": {

View File

@@ -4,11 +4,11 @@
"description": "",
"main": "lib",
"dependencies": {
"@actions/core": "^1.6.0",
"@actions/core": "^1.9.1",
"@actions/github": "^5.0.0",
"@actions/tool-cache": "^1.7.1",
"dotenv": "10.0.x",
"semver": "^7.3.5",
"semver": "^7.5.2",
"string-argv": "^0.3.1",
"superagent": "^6.1.0",
"tmp": "^0.2.1",
@@ -25,7 +25,7 @@
"eslint": "^7.32.0",
"eslint-plugin-github": "^4.3.2",
"js-yaml": "^3.13.1",
"node-fetch": ">=3.1.1",
"node-fetch": ">=3.2.10",
"prettier": "^1.19.1",
"typescript": "^3.6.4"
},

View File

@@ -11,7 +11,7 @@ The action combines all the necessary steps in itself and logic may be divided i
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'
@@ -40,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.2
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'

21163
run/index.js

File diff suppressed because one or more lines are too long

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)) {
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,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

@@ -83,6 +83,11 @@ export class Manager {
const tmpFilePath = tmpFile.name
await this.Exec(['ci-env', 'github', '--as-env-file', '-o', tmpFilePath])
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()
}
@@ -120,7 +125,7 @@ export class Manager {
return this._constructReleaseUrl(version)
}
const url = `${WERF_TUF_SERVER_URL}/targets/channels/${werf.MAJOR_MINOR_GROUP}/${this.channel}`
const url = `${WERF_TUF_SERVER_URL}/targets/channels/${werf.GROUP}/${this.channel}`
try {
const resp = await request
.get(url)

View File

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