From 4dc23b175fe87da9b5c06836f23a5d119763b003 Mon Sep 17 00:00:00 2001 From: Alexey Igrychev Date: Wed, 10 Mar 2021 11:38:00 +0000 Subject: [PATCH 1/3] Embed the MAJOR.MINOR version and remove the group input --- README.md | 27 +++++++++++++-------------- action.yml | 4 ---- build-and-publish/README.md | 17 ++++++----------- build-and-publish/action.yml | 4 ---- build-and-publish/index.js | 4 ++-- build/README.md | 17 ++++++----------- build/action.yml | 4 ---- build/index.js | 4 ++-- cleanup/README.md | 17 ++++++----------- cleanup/action.yml | 4 ---- cleanup/index.js | 4 ++-- converge/README.md | 17 ++++++----------- converge/action.yml | 4 ---- converge/index.js | 4 ++-- deploy/README.md | 17 ++++++----------- deploy/action.yml | 4 ---- deploy/index.js | 4 ++-- dismiss/README.md | 17 ++++++----------- dismiss/action.yml | 4 ---- dismiss/index.js | 4 ++-- install/README.md | 15 +++++---------- install/action.yml | 4 ---- install/index.js | 4 ++-- package.json | 2 +- publish/README.md | 17 ++++++----------- publish/action.yml | 4 ---- publish/index.js | 4 ++-- run/README.md | 17 ++++++----------- run/action.yml | 4 ---- run/index.js | 4 ++-- src/manager.ts | 5 ++--- 31 files changed, 87 insertions(+), 174 deletions(-) diff --git a/README.md b/README.md index 94051e4..acd0be9 100644 --- a/README.md +++ b/README.md @@ -25,21 +25,20 @@ Each action combines all the necessary steps in itself and logic may be divided ### werf binary setup By default, all actions setup actual werf version for [1.1 alpha channel](https://werf.io/releases.html) (more details about channels, werf release cycle and compatibility promise [here](https://github.com/werf/werf#backward-compatibility-promise)). -Using `group` and `channel` inputs the user can switch the release channel. +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@master +- uses: werf/actions/converge@v1.1 with: - group: 1.1 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@master +- uses: werf/actions/converge@v1.1 with: version: v1.1.16 ``` @@ -53,7 +52,7 @@ The _kubeconfig_ may be used for deployment, cleanup, distributed locks and cach * Pass secret with `kube-config-base64-data` input: ```yaml - - uses: werf/actions/build-and-publish@master + - uses: werf/actions/build-and-publish@v1.1 with: kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }} ``` @@ -71,7 +70,7 @@ By default, action will use the token provided to your workflow. Any werf option can be defined with environment variables: ```yaml -- uses: werf/actions/build-and-publish@master +- uses: werf/actions/build-and-publish@v1.1 env: WERF_LOG_VERBOSE: "on" WERF_TAG_CUSTOM_TAG1: tag1 @@ -94,7 +93,7 @@ converge: fetch-depth: 0 - name: Converge - uses: werf/actions/converge@master + uses: werf/actions/converge@v1.1 with: env: production kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }} @@ -114,7 +113,7 @@ build-and-publish: fetch-depth: 0 - name: Build and Publish - uses: werf/actions/build-and-publish@master + uses: werf/actions/build-and-publish@v1.1 with: kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }} @@ -130,7 +129,7 @@ deploy: fetch-depth: 0 - name: Deploy - uses: werf/actions/deploy@master + uses: werf/actions/deploy@v1.1 with: env: production kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }} @@ -148,7 +147,7 @@ dismiss: uses: actions/checkout@v2 - name: Dismiss - uses: werf/actions/dismiss@master + uses: werf/actions/dismiss@v1.1 with: kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }} env: production @@ -168,7 +167,7 @@ run: fetch-depth: 0 - name: Run - uses: werf/actions/run@master + uses: werf/actions/run@v1.1 with: image: backend args: rails server @@ -192,7 +191,7 @@ cleanup: run: git fetch --prune --unshallow - name: Cleanup - uses: werf/actions/cleanup@master + uses: werf/actions/cleanup@v1.1 with: kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }} ``` @@ -206,10 +205,10 @@ werf: steps: - name: Checkout code - uses: actions/checkout@master + uses: actions/checkout@v1.1 - name: Install werf CLI - uses: werf/actions/install@master + uses: werf/actions/install@v1.1 # for deploy and distributed locks - name: Create kube config diff --git a/action.yml b/action.yml index bc119ad..4c9c0f0 100644 --- a/action.yml +++ b/action.yml @@ -5,10 +5,6 @@ branding: color: blue icon: anchor inputs: - group: - description: 'The MAJOR.MINOR version' - default: '1.1' - required: false channel: description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid' default: 'alpha' diff --git a/build-and-publish/README.md b/build-and-publish/README.md index 2701515..ffc0fa3 100644 --- a/build-and-publish/README.md +++ b/build-and-publish/README.md @@ -10,21 +10,20 @@ The action combines all the necessary steps in itself and logic may be divided i ### werf binary setup By default, all actions setup actual werf version for [1.1 alpha channel](https://werf.io/releases.html) (more details about channels, werf release cycle and compatibility promise [here](https://github.com/werf/werf#backward-compatibility-promise)). -Using `group` and `channel` inputs the user can switch the release channel. +Using the `channel` input the user can switch the release channel. > This is recommended approach to be up-to-date and to use actual werf version without changing configurations ```yaml -- uses: werf/actions/build-and-publish@master +- uses: werf/actions/build-and-publish@v1.1 with: - group: 1.1 channel: alpha ``` Withal, it is not necessary to work within release channels, and the user might specify certain werf version with `version` input. ```yaml -- uses: werf/actions/build-and-publish@master +- uses: werf/actions/build-and-publish@v1.1 with: version: v1.1.16 ``` @@ -38,7 +37,7 @@ The _kubeconfig_ may be used for deployment, cleanup, distributed locks and cach * Pass secret with `kube-config-base64-data` input: ```yaml - - uses: werf/actions/build-and-publish@master + - uses: werf/actions/build-and-publish@v1.1 with: kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }} ``` @@ -56,7 +55,7 @@ By default, action will use the token provided to your workflow. Any werf option can be defined with environment variables: ```yaml -- uses: werf/actions/build-and-publish@master +- uses: werf/actions/build-and-publish@v1.1 env: WERF_LOG_VERBOSE: "on" WERF_TAG_CUSTOM_TAG1: tag1 @@ -66,10 +65,6 @@ Any werf option can be defined with environment variables: ## Inputs ```yaml -group: - description: 'The MAJOR.MINOR version' - default: '1.1' - required: false channel: description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid' default: 'alpha' @@ -100,7 +95,7 @@ build-and-publish: fetch-depth: 0 - name: Build and Publish - uses: werf/actions/build-and-publish@master + uses: werf/actions/build-and-publish@v1.1 with: kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }} ``` diff --git a/build-and-publish/action.yml b/build-and-publish/action.yml index 777bbf5..608a16c 100644 --- a/build-and-publish/action.yml +++ b/build-and-publish/action.yml @@ -5,10 +5,6 @@ branding: color: blue icon: anchor inputs: - group: - description: 'The MAJOR.MINOR version' - default: '1.1' - required: false channel: description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid' default: 'alpha' diff --git a/build-and-publish/index.js b/build-and-publish/index.js index 4ab11f2..45d7d05 100644 --- a/build-and-publish/index.js +++ b/build-and-publish/index.js @@ -43793,9 +43793,9 @@ const tmp = __importStar(__webpack_require__(801)); const dotenv = __importStar(__webpack_require__(972)); const WERF_API_GET_CHANNEL_VERSION_URL_METHOD = 'https://werf.io/api/getChannelVersionURL'; const WERF_API_GET_VERSION_URL_METHOD = 'https://werf.io/api/getVersionURL'; +const MAJOR_MINOR_GROUP = '1.1'; class Manager { constructor() { - this.group = core.getInput('group').trim(); this.channel = core.getInput('channel').trim(); this.version = core.getInput('version').trim(); if (process.platform.toString() === 'win32') { @@ -43877,7 +43877,7 @@ class Manager { else { url = WERF_API_GET_CHANNEL_VERSION_URL_METHOD; query = { - group: this.group, + group: MAJOR_MINOR_GROUP, channel: this.channel, os: this.os, arch: this.arch diff --git a/build/README.md b/build/README.md index add5b10..06eb6e0 100644 --- a/build/README.md +++ b/build/README.md @@ -10,21 +10,20 @@ The action combines all the necessary steps in itself and logic may be divided i ### werf binary setup By default, all actions setup actual werf version for [1.1 alpha channel](https://werf.io/releases.html) (more details about channels, werf release cycle and compatibility promise [here](https://github.com/werf/werf#backward-compatibility-promise)). -Using `group` and `channel` inputs the user can switch the release channel. +Using the `channel` input the user can switch the release channel. > This is recommended approach to be up-to-date and to use actual werf version without changing configurations ```yaml -- uses: werf/actions/build@master +- uses: werf/actions/build@v1.1 with: - group: 1.1 channel: alpha ``` Withal, it is not necessary to work within release channels, and the user might specify certain werf version with `version` input. ```yaml -- uses: werf/actions/build@master +- uses: werf/actions/build@v1.1 with: version: v1.1.16 ``` @@ -38,7 +37,7 @@ The _kubeconfig_ may be used for deployment, cleanup, distributed locks and cach * Pass secret with `kube-config-base64-data` input: ```yaml - - uses: werf/actions/build@master + - uses: werf/actions/build@v1.1 with: kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }} ``` @@ -56,7 +55,7 @@ By default, action will use the token provided to your workflow. Any werf option can be defined with environment variables: ```yaml -- uses: werf/actions/build@master +- uses: werf/actions/build@v1.1 env: WERF_LOG_VERBOSE: "on" WERF_TAG_CUSTOM_TAG1: tag1 @@ -66,10 +65,6 @@ Any werf option can be defined with environment variables: ## Inputs ```yaml -group: - description: 'The MAJOR.MINOR version' - default: '1.1' - required: false channel: description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid' default: 'alpha' @@ -100,7 +95,7 @@ build: fetch-depth: 0 - name: Build - uses: werf/actions/build@master + uses: werf/actions/build@v1.1 with: kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }} ``` diff --git a/build/action.yml b/build/action.yml index 4151bf7..af49bee 100644 --- a/build/action.yml +++ b/build/action.yml @@ -5,10 +5,6 @@ branding: color: blue icon: anchor inputs: - group: - description: 'The MAJOR.MINOR version' - default: '1.1' - required: false channel: description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid' default: 'alpha' diff --git a/build/index.js b/build/index.js index cbe0f02..e74962a 100644 --- a/build/index.js +++ b/build/index.js @@ -43793,9 +43793,9 @@ const tmp = __importStar(__webpack_require__(801)); const dotenv = __importStar(__webpack_require__(972)); const WERF_API_GET_CHANNEL_VERSION_URL_METHOD = 'https://werf.io/api/getChannelVersionURL'; const WERF_API_GET_VERSION_URL_METHOD = 'https://werf.io/api/getVersionURL'; +const MAJOR_MINOR_GROUP = '1.1'; class Manager { constructor() { - this.group = core.getInput('group').trim(); this.channel = core.getInput('channel').trim(); this.version = core.getInput('version').trim(); if (process.platform.toString() === 'win32') { @@ -43877,7 +43877,7 @@ class Manager { else { url = WERF_API_GET_CHANNEL_VERSION_URL_METHOD; query = { - group: this.group, + group: MAJOR_MINOR_GROUP, channel: this.channel, os: this.os, arch: this.arch diff --git a/cleanup/README.md b/cleanup/README.md index fcb1483..6645db9 100644 --- a/cleanup/README.md +++ b/cleanup/README.md @@ -10,21 +10,20 @@ The action combines all the necessary steps in itself and logic may be divided i ### werf binary setup By default, all actions setup actual werf version for [1.1 alpha channel](https://werf.io/releases.html) (more details about channels, werf release cycle and compatibility promise [here](https://github.com/werf/werf#backward-compatibility-promise)). -Using `group` and `channel` inputs the user can switch the release channel. +Using the `channel` input the user can switch the release channel. > This is recommended approach to be up-to-date and to use actual werf version without changing configurations ```yaml -- uses: werf/actions/cleanup@master +- uses: werf/actions/cleanup@v1.1 with: - group: 1.1 channel: alpha ``` Withal, it is not necessary to work within release channels, and the user might specify certain werf version with `version` input. ```yaml -- uses: werf/actions/cleanup@master +- uses: werf/actions/cleanup@v1.1 with: version: v1.1.16 ``` @@ -38,7 +37,7 @@ The _kubeconfig_ may be used for deployment, cleanup, distributed locks and cach * Pass secret with `kube-config-base64-data` input: ```yaml - - uses: werf/actions/cleanup@master + - uses: werf/actions/cleanup@v1.1 with: kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }} ``` @@ -56,7 +55,7 @@ By default, action will use the token provided to your workflow. Any werf option can be defined with environment variables: ```yaml -- uses: werf/actions/cleanup@master +- uses: werf/actions/cleanup@v1.1 env: WERF_LOG_VERBOSE: "on" ``` @@ -64,10 +63,6 @@ Any werf option can be defined with environment variables: ## Inputs ```yaml -group: - description: 'The MAJOR.MINOR version' - default: '1.1' - required: false channel: description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid' default: 'alpha' @@ -99,7 +94,7 @@ cleanup: run: git fetch --prune --unshallow - name: Cleanup - uses: werf/actions/cleanup@master + uses: werf/actions/cleanup@v1.1 with: kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }} ``` diff --git a/cleanup/action.yml b/cleanup/action.yml index df5e742..0d7b54a 100644 --- a/cleanup/action.yml +++ b/cleanup/action.yml @@ -5,10 +5,6 @@ branding: color: blue icon: anchor inputs: - group: - description: 'The MAJOR.MINOR version' - default: '1.1' - required: false channel: description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid' default: 'alpha' diff --git a/cleanup/index.js b/cleanup/index.js index 0ea4a7e..36ebdbf 100644 --- a/cleanup/index.js +++ b/cleanup/index.js @@ -43793,9 +43793,9 @@ const tmp = __importStar(__webpack_require__(801)); const dotenv = __importStar(__webpack_require__(972)); const WERF_API_GET_CHANNEL_VERSION_URL_METHOD = 'https://werf.io/api/getChannelVersionURL'; const WERF_API_GET_VERSION_URL_METHOD = 'https://werf.io/api/getVersionURL'; +const MAJOR_MINOR_GROUP = '1.1'; class Manager { constructor() { - this.group = core.getInput('group').trim(); this.channel = core.getInput('channel').trim(); this.version = core.getInput('version').trim(); if (process.platform.toString() === 'win32') { @@ -43877,7 +43877,7 @@ class Manager { else { url = WERF_API_GET_CHANNEL_VERSION_URL_METHOD; query = { - group: this.group, + group: MAJOR_MINOR_GROUP, channel: this.channel, os: this.os, arch: this.arch diff --git a/converge/README.md b/converge/README.md index 8575794..75cab44 100644 --- a/converge/README.md +++ b/converge/README.md @@ -10,21 +10,20 @@ The action combines all the necessary steps in itself and logic may be divided i ### werf binary setup By default, all actions setup actual werf version for [1.1 alpha channel](https://werf.io/releases.html) (more details about channels, werf release cycle and compatibility promise [here](https://github.com/werf/werf#backward-compatibility-promise)). -Using `group` and `channel` inputs the user can switch the release channel. +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@master +- uses: werf/actions/converge@v1.1 with: - group: 1.1 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@master +- uses: werf/actions/converge@v1.1 with: version: v1.1.16 ``` @@ -38,7 +37,7 @@ The _kubeconfig_ may be used for deployment, cleanup, distributed locks and cach * Pass secret with `kube-config-base64-data` input: ```yaml - - uses: werf/actions/converge@master + - uses: werf/actions/converge@v1.1 with: kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }} ``` @@ -56,7 +55,7 @@ By default, action will use the token provided to your workflow. Any werf option can be defined with environment variables: ```yaml -- uses: werf/actions/converge@master +- uses: werf/actions/converge@v1.1 with: env: production env: @@ -66,10 +65,6 @@ Any werf option can be defined with environment variables: ## Inputs ```yaml -group: - description: 'The MAJOR.MINOR version' - default: '1.1' - required: false channel: description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid' default: 'alpha' @@ -103,7 +98,7 @@ converge: fetch-depth: 0 - name: Converge - uses: werf/actions/converge@master + uses: werf/actions/converge@v1.1 with: kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }} env: production diff --git a/converge/action.yml b/converge/action.yml index 3da5d40..e0aab29 100644 --- a/converge/action.yml +++ b/converge/action.yml @@ -5,10 +5,6 @@ branding: color: blue icon: anchor inputs: - group: - description: 'The MAJOR.MINOR version' - default: '1.1' - required: false channel: description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid' default: 'alpha' diff --git a/converge/index.js b/converge/index.js index 48b2fdf..6b700a1 100644 --- a/converge/index.js +++ b/converge/index.js @@ -43794,9 +43794,9 @@ const tmp = __importStar(__webpack_require__(801)); const dotenv = __importStar(__webpack_require__(972)); const WERF_API_GET_CHANNEL_VERSION_URL_METHOD = 'https://werf.io/api/getChannelVersionURL'; const WERF_API_GET_VERSION_URL_METHOD = 'https://werf.io/api/getVersionURL'; +const MAJOR_MINOR_GROUP = '1.1'; class Manager { constructor() { - this.group = core.getInput('group').trim(); this.channel = core.getInput('channel').trim(); this.version = core.getInput('version').trim(); if (process.platform.toString() === 'win32') { @@ -43878,7 +43878,7 @@ class Manager { else { url = WERF_API_GET_CHANNEL_VERSION_URL_METHOD; query = { - group: this.group, + group: MAJOR_MINOR_GROUP, channel: this.channel, os: this.os, arch: this.arch diff --git a/deploy/README.md b/deploy/README.md index 3847bd1..6406305 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -10,21 +10,20 @@ The action combines all the necessary steps in itself and logic may be divided i ### werf binary setup By default, all actions setup actual werf version for [1.1 alpha channel](https://werf.io/releases.html) (more details about channels, werf release cycle and compatibility promise [here](https://github.com/werf/werf#backward-compatibility-promise)). -Using `group` and `channel` inputs the user can switch the release channel. +Using the `channel` input the user can switch the release channel. > This is recommended approach to be up-to-date and to use actual werf version without changing configurations ```yaml -- uses: werf/actions/deploy@master +- uses: werf/actions/deploy@v1.1 with: - group: 1.1 channel: alpha ``` Withal, it is not necessary to work within release channels, and the user might specify certain werf version with `version` input. ```yaml -- uses: werf/actions/deploy@master +- uses: werf/actions/deploy@v1.1 with: version: v1.1.16 ``` @@ -38,7 +37,7 @@ The _kubeconfig_ may be used for deployment, cleanup, distributed locks and cach * Pass secret with `kube-config-base64-data` input: ```yaml - - uses: werf/actions/deploy@master + - uses: werf/actions/deploy@v1.1 with: kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }} ``` @@ -56,7 +55,7 @@ By default, action will use the token provided to your workflow. Any werf option can be defined with environment variables: ```yaml -- uses: werf/actions/deploy@master +- uses: werf/actions/deploy@v1.1 with: env: production env: @@ -66,10 +65,6 @@ Any werf option can be defined with environment variables: ## Inputs ```yaml -group: - description: 'The MAJOR.MINOR version' - default: '1.1' - required: false channel: description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid' default: 'alpha' @@ -103,7 +98,7 @@ deploy: fetch-depth: 0 - name: Deploy - uses: werf/actions/deploy@master + uses: werf/actions/deploy@v1.1 with: kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }} env: production diff --git a/deploy/action.yml b/deploy/action.yml index c93f098..c2afe43 100644 --- a/deploy/action.yml +++ b/deploy/action.yml @@ -5,10 +5,6 @@ branding: color: blue icon: anchor inputs: - group: - description: 'The MAJOR.MINOR version' - default: '1.1' - required: false channel: description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid' default: 'alpha' diff --git a/deploy/index.js b/deploy/index.js index 70a16d2..ffc3360 100644 --- a/deploy/index.js +++ b/deploy/index.js @@ -43758,9 +43758,9 @@ const tmp = __importStar(__webpack_require__(801)); const dotenv = __importStar(__webpack_require__(972)); const WERF_API_GET_CHANNEL_VERSION_URL_METHOD = 'https://werf.io/api/getChannelVersionURL'; const WERF_API_GET_VERSION_URL_METHOD = 'https://werf.io/api/getVersionURL'; +const MAJOR_MINOR_GROUP = '1.1'; class Manager { constructor() { - this.group = core.getInput('group').trim(); this.channel = core.getInput('channel').trim(); this.version = core.getInput('version').trim(); if (process.platform.toString() === 'win32') { @@ -43842,7 +43842,7 @@ class Manager { else { url = WERF_API_GET_CHANNEL_VERSION_URL_METHOD; query = { - group: this.group, + group: MAJOR_MINOR_GROUP, channel: this.channel, os: this.os, arch: this.arch diff --git a/dismiss/README.md b/dismiss/README.md index 944b852..11f5af2 100644 --- a/dismiss/README.md +++ b/dismiss/README.md @@ -10,21 +10,20 @@ The action combines all the necessary steps in itself and logic may be divided i ### werf binary setup By default, all actions setup actual werf version for [1.1 alpha channel](https://werf.io/releases.html) (more details about channels, werf release cycle and compatibility promise [here](https://github.com/werf/werf#backward-compatibility-promise)). -Using `group` and `channel` inputs the user can switch the release channel. +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@master +- uses: werf/actions/converge@v1.1 with: - group: 1.1 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@master +- uses: werf/actions/converge@v1.1 with: version: v1.1.16 ``` @@ -38,7 +37,7 @@ The _kubeconfig_ may be used for deployment, cleanup, distributed locks and cach * Pass secret with `kube-config-base64-data` input: ```yaml - - uses: werf/actions/converge@master + - uses: werf/actions/converge@v1.1 with: kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }} ``` @@ -56,7 +55,7 @@ By default, action will use the token provided to your workflow. Any werf option can be defined with environment variables: ```yaml -- uses: werf/actions/converge@master +- uses: werf/actions/converge@v1.1 with: env: production env: @@ -66,10 +65,6 @@ Any werf option can be defined with environment variables: ## Inputs ```yaml -group: - description: 'The MAJOR.MINOR version' - default: '1.1' - required: false channel: description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid' default: 'alpha' @@ -101,7 +96,7 @@ dismiss: uses: actions/checkout@v2 - name: Dismiss - uses: werf/actions/dismiss@master + uses: werf/actions/dismiss@v1.1 with: kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }} env: production diff --git a/dismiss/action.yml b/dismiss/action.yml index 4fd3ff5..195f83f 100644 --- a/dismiss/action.yml +++ b/dismiss/action.yml @@ -5,10 +5,6 @@ branding: color: blue icon: anchor inputs: - group: - description: 'The MAJOR.MINOR version' - default: '1.1' - required: false channel: description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid' default: 'alpha' diff --git a/dismiss/index.js b/dismiss/index.js index b60f68e..2e7dd61 100644 --- a/dismiss/index.js +++ b/dismiss/index.js @@ -43794,9 +43794,9 @@ const tmp = __importStar(__webpack_require__(801)); const dotenv = __importStar(__webpack_require__(972)); const WERF_API_GET_CHANNEL_VERSION_URL_METHOD = 'https://werf.io/api/getChannelVersionURL'; const WERF_API_GET_VERSION_URL_METHOD = 'https://werf.io/api/getVersionURL'; +const MAJOR_MINOR_GROUP = '1.1'; class Manager { constructor() { - this.group = core.getInput('group').trim(); this.channel = core.getInput('channel').trim(); this.version = core.getInput('version').trim(); if (process.platform.toString() === 'win32') { @@ -43878,7 +43878,7 @@ class Manager { else { url = WERF_API_GET_CHANNEL_VERSION_URL_METHOD; query = { - group: this.group, + group: MAJOR_MINOR_GROUP, channel: this.channel, os: this.os, arch: this.arch diff --git a/install/README.md b/install/README.md index 3509cd3..adfae54 100644 --- a/install/README.md +++ b/install/README.md @@ -4,21 +4,20 @@ ___ By default, all actions setup actual werf version for [1.1 alpha channel](https://werf.io/releases.html) (more details about channels, werf release cycle and compatibility promise [here](https://github.com/werf/werf#backward-compatibility-promise)). -Using `group` and `channel` inputs the user can switch the release channel. +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@master +- uses: werf/actions/install@v1.1 with: - group: 1.1 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@master +- uses: werf/actions/install@v1.1 with: version: v1.1.16 ``` @@ -26,10 +25,6 @@ Withal, it is not necessary to work within release channels, and the user might ## Inputs ```yaml -group: - description: 'The MAJOR.MINOR version' - default: '1.1' - required: false channel: description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid' default: 'alpha' @@ -48,10 +43,10 @@ werf: steps: - name: Checkout code - uses: actions/checkout@master + uses: actions/checkout@v1.1 - name: Install werf CLI - uses: werf/actions/install@master + uses: werf/actions/install@v1.1 # for deploy and distributed locks - name: Create kube config diff --git a/install/action.yml b/install/action.yml index 2f44ad2..489f72b 100644 --- a/install/action.yml +++ b/install/action.yml @@ -5,10 +5,6 @@ branding: color: blue icon: anchor inputs: - group: - description: 'The MAJOR.MINOR version' - default: '1.1' - required: false channel: description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid' default: 'alpha' diff --git a/install/index.js b/install/index.js index 8f52688..f877c28 100644 --- a/install/index.js +++ b/install/index.js @@ -17330,9 +17330,9 @@ const tmp = __importStar(__webpack_require__(801)); const dotenv = __importStar(__webpack_require__(646)); const WERF_API_GET_CHANNEL_VERSION_URL_METHOD = 'https://werf.io/api/getChannelVersionURL'; const WERF_API_GET_VERSION_URL_METHOD = 'https://werf.io/api/getVersionURL'; +const MAJOR_MINOR_GROUP = '1.1'; class Manager { constructor() { - this.group = core.getInput('group').trim(); this.channel = core.getInput('channel').trim(); this.version = core.getInput('version').trim(); if (process.platform.toString() === 'win32') { @@ -17414,7 +17414,7 @@ class Manager { else { url = WERF_API_GET_CHANNEL_VERSION_URL_METHOD; query = { - group: this.group, + group: MAJOR_MINOR_GROUP, channel: this.channel, os: this.os, arch: this.arch diff --git a/package.json b/package.json index 42d25a7..dd0183c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "werf-actions", - "version": "1.0.0", + "version": "1.1.0", "description": "", "main": "lib", "dependencies": { diff --git a/publish/README.md b/publish/README.md index 8eedefc..4eab6f4 100644 --- a/publish/README.md +++ b/publish/README.md @@ -10,21 +10,20 @@ The action combines all the necessary steps in itself and logic may be divided i ### werf binary setup By default, all actions setup actual werf version for [1.1 alpha channel](https://werf.io/releases.html) (more details about channels, werf release cycle and compatibility promise [here](https://github.com/werf/werf#backward-compatibility-promise)). -Using `group` and `channel` inputs the user can switch the release channel. +Using the `channel` input the user can switch the release channel. > This is recommended approach to be up-to-date and to use actual werf version without changing configurations ```yaml -- uses: werf/actions/publish@master +- uses: werf/actions/publish@v1.1 with: - group: 1.1 channel: alpha ``` Withal, it is not necessary to work within release channels, and the user might specify certain werf version with `version` input. ```yaml -- uses: werf/actions/publish@master +- uses: werf/actions/publish@v1.1 with: version: v1.1.16 ``` @@ -38,7 +37,7 @@ The _kubeconfig_ may be used for deployment, cleanup, distributed locks and cach * Pass secret with `kube-config-base64-data` input: ```yaml - - uses: werf/actions/publish@master + - uses: werf/actions/publish@v1.1 with: kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }} ``` @@ -56,7 +55,7 @@ By default, action will use the token provided to your workflow. Any werf option can be defined with environment variables: ```yaml -- uses: werf/actions/publish@master +- uses: werf/actions/publish@v1.1 env: WERF_LOG_VERBOSE: "on" WERF_TAG_CUSTOM_TAG1: tag1 @@ -66,10 +65,6 @@ Any werf option can be defined with environment variables: ## Inputs ```yaml -group: - description: 'The MAJOR.MINOR version' - default: '1.1' - required: false channel: description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid' default: 'alpha' @@ -100,7 +95,7 @@ publish: fetch-depth: 0 - name: Publish - uses: werf/actions/publish@master + uses: werf/actions/publish@v1.1 with: kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }} ``` diff --git a/publish/action.yml b/publish/action.yml index 515e4ea..9be9c67 100644 --- a/publish/action.yml +++ b/publish/action.yml @@ -5,10 +5,6 @@ branding: color: blue icon: anchor inputs: - group: - description: 'The MAJOR.MINOR version' - default: '1.1' - required: false channel: description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid' default: 'alpha' diff --git a/publish/index.js b/publish/index.js index e087fd8..db1e577 100644 --- a/publish/index.js +++ b/publish/index.js @@ -43793,9 +43793,9 @@ const tmp = __importStar(__webpack_require__(801)); const dotenv = __importStar(__webpack_require__(972)); const WERF_API_GET_CHANNEL_VERSION_URL_METHOD = 'https://werf.io/api/getChannelVersionURL'; const WERF_API_GET_VERSION_URL_METHOD = 'https://werf.io/api/getVersionURL'; +const MAJOR_MINOR_GROUP = '1.1'; class Manager { constructor() { - this.group = core.getInput('group').trim(); this.channel = core.getInput('channel').trim(); this.version = core.getInput('version').trim(); if (process.platform.toString() === 'win32') { @@ -43877,7 +43877,7 @@ class Manager { else { url = WERF_API_GET_CHANNEL_VERSION_URL_METHOD; query = { - group: this.group, + group: MAJOR_MINOR_GROUP, channel: this.channel, os: this.os, arch: this.arch diff --git a/run/README.md b/run/README.md index 6545488..e193f44 100644 --- a/run/README.md +++ b/run/README.md @@ -10,21 +10,20 @@ The action combines all the necessary steps in itself and logic may be divided i ### werf binary setup By default, all actions setup actual werf version for [1.1 alpha channel](https://werf.io/releases.html) (more details about channels, werf release cycle and compatibility promise [here](https://github.com/werf/werf#backward-compatibility-promise)). -Using `group` and `channel` inputs the user can switch the release channel. +Using the `channel` input the user can switch the release channel. > This is recommended approach to be up-to-date and to use actual werf version without changing configurations ```yaml -- uses: werf/actions/run@master +- uses: werf/actions/run@v1.1 with: - group: 1.1 channel: alpha ``` Withal, it is not necessary to work within release channels, and the user might specify certain werf version with `version` input. ```yaml -- uses: werf/actions/run@master +- uses: werf/actions/run@v1.1 with: version: v1.1.16 ``` @@ -38,7 +37,7 @@ The _kubeconfig_ may be used for deployment, cleanup, distributed locks and cach * Pass secret with `kube-config-base64-data` input: ```yaml - - uses: werf/actions/run@master + - uses: werf/actions/run@v1.1 with: kube-config-base64-data: ${{ secrets.KUBE_CONFIG_BASE64_DATA }} ``` @@ -56,7 +55,7 @@ By default, action will use the token provided to your workflow. Any werf option can be defined with environment variables: ```yaml -- uses: werf/actions/run@master +- uses: werf/actions/run@v1.1 env: WERF_LOG_VERBOSE: "on" WERF_TAG_CUSTOM_TAG1: tag1 @@ -67,10 +66,6 @@ Any werf option can be defined with environment variables: ```yaml inputs: - group: - description: 'The MAJOR.MINOR version' - default: '1.1' - required: false channel: description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid' default: 'alpha' @@ -107,7 +102,7 @@ run: fetch-depth: 0 - name: Run - uses: werf/actions/run@master + uses: werf/actions/run@v1.1 with: image: backend args: rails server diff --git a/run/action.yml b/run/action.yml index 9312c95..0ce749e 100644 --- a/run/action.yml +++ b/run/action.yml @@ -5,10 +5,6 @@ branding: color: blue icon: anchor inputs: - group: - description: 'The MAJOR.MINOR version' - default: '1.1' - required: false channel: description: 'The one of the following channel: alpha, beta, ea, stable, rock-solid' default: 'alpha' diff --git a/run/index.js b/run/index.js index 34ede32..a96a99e 100644 --- a/run/index.js +++ b/run/index.js @@ -43866,9 +43866,9 @@ const tmp = __importStar(__webpack_require__(801)); const dotenv = __importStar(__webpack_require__(972)); const WERF_API_GET_CHANNEL_VERSION_URL_METHOD = 'https://werf.io/api/getChannelVersionURL'; const WERF_API_GET_VERSION_URL_METHOD = 'https://werf.io/api/getVersionURL'; +const MAJOR_MINOR_GROUP = '1.1'; class Manager { constructor() { - this.group = core.getInput('group').trim(); this.channel = core.getInput('channel').trim(); this.version = core.getInput('version').trim(); if (process.platform.toString() === 'win32') { @@ -43950,7 +43950,7 @@ class Manager { else { url = WERF_API_GET_CHANNEL_VERSION_URL_METHOD; query = { - group: this.group, + group: MAJOR_MINOR_GROUP, channel: this.channel, os: this.os, arch: this.arch diff --git a/src/manager.ts b/src/manager.ts index 566e69c..8a7ef7c 100644 --- a/src/manager.ts +++ b/src/manager.ts @@ -13,9 +13,9 @@ import * as dotenv from 'dotenv' const WERF_API_GET_CHANNEL_VERSION_URL_METHOD = 'https://werf.io/api/getChannelVersionURL' const WERF_API_GET_VERSION_URL_METHOD = 'https://werf.io/api/getVersionURL' +const MAJOR_MINOR_GROUP = '1.1' export class Manager { - private readonly group: string private readonly channel: string private readonly version: string private readonly os: string @@ -24,7 +24,6 @@ export class Manager { private binaryPath: string | undefined constructor() { - this.group = core.getInput('group').trim() this.channel = core.getInput('channel').trim() this.version = core.getInput('version').trim() @@ -113,7 +112,7 @@ export class Manager { } else { url = WERF_API_GET_CHANNEL_VERSION_URL_METHOD query = { - group: this.group, + group: MAJOR_MINOR_GROUP, channel: this.channel, os: this.os, arch: this.arch From 9a5b5c036147c4876de2fa3adff55c98c99c6725 Mon Sep 17 00:00:00 2001 From: Alexey Igrychev Date: Wed, 10 Mar 2021 10:53:56 +0000 Subject: [PATCH 2/3] [readme] Up the example arbitrary version --- README.md | 2 +- build-and-publish/README.md | 2 +- build/README.md | 2 +- cleanup/README.md | 2 +- converge/README.md | 2 +- deploy/README.md | 2 +- dismiss/README.md | 2 +- install/README.md | 2 +- publish/README.md | 2 +- run/README.md | 2 +- 10 files changed, 10 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index acd0be9..0e37916 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,7 @@ Withal, it is not necessary to work within release channels, and the user might ```yaml - uses: werf/actions/converge@v1.1 with: - version: v1.1.16 + version: v1.1.23 ``` ### kubeconfig setup (*optional*) diff --git a/build-and-publish/README.md b/build-and-publish/README.md index ffc0fa3..5ac45b8 100644 --- a/build-and-publish/README.md +++ b/build-and-publish/README.md @@ -25,7 +25,7 @@ Withal, it is not necessary to work within release channels, and the user might ```yaml - uses: werf/actions/build-and-publish@v1.1 with: - version: v1.1.16 + version: v1.1.23 ``` ### kubeconfig setup (*optional*) diff --git a/build/README.md b/build/README.md index 06eb6e0..0c39947 100644 --- a/build/README.md +++ b/build/README.md @@ -25,7 +25,7 @@ Withal, it is not necessary to work within release channels, and the user might ```yaml - uses: werf/actions/build@v1.1 with: - version: v1.1.16 + version: v1.1.23 ``` ### kubeconfig setup (*optional*) diff --git a/cleanup/README.md b/cleanup/README.md index 6645db9..e389378 100644 --- a/cleanup/README.md +++ b/cleanup/README.md @@ -25,7 +25,7 @@ Withal, it is not necessary to work within release channels, and the user might ```yaml - uses: werf/actions/cleanup@v1.1 with: - version: v1.1.16 + version: v1.1.23 ``` ### kubeconfig setup (*optional*) diff --git a/converge/README.md b/converge/README.md index 75cab44..d168f2a 100644 --- a/converge/README.md +++ b/converge/README.md @@ -25,7 +25,7 @@ Withal, it is not necessary to work within release channels, and the user might ```yaml - uses: werf/actions/converge@v1.1 with: - version: v1.1.16 + version: v1.1.23 ``` ### kubeconfig setup (*optional*) diff --git a/deploy/README.md b/deploy/README.md index 6406305..1259dfe 100644 --- a/deploy/README.md +++ b/deploy/README.md @@ -25,7 +25,7 @@ Withal, it is not necessary to work within release channels, and the user might ```yaml - uses: werf/actions/deploy@v1.1 with: - version: v1.1.16 + version: v1.1.23 ``` ### kubeconfig setup (*optional*) diff --git a/dismiss/README.md b/dismiss/README.md index 11f5af2..60d7d05 100644 --- a/dismiss/README.md +++ b/dismiss/README.md @@ -25,7 +25,7 @@ Withal, it is not necessary to work within release channels, and the user might ```yaml - uses: werf/actions/converge@v1.1 with: - version: v1.1.16 + version: v1.1.23 ``` ### kubeconfig setup (*optional*) diff --git a/install/README.md b/install/README.md index adfae54..7ed5579 100644 --- a/install/README.md +++ b/install/README.md @@ -19,7 +19,7 @@ Withal, it is not necessary to work within release channels, and the user might ```yaml - uses: werf/actions/install@v1.1 with: - version: v1.1.16 + version: v1.1.23 ``` ## Inputs diff --git a/publish/README.md b/publish/README.md index 4eab6f4..3011650 100644 --- a/publish/README.md +++ b/publish/README.md @@ -25,7 +25,7 @@ Withal, it is not necessary to work within release channels, and the user might ```yaml - uses: werf/actions/publish@v1.1 with: - version: v1.1.16 + version: v1.1.23 ``` ### kubeconfig setup (*optional*) diff --git a/run/README.md b/run/README.md index e193f44..650c165 100644 --- a/run/README.md +++ b/run/README.md @@ -25,7 +25,7 @@ Withal, it is not necessary to work within release channels, and the user might ```yaml - uses: werf/actions/run@v1.1 with: - version: v1.1.16 + version: v1.1.23 ``` ### kubeconfig setup (*optional*) From 07aab806f960d9c69411e4806e337186e0001595 Mon Sep 17 00:00:00 2001 From: Alexey Igrychev Date: Wed, 10 Mar 2021 11:23:57 +0000 Subject: [PATCH 3/3] Validate the version input value An arbitrary version must be within MAJOR.MINOR --- build-and-publish/index.js | 24 ++++++++++++++++++++---- build/index.js | 24 ++++++++++++++++++++---- cleanup/index.js | 24 ++++++++++++++++++++---- converge/index.js | 24 ++++++++++++++++++++---- deploy/index.js | 24 ++++++++++++++++++++---- dismiss/index.js | 24 ++++++++++++++++++++---- install/index.js | 18 ++++++++++++++++-- publish/index.js | 24 ++++++++++++++++++++---- run/index.js | 24 ++++++++++++++++++++---- src/common.ts | 13 ++++++++++++- src/manager.ts | 4 ++-- src/werf.ts | 3 +++ 12 files changed, 193 insertions(+), 37 deletions(-) create mode 100644 src/werf.ts diff --git a/build-and-publish/index.js b/build-and-publish/index.js index 45d7d05..4e16bd1 100644 --- a/build-and-publish/index.js +++ b/build-and-publish/index.js @@ -4167,7 +4167,19 @@ module.exports = gt /***/ }), -/* 290 */, +/* 290 */ +/***/ (function(__unusedmodule, exports) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MINOR = exports.MAJOR = exports.MAJOR_MINOR_GROUP = void 0; +exports.MAJOR_MINOR_GROUP = '1.1'; +exports.MAJOR = 1; +exports.MINOR = 1; + + +/***/ }), /* 291 */, /* 292 */, /* 293 */ @@ -11504,6 +11516,7 @@ const semver = __importStar(__webpack_require__(232)); const github_1 = __webpack_require__(127); const typescript_string_operations_1 = __webpack_require__(863); const manager_1 = __webpack_require__(965); +const werf = __importStar(__webpack_require__(290)); const minimalWerfVersion = 'v1.1.17'; function PrepareEnvironAndRunWerfCommand(args) { return __awaiter(this, void 0, void 0, function* () { @@ -11556,11 +11569,14 @@ exports.ProcessGitHubContext = ProcessGitHubContext; function ValidateWerfVersion(version) { const ver = semver.coerce(version); if (ver) { + if (ver.major !== werf.MAJOR || ver.minor !== werf.MINOR) { + throw new Error(typescript_string_operations_1.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; } } - throw new Error(typescript_string_operations_1.String.Format('werf version {0} is not supported (expected version should be equal or greater than {1})', version.trim(), minimalWerfVersion)); + throw new Error(typescript_string_operations_1.String.Format('werf version {0} is not supported (expected version must be equal or greater than {1})', version.trim(), minimalWerfVersion)); } exports.ValidateWerfVersion = ValidateWerfVersion; @@ -43791,9 +43807,9 @@ const typescript_string_operations_1 = __webpack_require__(863); const crypto = __importStar(__webpack_require__(417)); const tmp = __importStar(__webpack_require__(801)); const dotenv = __importStar(__webpack_require__(972)); +const werf = __importStar(__webpack_require__(290)); const WERF_API_GET_CHANNEL_VERSION_URL_METHOD = 'https://werf.io/api/getChannelVersionURL'; const WERF_API_GET_VERSION_URL_METHOD = 'https://werf.io/api/getVersionURL'; -const MAJOR_MINOR_GROUP = '1.1'; class Manager { constructor() { this.channel = core.getInput('channel').trim(); @@ -43877,7 +43893,7 @@ class Manager { else { url = WERF_API_GET_CHANNEL_VERSION_URL_METHOD; query = { - group: MAJOR_MINOR_GROUP, + group: werf.MAJOR_MINOR_GROUP, channel: this.channel, os: this.os, arch: this.arch diff --git a/build/index.js b/build/index.js index e74962a..169bd76 100644 --- a/build/index.js +++ b/build/index.js @@ -4118,7 +4118,19 @@ module.exports = gt /***/ }), -/* 290 */, +/* 290 */ +/***/ (function(__unusedmodule, exports) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MINOR = exports.MAJOR = exports.MAJOR_MINOR_GROUP = void 0; +exports.MAJOR_MINOR_GROUP = '1.1'; +exports.MAJOR = 1; +exports.MINOR = 1; + + +/***/ }), /* 291 */, /* 292 */, /* 293 */ @@ -11455,6 +11467,7 @@ const semver = __importStar(__webpack_require__(232)); const github_1 = __webpack_require__(127); const typescript_string_operations_1 = __webpack_require__(863); const manager_1 = __webpack_require__(965); +const werf = __importStar(__webpack_require__(290)); const minimalWerfVersion = 'v1.1.17'; function PrepareEnvironAndRunWerfCommand(args) { return __awaiter(this, void 0, void 0, function* () { @@ -11507,11 +11520,14 @@ exports.ProcessGitHubContext = ProcessGitHubContext; function ValidateWerfVersion(version) { const ver = semver.coerce(version); if (ver) { + if (ver.major !== werf.MAJOR || ver.minor !== werf.MINOR) { + throw new Error(typescript_string_operations_1.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; } } - throw new Error(typescript_string_operations_1.String.Format('werf version {0} is not supported (expected version should be equal or greater than {1})', version.trim(), minimalWerfVersion)); + throw new Error(typescript_string_operations_1.String.Format('werf version {0} is not supported (expected version must be equal or greater than {1})', version.trim(), minimalWerfVersion)); } exports.ValidateWerfVersion = ValidateWerfVersion; @@ -43791,9 +43807,9 @@ const typescript_string_operations_1 = __webpack_require__(863); const crypto = __importStar(__webpack_require__(417)); const tmp = __importStar(__webpack_require__(801)); const dotenv = __importStar(__webpack_require__(972)); +const werf = __importStar(__webpack_require__(290)); const WERF_API_GET_CHANNEL_VERSION_URL_METHOD = 'https://werf.io/api/getChannelVersionURL'; const WERF_API_GET_VERSION_URL_METHOD = 'https://werf.io/api/getVersionURL'; -const MAJOR_MINOR_GROUP = '1.1'; class Manager { constructor() { this.channel = core.getInput('channel').trim(); @@ -43877,7 +43893,7 @@ class Manager { else { url = WERF_API_GET_CHANNEL_VERSION_URL_METHOD; query = { - group: MAJOR_MINOR_GROUP, + group: werf.MAJOR_MINOR_GROUP, channel: this.channel, os: this.os, arch: this.arch diff --git a/cleanup/index.js b/cleanup/index.js index 36ebdbf..ebe3c76 100644 --- a/cleanup/index.js +++ b/cleanup/index.js @@ -4118,7 +4118,19 @@ module.exports = gt /***/ }), -/* 290 */, +/* 290 */ +/***/ (function(__unusedmodule, exports) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MINOR = exports.MAJOR = exports.MAJOR_MINOR_GROUP = void 0; +exports.MAJOR_MINOR_GROUP = '1.1'; +exports.MAJOR = 1; +exports.MINOR = 1; + + +/***/ }), /* 291 */, /* 292 */, /* 293 */ @@ -11455,6 +11467,7 @@ const semver = __importStar(__webpack_require__(232)); const github_1 = __webpack_require__(127); const typescript_string_operations_1 = __webpack_require__(863); const manager_1 = __webpack_require__(965); +const werf = __importStar(__webpack_require__(290)); const minimalWerfVersion = 'v1.1.17'; function PrepareEnvironAndRunWerfCommand(args) { return __awaiter(this, void 0, void 0, function* () { @@ -11507,11 +11520,14 @@ exports.ProcessGitHubContext = ProcessGitHubContext; function ValidateWerfVersion(version) { const ver = semver.coerce(version); if (ver) { + if (ver.major !== werf.MAJOR || ver.minor !== werf.MINOR) { + throw new Error(typescript_string_operations_1.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; } } - throw new Error(typescript_string_operations_1.String.Format('werf version {0} is not supported (expected version should be equal or greater than {1})', version.trim(), minimalWerfVersion)); + throw new Error(typescript_string_operations_1.String.Format('werf version {0} is not supported (expected version must be equal or greater than {1})', version.trim(), minimalWerfVersion)); } exports.ValidateWerfVersion = ValidateWerfVersion; @@ -43791,9 +43807,9 @@ const typescript_string_operations_1 = __webpack_require__(863); const crypto = __importStar(__webpack_require__(417)); const tmp = __importStar(__webpack_require__(801)); const dotenv = __importStar(__webpack_require__(972)); +const werf = __importStar(__webpack_require__(290)); const WERF_API_GET_CHANNEL_VERSION_URL_METHOD = 'https://werf.io/api/getChannelVersionURL'; const WERF_API_GET_VERSION_URL_METHOD = 'https://werf.io/api/getVersionURL'; -const MAJOR_MINOR_GROUP = '1.1'; class Manager { constructor() { this.channel = core.getInput('channel').trim(); @@ -43877,7 +43893,7 @@ class Manager { else { url = WERF_API_GET_CHANNEL_VERSION_URL_METHOD; query = { - group: MAJOR_MINOR_GROUP, + group: werf.MAJOR_MINOR_GROUP, channel: this.channel, os: this.os, arch: this.arch diff --git a/converge/index.js b/converge/index.js index 6b700a1..47bc5b3 100644 --- a/converge/index.js +++ b/converge/index.js @@ -4118,7 +4118,19 @@ module.exports = gt /***/ }), -/* 290 */, +/* 290 */ +/***/ (function(__unusedmodule, exports) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MINOR = exports.MAJOR = exports.MAJOR_MINOR_GROUP = void 0; +exports.MAJOR_MINOR_GROUP = '1.1'; +exports.MAJOR = 1; +exports.MINOR = 1; + + +/***/ }), /* 291 */, /* 292 */, /* 293 */ @@ -11455,6 +11467,7 @@ const semver = __importStar(__webpack_require__(232)); const github_1 = __webpack_require__(127); const typescript_string_operations_1 = __webpack_require__(863); const manager_1 = __webpack_require__(965); +const werf = __importStar(__webpack_require__(290)); const minimalWerfVersion = 'v1.1.17'; function PrepareEnvironAndRunWerfCommand(args) { return __awaiter(this, void 0, void 0, function* () { @@ -11507,11 +11520,14 @@ exports.ProcessGitHubContext = ProcessGitHubContext; function ValidateWerfVersion(version) { const ver = semver.coerce(version); if (ver) { + if (ver.major !== werf.MAJOR || ver.minor !== werf.MINOR) { + throw new Error(typescript_string_operations_1.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; } } - throw new Error(typescript_string_operations_1.String.Format('werf version {0} is not supported (expected version should be equal or greater than {1})', version.trim(), minimalWerfVersion)); + throw new Error(typescript_string_operations_1.String.Format('werf version {0} is not supported (expected version must be equal or greater than {1})', version.trim(), minimalWerfVersion)); } exports.ValidateWerfVersion = ValidateWerfVersion; @@ -43792,9 +43808,9 @@ const typescript_string_operations_1 = __webpack_require__(863); const crypto = __importStar(__webpack_require__(417)); const tmp = __importStar(__webpack_require__(801)); const dotenv = __importStar(__webpack_require__(972)); +const werf = __importStar(__webpack_require__(290)); const WERF_API_GET_CHANNEL_VERSION_URL_METHOD = 'https://werf.io/api/getChannelVersionURL'; const WERF_API_GET_VERSION_URL_METHOD = 'https://werf.io/api/getVersionURL'; -const MAJOR_MINOR_GROUP = '1.1'; class Manager { constructor() { this.channel = core.getInput('channel').trim(); @@ -43878,7 +43894,7 @@ class Manager { else { url = WERF_API_GET_CHANNEL_VERSION_URL_METHOD; query = { - group: MAJOR_MINOR_GROUP, + group: werf.MAJOR_MINOR_GROUP, channel: this.channel, os: this.os, arch: this.arch diff --git a/deploy/index.js b/deploy/index.js index ffc3360..8b77fe7 100644 --- a/deploy/index.js +++ b/deploy/index.js @@ -4118,7 +4118,19 @@ module.exports = gt /***/ }), -/* 290 */, +/* 290 */ +/***/ (function(__unusedmodule, exports) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MINOR = exports.MAJOR = exports.MAJOR_MINOR_GROUP = void 0; +exports.MAJOR_MINOR_GROUP = '1.1'; +exports.MAJOR = 1; +exports.MINOR = 1; + + +/***/ }), /* 291 */, /* 292 */, /* 293 */ @@ -11455,6 +11467,7 @@ const semver = __importStar(__webpack_require__(232)); const github_1 = __webpack_require__(127); const typescript_string_operations_1 = __webpack_require__(863); const manager_1 = __webpack_require__(965); +const werf = __importStar(__webpack_require__(290)); const minimalWerfVersion = 'v1.1.17'; function PrepareEnvironAndRunWerfCommand(args) { return __awaiter(this, void 0, void 0, function* () { @@ -11507,11 +11520,14 @@ exports.ProcessGitHubContext = ProcessGitHubContext; function ValidateWerfVersion(version) { const ver = semver.coerce(version); if (ver) { + if (ver.major !== werf.MAJOR || ver.minor !== werf.MINOR) { + throw new Error(typescript_string_operations_1.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; } } - throw new Error(typescript_string_operations_1.String.Format('werf version {0} is not supported (expected version should be equal or greater than {1})', version.trim(), minimalWerfVersion)); + throw new Error(typescript_string_operations_1.String.Format('werf version {0} is not supported (expected version must be equal or greater than {1})', version.trim(), minimalWerfVersion)); } exports.ValidateWerfVersion = ValidateWerfVersion; @@ -43756,9 +43772,9 @@ const typescript_string_operations_1 = __webpack_require__(863); const crypto = __importStar(__webpack_require__(417)); const tmp = __importStar(__webpack_require__(801)); const dotenv = __importStar(__webpack_require__(972)); +const werf = __importStar(__webpack_require__(290)); const WERF_API_GET_CHANNEL_VERSION_URL_METHOD = 'https://werf.io/api/getChannelVersionURL'; const WERF_API_GET_VERSION_URL_METHOD = 'https://werf.io/api/getVersionURL'; -const MAJOR_MINOR_GROUP = '1.1'; class Manager { constructor() { this.channel = core.getInput('channel').trim(); @@ -43842,7 +43858,7 @@ class Manager { else { url = WERF_API_GET_CHANNEL_VERSION_URL_METHOD; query = { - group: MAJOR_MINOR_GROUP, + group: werf.MAJOR_MINOR_GROUP, channel: this.channel, os: this.os, arch: this.arch diff --git a/dismiss/index.js b/dismiss/index.js index 2e7dd61..a426274 100644 --- a/dismiss/index.js +++ b/dismiss/index.js @@ -4118,7 +4118,19 @@ module.exports = gt /***/ }), -/* 290 */, +/* 290 */ +/***/ (function(__unusedmodule, exports) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MINOR = exports.MAJOR = exports.MAJOR_MINOR_GROUP = void 0; +exports.MAJOR_MINOR_GROUP = '1.1'; +exports.MAJOR = 1; +exports.MINOR = 1; + + +/***/ }), /* 291 */, /* 292 */, /* 293 */ @@ -11505,6 +11517,7 @@ const semver = __importStar(__webpack_require__(232)); const github_1 = __webpack_require__(127); const typescript_string_operations_1 = __webpack_require__(863); const manager_1 = __webpack_require__(965); +const werf = __importStar(__webpack_require__(290)); const minimalWerfVersion = 'v1.1.17'; function PrepareEnvironAndRunWerfCommand(args) { return __awaiter(this, void 0, void 0, function* () { @@ -11557,11 +11570,14 @@ exports.ProcessGitHubContext = ProcessGitHubContext; function ValidateWerfVersion(version) { const ver = semver.coerce(version); if (ver) { + if (ver.major !== werf.MAJOR || ver.minor !== werf.MINOR) { + throw new Error(typescript_string_operations_1.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; } } - throw new Error(typescript_string_operations_1.String.Format('werf version {0} is not supported (expected version should be equal or greater than {1})', version.trim(), minimalWerfVersion)); + throw new Error(typescript_string_operations_1.String.Format('werf version {0} is not supported (expected version must be equal or greater than {1})', version.trim(), minimalWerfVersion)); } exports.ValidateWerfVersion = ValidateWerfVersion; @@ -43792,9 +43808,9 @@ const typescript_string_operations_1 = __webpack_require__(863); const crypto = __importStar(__webpack_require__(417)); const tmp = __importStar(__webpack_require__(801)); const dotenv = __importStar(__webpack_require__(972)); +const werf = __importStar(__webpack_require__(290)); const WERF_API_GET_CHANNEL_VERSION_URL_METHOD = 'https://werf.io/api/getChannelVersionURL'; const WERF_API_GET_VERSION_URL_METHOD = 'https://werf.io/api/getVersionURL'; -const MAJOR_MINOR_GROUP = '1.1'; class Manager { constructor() { this.channel = core.getInput('channel').trim(); @@ -43878,7 +43894,7 @@ class Manager { else { url = WERF_API_GET_CHANNEL_VERSION_URL_METHOD; query = { - group: MAJOR_MINOR_GROUP, + group: werf.MAJOR_MINOR_GROUP, channel: this.channel, os: this.os, arch: this.arch diff --git a/install/index.js b/install/index.js index f877c28..a65086b 100644 --- a/install/index.js +++ b/install/index.js @@ -1880,6 +1880,20 @@ function _readLinuxVersionFile() { exports._readLinuxVersionFile = _readLinuxVersionFile; //# sourceMappingURL=manifest.js.map +/***/ }), + +/***/ 290: +/***/ (function(__unusedmodule, exports) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MINOR = exports.MAJOR = exports.MAJOR_MINOR_GROUP = void 0; +exports.MAJOR_MINOR_GROUP = '1.1'; +exports.MAJOR = 1; +exports.MINOR = 1; + + /***/ }), /***/ 293: @@ -17328,9 +17342,9 @@ const typescript_string_operations_1 = __webpack_require__(863); const crypto = __importStar(__webpack_require__(417)); const tmp = __importStar(__webpack_require__(801)); const dotenv = __importStar(__webpack_require__(646)); +const werf = __importStar(__webpack_require__(290)); const WERF_API_GET_CHANNEL_VERSION_URL_METHOD = 'https://werf.io/api/getChannelVersionURL'; const WERF_API_GET_VERSION_URL_METHOD = 'https://werf.io/api/getVersionURL'; -const MAJOR_MINOR_GROUP = '1.1'; class Manager { constructor() { this.channel = core.getInput('channel').trim(); @@ -17414,7 +17428,7 @@ class Manager { else { url = WERF_API_GET_CHANNEL_VERSION_URL_METHOD; query = { - group: MAJOR_MINOR_GROUP, + group: werf.MAJOR_MINOR_GROUP, channel: this.channel, os: this.os, arch: this.arch diff --git a/publish/index.js b/publish/index.js index db1e577..04f1a88 100644 --- a/publish/index.js +++ b/publish/index.js @@ -4118,7 +4118,19 @@ module.exports = gt /***/ }), -/* 290 */, +/* 290 */ +/***/ (function(__unusedmodule, exports) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MINOR = exports.MAJOR = exports.MAJOR_MINOR_GROUP = void 0; +exports.MAJOR_MINOR_GROUP = '1.1'; +exports.MAJOR = 1; +exports.MINOR = 1; + + +/***/ }), /* 291 */, /* 292 */, /* 293 */ @@ -11455,6 +11467,7 @@ const semver = __importStar(__webpack_require__(232)); const github_1 = __webpack_require__(127); const typescript_string_operations_1 = __webpack_require__(863); const manager_1 = __webpack_require__(965); +const werf = __importStar(__webpack_require__(290)); const minimalWerfVersion = 'v1.1.17'; function PrepareEnvironAndRunWerfCommand(args) { return __awaiter(this, void 0, void 0, function* () { @@ -11507,11 +11520,14 @@ exports.ProcessGitHubContext = ProcessGitHubContext; function ValidateWerfVersion(version) { const ver = semver.coerce(version); if (ver) { + if (ver.major !== werf.MAJOR || ver.minor !== werf.MINOR) { + throw new Error(typescript_string_operations_1.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; } } - throw new Error(typescript_string_operations_1.String.Format('werf version {0} is not supported (expected version should be equal or greater than {1})', version.trim(), minimalWerfVersion)); + throw new Error(typescript_string_operations_1.String.Format('werf version {0} is not supported (expected version must be equal or greater than {1})', version.trim(), minimalWerfVersion)); } exports.ValidateWerfVersion = ValidateWerfVersion; @@ -43791,9 +43807,9 @@ const typescript_string_operations_1 = __webpack_require__(863); const crypto = __importStar(__webpack_require__(417)); const tmp = __importStar(__webpack_require__(801)); const dotenv = __importStar(__webpack_require__(972)); +const werf = __importStar(__webpack_require__(290)); const WERF_API_GET_CHANNEL_VERSION_URL_METHOD = 'https://werf.io/api/getChannelVersionURL'; const WERF_API_GET_VERSION_URL_METHOD = 'https://werf.io/api/getVersionURL'; -const MAJOR_MINOR_GROUP = '1.1'; class Manager { constructor() { this.channel = core.getInput('channel').trim(); @@ -43877,7 +43893,7 @@ class Manager { else { url = WERF_API_GET_CHANNEL_VERSION_URL_METHOD; query = { - group: MAJOR_MINOR_GROUP, + group: werf.MAJOR_MINOR_GROUP, channel: this.channel, os: this.os, arch: this.arch diff --git a/run/index.js b/run/index.js index a96a99e..f7af389 100644 --- a/run/index.js +++ b/run/index.js @@ -4240,7 +4240,19 @@ module.exports = gt /***/ }), -/* 290 */, +/* 290 */ +/***/ (function(__unusedmodule, exports) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MINOR = exports.MAJOR = exports.MAJOR_MINOR_GROUP = void 0; +exports.MAJOR_MINOR_GROUP = '1.1'; +exports.MAJOR = 1; +exports.MINOR = 1; + + +/***/ }), /* 291 */, /* 292 */, /* 293 */ @@ -11577,6 +11589,7 @@ const semver = __importStar(__webpack_require__(232)); const github_1 = __webpack_require__(127); const typescript_string_operations_1 = __webpack_require__(863); const manager_1 = __webpack_require__(965); +const werf = __importStar(__webpack_require__(290)); const minimalWerfVersion = 'v1.1.17'; function PrepareEnvironAndRunWerfCommand(args) { return __awaiter(this, void 0, void 0, function* () { @@ -11629,11 +11642,14 @@ exports.ProcessGitHubContext = ProcessGitHubContext; function ValidateWerfVersion(version) { const ver = semver.coerce(version); if (ver) { + if (ver.major !== werf.MAJOR || ver.minor !== werf.MINOR) { + throw new Error(typescript_string_operations_1.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; } } - throw new Error(typescript_string_operations_1.String.Format('werf version {0} is not supported (expected version should be equal or greater than {1})', version.trim(), minimalWerfVersion)); + throw new Error(typescript_string_operations_1.String.Format('werf version {0} is not supported (expected version must be equal or greater than {1})', version.trim(), minimalWerfVersion)); } exports.ValidateWerfVersion = ValidateWerfVersion; @@ -43864,9 +43880,9 @@ const typescript_string_operations_1 = __webpack_require__(863); const crypto = __importStar(__webpack_require__(417)); const tmp = __importStar(__webpack_require__(801)); const dotenv = __importStar(__webpack_require__(972)); +const werf = __importStar(__webpack_require__(290)); const WERF_API_GET_CHANNEL_VERSION_URL_METHOD = 'https://werf.io/api/getChannelVersionURL'; const WERF_API_GET_VERSION_URL_METHOD = 'https://werf.io/api/getVersionURL'; -const MAJOR_MINOR_GROUP = '1.1'; class Manager { constructor() { this.channel = core.getInput('channel').trim(); @@ -43950,7 +43966,7 @@ class Manager { else { url = WERF_API_GET_CHANNEL_VERSION_URL_METHOD; query = { - group: MAJOR_MINOR_GROUP, + group: werf.MAJOR_MINOR_GROUP, channel: this.channel, os: this.os, arch: this.arch diff --git a/src/common.ts b/src/common.ts index 7b846b3..615f602 100644 --- a/src/common.ts +++ b/src/common.ts @@ -5,6 +5,7 @@ import * as semver from 'semver' import {context} from '@actions/github' import {String} from 'typescript-string-operations' import {Manager} from './manager' +import * as werf from './werf' const minimalWerfVersion = 'v1.1.17' @@ -66,6 +67,16 @@ export function ProcessGitHubContext(): void { export function ValidateWerfVersion(version: string): void { const ver = semver.coerce(version) if (ver) { + if (ver.major !== werf.MAJOR || ver.minor !== werf.MINOR) { + throw new Error( + String.Format( + 'The arbitrary version ({0}) must be within the MAJOR.MINOR ({1})', + version.trim(), + werf.MAJOR_MINOR_GROUP + ) + ) + } + if (semver.gte(ver, minimalWerfVersion)) { return } @@ -73,7 +84,7 @@ export function ValidateWerfVersion(version: string): void { throw new Error( String.Format( - 'werf version {0} is not supported (expected version should be equal or greater than {1})', + 'werf version {0} is not supported (expected version must be equal or greater than {1})', version.trim(), minimalWerfVersion ) diff --git a/src/manager.ts b/src/manager.ts index 8a7ef7c..7388475 100644 --- a/src/manager.ts +++ b/src/manager.ts @@ -9,11 +9,11 @@ import {String} from 'typescript-string-operations' import * as crypto from 'crypto' import * as tmp from 'tmp' import * as dotenv from 'dotenv' +import * as werf from './werf' const WERF_API_GET_CHANNEL_VERSION_URL_METHOD = 'https://werf.io/api/getChannelVersionURL' const WERF_API_GET_VERSION_URL_METHOD = 'https://werf.io/api/getVersionURL' -const MAJOR_MINOR_GROUP = '1.1' export class Manager { private readonly channel: string @@ -112,7 +112,7 @@ export class Manager { } else { url = WERF_API_GET_CHANNEL_VERSION_URL_METHOD query = { - group: MAJOR_MINOR_GROUP, + group: werf.MAJOR_MINOR_GROUP, channel: this.channel, os: this.os, arch: this.arch diff --git a/src/werf.ts b/src/werf.ts new file mode 100644 index 0000000..5e0f096 --- /dev/null +++ b/src/werf.ts @@ -0,0 +1,3 @@ +export const MAJOR_MINOR_GROUP = '1.1' +export const MAJOR = 1 +export const MINOR = 1