mirror of
https://github.com/werf/actions.git
synced 2026-02-05 10:56:23 +03:00
Compare commits
39 Commits
marketplac
...
v2
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6ad28e741a | ||
|
|
b3b83d531c | ||
|
|
f3a12bd69b | ||
|
|
af48145692 | ||
|
|
4cd91e1efe | ||
|
|
6ada024d50 | ||
|
|
598155cd9d | ||
|
|
41f4b68701 | ||
|
|
43d2310151 | ||
|
|
0980fb9532 | ||
|
|
ed26ed00c3 | ||
|
|
123d59749a | ||
|
|
6a22d9889e | ||
|
|
c3991e000a | ||
|
|
8114de503a | ||
|
|
5db804bda8 | ||
|
|
49d9f0474c | ||
|
|
249bcf41aa | ||
|
|
9ef247eabe | ||
|
|
a8aa170653 | ||
|
|
51f5846897 | ||
|
|
6b2343319a | ||
|
|
04d17c706c | ||
|
|
9039bc0466 | ||
|
|
c8117305fa | ||
|
|
bbed6a352f | ||
|
|
28fbbd1431 | ||
|
|
3f75d958ee | ||
|
|
d70c5589dc | ||
|
|
97dd67885d | ||
|
|
32d35676c4 | ||
|
|
f97e5aaef8 | ||
|
|
5bad6adea1 | ||
|
|
b6cb5eb2b8 | ||
|
|
dc1f37e772 | ||
|
|
61d4c969a9 | ||
|
|
4cbd75c9ef | ||
|
|
66381be661 | ||
|
|
434520bcb6 |
6
.github/workflows/test.yaml
vendored
6
.github/workflows/test.yaml
vendored
@@ -12,7 +12,7 @@ jobs:
|
|||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
@@ -31,13 +31,13 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Install
|
- name: Install
|
||||||
uses: ./install
|
uses: ./install
|
||||||
with:
|
with:
|
||||||
version: v1.2.35
|
version: v2.31.1
|
||||||
|
|
||||||
- run: werf version
|
- run: werf version
|
||||||
335
README.md
335
README.md
@@ -3,127 +3,11 @@
|
|||||||
</p>
|
</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)
|
**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).
|
||||||
- [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)
|
|
||||||
|
|
||||||
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.
|
## How to use
|
||||||
|
|
||||||
**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
|
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
converge:
|
converge:
|
||||||
@@ -132,113 +16,130 @@ converge:
|
|||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Converge
|
- name: Install werf
|
||||||
uses: werf/actions/converge@v1.2
|
uses: werf/actions/install@v2
|
||||||
with:
|
|
||||||
env: production
|
|
||||||
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
|
|
||||||
```
|
|
||||||
|
|
||||||
### dismiss
|
- name: Run script
|
||||||
|
|
||||||
```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
|
|
||||||
run: |
|
run: |
|
||||||
KUBECONFIG=$(mktemp -d)/config
|
. $(werf ci-env github --as-file)
|
||||||
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 converge
|
werf converge
|
||||||
env:
|
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
|
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)
|
Apache License 2.0, see [LICENSE](LICENSE)
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ branding:
|
|||||||
inputs:
|
inputs:
|
||||||
channel:
|
channel:
|
||||||
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
|
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
|
||||||
default: 'alpha'
|
default: 'stable'
|
||||||
required: false
|
required: false
|
||||||
version:
|
version:
|
||||||
description: 'The certain version'
|
description: 'The certain version'
|
||||||
@@ -23,5 +23,5 @@ inputs:
|
|||||||
description: 'Base64 encoded kubeconfig data used for deployment, cleanup and distributed locks'
|
description: 'Base64 encoded kubeconfig data used for deployment, cleanup and distributed locks'
|
||||||
required: false
|
required: false
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node20'
|
||||||
main: 'converge/index.js'
|
main: 'converge/index.js'
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ The action combines all the necessary steps in itself and logic may be divided i
|
|||||||
```yaml
|
```yaml
|
||||||
channel:
|
channel:
|
||||||
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
|
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
|
||||||
default: 'alpha'
|
default: 'stable'
|
||||||
required: false
|
required: false
|
||||||
version:
|
version:
|
||||||
description: 'The certain version'
|
description: 'The certain version'
|
||||||
@@ -33,12 +33,12 @@ build:
|
|||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
uses: werf/actions/build@v1.2
|
uses: werf/actions/build@v2
|
||||||
with:
|
with:
|
||||||
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
|
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ branding:
|
|||||||
inputs:
|
inputs:
|
||||||
channel:
|
channel:
|
||||||
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
|
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
|
||||||
default: 'alpha'
|
default: 'stable'
|
||||||
required: false
|
required: false
|
||||||
version:
|
version:
|
||||||
description: 'The certain version'
|
description: 'The certain version'
|
||||||
@@ -20,5 +20,5 @@ inputs:
|
|||||||
description: 'Base64 encoded kubeconfig data used for deployment, cleanup and distributed locks'
|
description: 'Base64 encoded kubeconfig data used for deployment, cleanup and distributed locks'
|
||||||
required: false
|
required: false
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node20'
|
||||||
main: 'index.js'
|
main: 'index.js'
|
||||||
|
|||||||
21153
build/index.js
21153
build/index.js
File diff suppressed because one or more lines are too long
@@ -10,7 +10,7 @@ The action combines all the necessary steps in itself and logic may be divided i
|
|||||||
```yaml
|
```yaml
|
||||||
channel:
|
channel:
|
||||||
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
|
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
|
||||||
default: 'alpha'
|
default: 'stable'
|
||||||
required: false
|
required: false
|
||||||
version:
|
version:
|
||||||
description: 'The certain version'
|
description: 'The certain version'
|
||||||
@@ -33,13 +33,13 @@ cleanup:
|
|||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Fetch all history for all tags and branches
|
- name: Fetch all history for all tags and branches
|
||||||
run: git fetch --prune --unshallow
|
run: git fetch --prune --unshallow
|
||||||
|
|
||||||
- name: Cleanup
|
- name: Cleanup
|
||||||
uses: werf/actions/cleanup@v1.2
|
uses: werf/actions/cleanup@v2
|
||||||
with:
|
with:
|
||||||
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
|
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
|
||||||
env:
|
env:
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ branding:
|
|||||||
inputs:
|
inputs:
|
||||||
channel:
|
channel:
|
||||||
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
|
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
|
||||||
default: 'alpha'
|
default: 'stable'
|
||||||
required: false
|
required: false
|
||||||
version:
|
version:
|
||||||
description: 'The certain version'
|
description: 'The certain version'
|
||||||
@@ -20,5 +20,5 @@ inputs:
|
|||||||
description: 'Base64 encoded kubeconfig data used for deployment, cleanup and distributed locks'
|
description: 'Base64 encoded kubeconfig data used for deployment, cleanup and distributed locks'
|
||||||
required: false
|
required: false
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node20'
|
||||||
main: 'index.js'
|
main: 'index.js'
|
||||||
|
|||||||
21153
cleanup/index.js
21153
cleanup/index.js
File diff suppressed because one or more lines are too long
@@ -10,7 +10,7 @@ The action combines all the necessary steps in itself and logic may be divided i
|
|||||||
```yaml
|
```yaml
|
||||||
channel:
|
channel:
|
||||||
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
|
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
|
||||||
default: 'alpha'
|
default: 'stable'
|
||||||
required: false
|
required: false
|
||||||
version:
|
version:
|
||||||
description: 'The certain version'
|
description: 'The certain version'
|
||||||
@@ -36,12 +36,12 @@ converge:
|
|||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Converge
|
- name: Converge
|
||||||
uses: werf/actions/converge@v1.2
|
uses: werf/actions/converge@v2
|
||||||
with:
|
with:
|
||||||
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
|
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
|
||||||
env: production
|
env: production
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ branding:
|
|||||||
inputs:
|
inputs:
|
||||||
channel:
|
channel:
|
||||||
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
|
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
|
||||||
default: 'alpha'
|
default: 'stable'
|
||||||
required: false
|
required: false
|
||||||
version:
|
version:
|
||||||
description: 'The certain version'
|
description: 'The certain version'
|
||||||
@@ -23,5 +23,5 @@ inputs:
|
|||||||
description: 'Base64 encoded kubeconfig data used for deployment, cleanup and distributed locks'
|
description: 'Base64 encoded kubeconfig data used for deployment, cleanup and distributed locks'
|
||||||
required: false
|
required: false
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node20'
|
||||||
main: 'index.js'
|
main: 'index.js'
|
||||||
|
|||||||
21153
converge/index.js
21153
converge/index.js
File diff suppressed because one or more lines are too long
@@ -10,7 +10,7 @@ The action combines all the necessary steps in itself and logic may be divided i
|
|||||||
```yaml
|
```yaml
|
||||||
channel:
|
channel:
|
||||||
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
|
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
|
||||||
default: 'alpha'
|
default: 'stable'
|
||||||
required: false
|
required: false
|
||||||
version:
|
version:
|
||||||
description: 'The certain version'
|
description: 'The certain version'
|
||||||
@@ -36,10 +36,10 @@ dismiss:
|
|||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Dismiss
|
- name: Dismiss
|
||||||
uses: werf/actions/dismiss@v1.2
|
uses: werf/actions/dismiss@v2
|
||||||
with:
|
with:
|
||||||
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
|
kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }}
|
||||||
env: production
|
env: production
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ branding:
|
|||||||
inputs:
|
inputs:
|
||||||
channel:
|
channel:
|
||||||
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
|
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
|
||||||
default: 'alpha'
|
default: 'stable'
|
||||||
required: false
|
required: false
|
||||||
version:
|
version:
|
||||||
description: 'The certain version'
|
description: 'The certain version'
|
||||||
@@ -23,5 +23,5 @@ inputs:
|
|||||||
description: 'Base64 encoded kubeconfig data used for deployment, cleanup and distributed locks'
|
description: 'Base64 encoded kubeconfig data used for deployment, cleanup and distributed locks'
|
||||||
required: false
|
required: false
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node20'
|
||||||
main: 'index.js'
|
main: 'index.js'
|
||||||
|
|||||||
21153
dismiss/index.js
21153
dismiss/index.js
File diff suppressed because one or more lines are too long
@@ -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
|
> This is recommended approach to be up-to-date and to use actual werf version without changing configurations
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: werf/actions/install@v1.2
|
- uses: werf/actions/install@v2
|
||||||
with:
|
with:
|
||||||
channel: alpha
|
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.
|
Withal, it is not necessary to work within release channels, and the user might specify certain werf version with `version` input.
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
- uses: werf/actions/install@v1.2
|
- uses: werf/actions/install@v2
|
||||||
with:
|
with:
|
||||||
version: v1.2.9
|
version: v2.1.0
|
||||||
```
|
```
|
||||||
|
|
||||||
## Inputs
|
## Inputs
|
||||||
@@ -27,7 +27,7 @@ Withal, it is not necessary to work within release channels, and the user might
|
|||||||
```yaml
|
```yaml
|
||||||
channel:
|
channel:
|
||||||
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
|
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
|
||||||
default: 'alpha'
|
default: 'stable'
|
||||||
required: false
|
required: false
|
||||||
version:
|
version:
|
||||||
description: 'The certain version'
|
description: 'The certain version'
|
||||||
@@ -43,10 +43,10 @@ werf:
|
|||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Install werf CLI
|
- name: Install werf CLI
|
||||||
uses: werf/actions/install@v1.2
|
uses: werf/actions/install@v2
|
||||||
|
|
||||||
# For deploy and distributed locks.
|
# For deploy and distributed locks.
|
||||||
- name: Create kube config
|
- name: Create kube config
|
||||||
@@ -63,6 +63,6 @@ werf:
|
|||||||
werf render
|
werf render
|
||||||
werf converge
|
werf converge
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
WERF_ENV: production
|
WERF_ENV: production
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ branding:
|
|||||||
inputs:
|
inputs:
|
||||||
channel:
|
channel:
|
||||||
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
|
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
|
||||||
default: 'alpha'
|
default: 'stable'
|
||||||
required: false
|
required: false
|
||||||
version:
|
version:
|
||||||
description: 'The certain version'
|
description: 'The certain version'
|
||||||
@@ -17,5 +17,5 @@ inputs:
|
|||||||
default: '0'
|
default: '0'
|
||||||
required: false
|
required: false
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node20'
|
||||||
main: 'index.js'
|
main: 'index.js'
|
||||||
|
|||||||
21155
install/index.js
21155
install/index.js
File diff suppressed because one or more lines are too long
143
package-lock.json
generated
143
package-lock.json
generated
@@ -9,11 +9,11 @@
|
|||||||
"version": "1.2.1",
|
"version": "1.2.1",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.6.0",
|
"@actions/core": "^1.9.1",
|
||||||
"@actions/github": "^5.0.0",
|
"@actions/github": "^5.0.0",
|
||||||
"@actions/tool-cache": "^1.7.1",
|
"@actions/tool-cache": "^1.7.1",
|
||||||
"dotenv": "10.0.x",
|
"dotenv": "10.0.x",
|
||||||
"semver": "^7.3.5",
|
"semver": "^7.5.2",
|
||||||
"string-argv": "^0.3.1",
|
"string-argv": "^0.3.1",
|
||||||
"superagent": "^6.1.0",
|
"superagent": "^6.1.0",
|
||||||
"tmp": "^0.2.1",
|
"tmp": "^0.2.1",
|
||||||
@@ -30,17 +30,34 @@
|
|||||||
"eslint": "^7.32.0",
|
"eslint": "^7.32.0",
|
||||||
"eslint-plugin-github": "^4.3.2",
|
"eslint-plugin-github": "^4.3.2",
|
||||||
"js-yaml": "^3.13.1",
|
"js-yaml": "^3.13.1",
|
||||||
"node-fetch": ">=3.1.1",
|
"node-fetch": ">=3.2.10",
|
||||||
"prettier": "^1.19.1",
|
"prettier": "^1.19.1",
|
||||||
"typescript": "^3.6.4"
|
"typescript": "^3.6.4"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/@actions/core": {
|
"node_modules/@actions/core": {
|
||||||
"version": "1.6.0",
|
"version": "1.9.1",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.1.tgz",
|
||||||
"integrity": "sha512-NB1UAZomZlCV/LmJqkLhNTqtKfFXJZAUPcfl/zqG7EfsQdeUJtaWO98SGbuQ3pydJ3fHl2CvI/51OKYlCYYcaw==",
|
"integrity": "sha512-5ad+U2YGrmmiw6du20AQW5XuWo7UKN2052FjSV7MX+Wfjf8sCqcsZe62NfgHys4QI4/Y+vQvLKYL8jWtA1ZBTA==",
|
||||||
"dependencies": {
|
"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": {
|
"node_modules/@actions/exec": {
|
||||||
@@ -1004,9 +1021,9 @@
|
|||||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
||||||
},
|
},
|
||||||
"node_modules/cookiejar": {
|
"node_modules/cookiejar": {
|
||||||
"version": "2.1.3",
|
"version": "2.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz",
|
||||||
"integrity": "sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ=="
|
"integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw=="
|
||||||
},
|
},
|
||||||
"node_modules/cross-spawn": {
|
"node_modules/cross-spawn": {
|
||||||
"version": "7.0.3",
|
"version": "7.0.3",
|
||||||
@@ -2417,9 +2434,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node_modules/json5": {
|
"node_modules/json5": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz",
|
||||||
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
|
"integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"minimist": "^1.2.0"
|
"minimist": "^1.2.0"
|
||||||
@@ -2568,9 +2585,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/minimatch": {
|
"node_modules/minimatch": {
|
||||||
"version": "3.0.4",
|
"version": "3.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"brace-expansion": "^1.1.7"
|
"brace-expansion": "^1.1.7"
|
||||||
},
|
},
|
||||||
@@ -2615,13 +2632,13 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/node-fetch": {
|
"node_modules/node-fetch": {
|
||||||
"version": "3.1.1",
|
"version": "3.2.10",
|
||||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.10.tgz",
|
||||||
"integrity": "sha512-SMk+vKgU77PYotRdWzqZGTZeuFKlsJ0hu4KPviQKkfY+N3vn2MIzr0rvpnYpR8MtB3IEuhlEcuOLbGvLRlA+yg==",
|
"integrity": "sha512-MhuzNwdURnZ1Cp4XTazr69K0BTizsBroX7Zx3UgDSVcZYKF/6p0CBe4EUb/hLqmzVhl0UpYfgRljQ4yxE+iCxA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"data-uri-to-buffer": "^4.0.0",
|
"data-uri-to-buffer": "^4.0.0",
|
||||||
"fetch-blob": "^3.1.3",
|
"fetch-blob": "^3.1.4",
|
||||||
"formdata-polyfill": "^4.0.10"
|
"formdata-polyfill": "^4.0.10"
|
||||||
},
|
},
|
||||||
"engines": {
|
"engines": {
|
||||||
@@ -2871,9 +2888,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/qs": {
|
"node_modules/qs": {
|
||||||
"version": "6.10.1",
|
"version": "6.11.0",
|
||||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.10.1.tgz",
|
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
|
||||||
"integrity": "sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg==",
|
"integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"side-channel": "^1.0.4"
|
"side-channel": "^1.0.4"
|
||||||
},
|
},
|
||||||
@@ -3027,9 +3044,9 @@
|
|||||||
]
|
]
|
||||||
},
|
},
|
||||||
"node_modules/semver": {
|
"node_modules/semver": {
|
||||||
"version": "7.3.5",
|
"version": "7.5.2",
|
||||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
|
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.2.tgz",
|
||||||
"integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
|
"integrity": "sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ==",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lru-cache": "^6.0.0"
|
"lru-cache": "^6.0.0"
|
||||||
},
|
},
|
||||||
@@ -3498,9 +3515,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/word-wrap": {
|
"node_modules/word-wrap": {
|
||||||
"version": "1.2.3",
|
"version": "1.2.4",
|
||||||
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz",
|
||||||
"integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
|
"integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=0.10.0"
|
"node": ">=0.10.0"
|
||||||
@@ -3539,11 +3556,27 @@
|
|||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": {
|
"@actions/core": {
|
||||||
"version": "1.6.0",
|
"version": "1.9.1",
|
||||||
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.6.0.tgz",
|
"resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.1.tgz",
|
||||||
"integrity": "sha512-NB1UAZomZlCV/LmJqkLhNTqtKfFXJZAUPcfl/zqG7EfsQdeUJtaWO98SGbuQ3pydJ3fHl2CvI/51OKYlCYYcaw==",
|
"integrity": "sha512-5ad+U2YGrmmiw6du20AQW5XuWo7UKN2052FjSV7MX+Wfjf8sCqcsZe62NfgHys4QI4/Y+vQvLKYL8jWtA1ZBTA==",
|
||||||
"requires": {
|
"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": {
|
"@actions/exec": {
|
||||||
@@ -4256,9 +4289,9 @@
|
|||||||
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
"integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s="
|
||||||
},
|
},
|
||||||
"cookiejar": {
|
"cookiejar": {
|
||||||
"version": "2.1.3",
|
"version": "2.1.4",
|
||||||
"resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.3.tgz",
|
"resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz",
|
||||||
"integrity": "sha512-JxbCBUdrfr6AQjOXrxoTvAMJO4HBTUIlBzslcJPAz+/KT8yk53fXun51u+RenNYvad/+Vc2DIz5o9UxlCDymFQ=="
|
"integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw=="
|
||||||
},
|
},
|
||||||
"cross-spawn": {
|
"cross-spawn": {
|
||||||
"version": "7.0.3",
|
"version": "7.0.3",
|
||||||
@@ -5267,9 +5300,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"json5": {
|
"json5": {
|
||||||
"version": "1.0.1",
|
"version": "1.0.2",
|
||||||
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.1.tgz",
|
"resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz",
|
||||||
"integrity": "sha512-aKS4WQjPenRxiQsC93MNfjx+nbF4PAdYzmd/1JIj8HYzqfbu86beTuNgXDzPknWk0n0uARlyewZo4s++ES36Ow==",
|
"integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"minimist": "^1.2.0"
|
"minimist": "^1.2.0"
|
||||||
@@ -5385,9 +5418,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"minimatch": {
|
"minimatch": {
|
||||||
"version": "3.0.4",
|
"version": "3.1.2",
|
||||||
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz",
|
"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz",
|
||||||
"integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==",
|
"integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"brace-expansion": "^1.1.7"
|
"brace-expansion": "^1.1.7"
|
||||||
}
|
}
|
||||||
@@ -5416,13 +5449,13 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"node-fetch": {
|
"node-fetch": {
|
||||||
"version": "3.1.1",
|
"version": "3.2.10",
|
||||||
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.1.1.tgz",
|
"resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-3.2.10.tgz",
|
||||||
"integrity": "sha512-SMk+vKgU77PYotRdWzqZGTZeuFKlsJ0hu4KPviQKkfY+N3vn2MIzr0rvpnYpR8MtB3IEuhlEcuOLbGvLRlA+yg==",
|
"integrity": "sha512-MhuzNwdURnZ1Cp4XTazr69K0BTizsBroX7Zx3UgDSVcZYKF/6p0CBe4EUb/hLqmzVhl0UpYfgRljQ4yxE+iCxA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"requires": {
|
"requires": {
|
||||||
"data-uri-to-buffer": "^4.0.0",
|
"data-uri-to-buffer": "^4.0.0",
|
||||||
"fetch-blob": "^3.1.3",
|
"fetch-blob": "^3.1.4",
|
||||||
"formdata-polyfill": "^4.0.10"
|
"formdata-polyfill": "^4.0.10"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -5593,9 +5626,9 @@
|
|||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"qs": {
|
"qs": {
|
||||||
"version": "6.10.1",
|
"version": "6.11.0",
|
||||||
"resolved": "https://registry.npmjs.org/qs/-/qs-6.10.1.tgz",
|
"resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz",
|
||||||
"integrity": "sha512-M528Hph6wsSVOBiYUnGf+K/7w0hNshs/duGsNXPUCLH5XAqjEtiPGwNONLV0tBH8NoGb0mvD5JubnUTrujKDTg==",
|
"integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"side-channel": "^1.0.4"
|
"side-channel": "^1.0.4"
|
||||||
}
|
}
|
||||||
@@ -5673,9 +5706,9 @@
|
|||||||
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
|
"integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ=="
|
||||||
},
|
},
|
||||||
"semver": {
|
"semver": {
|
||||||
"version": "7.3.5",
|
"version": "7.5.2",
|
||||||
"resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz",
|
"resolved": "https://registry.npmjs.org/semver/-/semver-7.5.2.tgz",
|
||||||
"integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==",
|
"integrity": "sha512-SoftuTROv/cRjCze/scjGyiDtcUyxw1rgYQSZY7XTmtR5hX+dm76iDbTH8TkLPHCQmlbQVSSbNZCPM2hb0knnQ==",
|
||||||
"requires": {
|
"requires": {
|
||||||
"lru-cache": "^6.0.0"
|
"lru-cache": "^6.0.0"
|
||||||
}
|
}
|
||||||
@@ -6031,9 +6064,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"word-wrap": {
|
"word-wrap": {
|
||||||
"version": "1.2.3",
|
"version": "1.2.4",
|
||||||
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.4.tgz",
|
||||||
"integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==",
|
"integrity": "sha512-2V81OA4ugVo5pRo46hAoD2ivUJx8jXmWXfUkY4KFNw0hEptvN0QfH3K4nHiwzGeKl5rFKedV48QVoqYavy4YpA==",
|
||||||
"dev": true
|
"dev": true
|
||||||
},
|
},
|
||||||
"wrappy": {
|
"wrappy": {
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
"description": "",
|
"description": "",
|
||||||
"main": "lib",
|
"main": "lib",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@actions/core": "^1.6.0",
|
"@actions/core": "^1.9.1",
|
||||||
"@actions/github": "^5.0.0",
|
"@actions/github": "^5.0.0",
|
||||||
"@actions/tool-cache": "^1.7.1",
|
"@actions/tool-cache": "^1.7.1",
|
||||||
"dotenv": "10.0.x",
|
"dotenv": "10.0.x",
|
||||||
"semver": "^7.3.5",
|
"semver": "^7.5.2",
|
||||||
"string-argv": "^0.3.1",
|
"string-argv": "^0.3.1",
|
||||||
"superagent": "^6.1.0",
|
"superagent": "^6.1.0",
|
||||||
"tmp": "^0.2.1",
|
"tmp": "^0.2.1",
|
||||||
@@ -25,7 +25,7 @@
|
|||||||
"eslint": "^7.32.0",
|
"eslint": "^7.32.0",
|
||||||
"eslint-plugin-github": "^4.3.2",
|
"eslint-plugin-github": "^4.3.2",
|
||||||
"js-yaml": "^3.13.1",
|
"js-yaml": "^3.13.1",
|
||||||
"node-fetch": ">=3.1.1",
|
"node-fetch": ">=3.2.10",
|
||||||
"prettier": "^1.19.1",
|
"prettier": "^1.19.1",
|
||||||
"typescript": "^3.6.4"
|
"typescript": "^3.6.4"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ The action combines all the necessary steps in itself and logic may be divided i
|
|||||||
inputs:
|
inputs:
|
||||||
channel:
|
channel:
|
||||||
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
|
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
|
||||||
default: 'alpha'
|
default: 'stable'
|
||||||
required: false
|
required: false
|
||||||
version:
|
version:
|
||||||
description: 'The certain version'
|
description: 'The certain version'
|
||||||
@@ -40,12 +40,12 @@ run:
|
|||||||
steps:
|
steps:
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Run
|
- name: Run
|
||||||
uses: werf/actions/run@v1.2
|
uses: werf/actions/run@v2
|
||||||
with:
|
with:
|
||||||
image: backend
|
image: backend
|
||||||
args: rails server
|
args: rails server
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ branding:
|
|||||||
inputs:
|
inputs:
|
||||||
channel:
|
channel:
|
||||||
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
|
description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid'
|
||||||
default: 'alpha'
|
default: 'stable'
|
||||||
required: false
|
required: false
|
||||||
version:
|
version:
|
||||||
description: 'The certain version'
|
description: 'The certain version'
|
||||||
@@ -26,5 +26,5 @@ inputs:
|
|||||||
description: 'Base64 encoded kubeconfig data used for deployment, cleanup and distributed locks'
|
description: 'Base64 encoded kubeconfig data used for deployment, cleanup and distributed locks'
|
||||||
required: false
|
required: false
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node20'
|
||||||
main: 'index.js'
|
main: 'index.js'
|
||||||
|
|||||||
21159
run/index.js
21159
run/index.js
File diff suppressed because one or more lines are too long
@@ -7,8 +7,6 @@ import {String} from 'typescript-string-operations'
|
|||||||
import {Manager} from './manager'
|
import {Manager} from './manager'
|
||||||
import * as werf from './werf'
|
import * as werf from './werf'
|
||||||
|
|
||||||
const minimalWerfVersion = 'v1.1.17'
|
|
||||||
|
|
||||||
export async function PrepareEnvironAndRunWerfCommand(
|
export async function PrepareEnvironAndRunWerfCommand(
|
||||||
args: string[]
|
args: string[]
|
||||||
): Promise<void> {
|
): Promise<void> {
|
||||||
@@ -47,13 +45,17 @@ export async function SetupKubeConfig(
|
|||||||
export function ProcessGitHubContext(): void {
|
export function ProcessGitHubContext(): void {
|
||||||
if (context.eventName === 'pull_request') {
|
if (context.eventName === 'pull_request') {
|
||||||
if (context.payload.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 baseSha = context.payload.pull_request.base.sha
|
||||||
const headSha = context.payload.pull_request.head.sha
|
const headSha = context.payload.pull_request.head.sha
|
||||||
|
|
||||||
process.env.WERF_VIRTUAL_MERGE = '1'
|
process.env.WERF_VIRTUAL_MERGE = '1'
|
||||||
process.env.WERF_VIRTUAL_MERGE_FROM_COMMIT = headSha
|
process.env.WERF_VIRTUAL_MERGE_FROM_COMMIT = headSha
|
||||||
process.env.WERF_VIRTUAL_MERGE_INTO_COMMIT = baseSha
|
process.env.WERF_VIRTUAL_MERGE_INTO_COMMIT = baseSha
|
||||||
|
|
||||||
core.exportVariable('WERF_VIRTUAL_MERGE', '1')
|
core.exportVariable('WERF_VIRTUAL_MERGE', '1')
|
||||||
core.exportVariable('WERF_VIRTUAL_MERGE_FROM_COMMIT', headSha)
|
core.exportVariable('WERF_VIRTUAL_MERGE_FROM_COMMIT', headSha)
|
||||||
core.exportVariable('WERF_VIRTUAL_MERGE_INTO_COMMIT', baseSha)
|
core.exportVariable('WERF_VIRTUAL_MERGE_INTO_COMMIT', baseSha)
|
||||||
@@ -63,27 +65,15 @@ export function ProcessGitHubContext(): void {
|
|||||||
|
|
||||||
export function ValidateWerfVersion(version: string): void {
|
export function ValidateWerfVersion(version: string): void {
|
||||||
const ver = semver.coerce(version)
|
const ver = semver.coerce(version)
|
||||||
if (ver) {
|
if (ver && ver.major === werf.MAJOR) {
|
||||||
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
|
return
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
throw new Error(
|
throw new Error(
|
||||||
String.Format(
|
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(),
|
version.trim(),
|
||||||
minimalWerfVersion
|
werf.GROUP
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
import * as core from '@actions/core'
|
import * as core from '@actions/core'
|
||||||
import {Manager} from './manager'
|
import {Manager} from './manager'
|
||||||
|
import {ProcessGitHubContext} from './common'
|
||||||
|
|
||||||
async function run(): Promise<void> {
|
async function run(): Promise<void> {
|
||||||
try {
|
try {
|
||||||
|
ProcessGitHubContext()
|
||||||
|
|
||||||
const m = new Manager()
|
const m = new Manager()
|
||||||
await m.Install()
|
await m.Install()
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
|||||||
@@ -83,6 +83,11 @@ export class Manager {
|
|||||||
const tmpFilePath = tmpFile.name
|
const tmpFilePath = tmpFile.name
|
||||||
await this.Exec(['ci-env', 'github', '--as-env-file', '-o', tmpFilePath])
|
await this.Exec(['ci-env', 'github', '--as-env-file', '-o', tmpFilePath])
|
||||||
const res = dotenv.config({path: 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)
|
console.log(res.parsed)
|
||||||
tmpFile.removeCallback()
|
tmpFile.removeCallback()
|
||||||
}
|
}
|
||||||
@@ -120,7 +125,7 @@ export class Manager {
|
|||||||
return this._constructReleaseUrl(version)
|
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 {
|
try {
|
||||||
const resp = await request
|
const resp = await request
|
||||||
.get(url)
|
.get(url)
|
||||||
|
|||||||
@@ -1,3 +1,2 @@
|
|||||||
export const MAJOR_MINOR_GROUP = '1.2'
|
export const GROUP = '2'
|
||||||
export const MAJOR = 1
|
export const MAJOR = 2
|
||||||
export const MINOR = 2
|
|
||||||
|
|||||||
Reference in New Issue
Block a user