aboutsummaryrefslogtreecommitdiff
path: root/.github/actions
diff options
context:
space:
mode:
Diffstat (limited to '.github/actions')
-rw-r--r--.github/actions/codecov/action.yml2
-rw-r--r--.github/actions/collect-reports/action.yml5
-rw-r--r--.github/actions/deploy-request/action.yml28
-rwxr-xr-x.github/actions/deploy-request/request.sh31
-rw-r--r--.github/actions/deploy/action.yml2
5 files changed, 64 insertions, 4 deletions
diff --git a/.github/actions/codecov/action.yml b/.github/actions/codecov/action.yml
index e42e43cc0..3a09a9e08 100644
--- a/.github/actions/codecov/action.yml
+++ b/.github/actions/codecov/action.yml
@@ -1,4 +1,4 @@
-name: "Code Cov"
+name: "code-coverage"
author: "menny"
description: "action which locate coverage files and uploads them"
diff --git a/.github/actions/collect-reports/action.yml b/.github/actions/collect-reports/action.yml
index b09e27ec8..7dc42a525 100644
--- a/.github/actions/collect-reports/action.yml
+++ b/.github/actions/collect-reports/action.yml
@@ -1,5 +1,6 @@
-name: "Collect reports"
+name: "collect-reports"
author: "menny"
+description: "Collect checks report files"
inputs:
output_folder:
@@ -19,4 +20,4 @@ runs:
branding:
icon: 'package'
- color: 'brown'
+ color: 'green'
diff --git a/.github/actions/deploy-request/action.yml b/.github/actions/deploy-request/action.yml
new file mode 100644
index 000000000..9f36e7590
--- /dev/null
+++ b/.github/actions/deploy-request/action.yml
@@ -0,0 +1,28 @@
+name: "deployment-request"
+author: "menny"
+description: "Performs a deploy request"
+
+inputs:
+ ref:
+ description: "ref to publish"
+ required: true
+ api_user_name:
+ description: "the username to use for API calls"
+ required: true
+ api_user_token:
+ description: "the user API token to use for API calls"
+ required: true
+
+runs:
+ using: "docker"
+ image: "docker://menny/ndk_ask:1.13.1"
+ entrypoint: /bin/bash
+ args:
+ - .github/actions/deploy-request/request.sh
+ - ${{ inputs.ref }}
+ - ${{ inputs.api_user_name }}
+ - ${{ inputs.api_user_token }}
+
+branding:
+ icon: 'package'
+ color: 'purple'
diff --git a/.github/actions/deploy-request/request.sh b/.github/actions/deploy-request/request.sh
new file mode 100755
index 000000000..7dc569005
--- /dev/null
+++ b/.github/actions/deploy-request/request.sh
@@ -0,0 +1,31 @@
+#!/usr/bin/env bash
+set -e
+
+REF_TO_DEPLOY="${1}"
+API_USERNAME="${2}"
+API_TOKEN="${3}"
+
+mkdir -p /tmp/deploy-request || true
+
+function deployment_request() {
+ echo "making request to: ${1}"
+ local JSON_TEXT
+ JSON_TEXT=$( jq -n \
+ --arg jsonRef "${REF_TO_DEPLOY}" \
+ --arg jsonDeployTarget "${1}" \
+ --arg jsonDescription "${2}" \
+ '{ ref: $jsonRef, task: "deploy", auto_merge: false, environment: $jsonDeployTarget, description: $jsonDescription }' )
+
+ local JSON_FILENAME="/tmp/deploy-request/deployment_request_${1}.json"
+ echo "${JSON_TEXT}" > "${JSON_FILENAME}"
+
+ curl -u "${API_USERNAME}:${API_TOKEN}" -o "/tmp/deploy-request/deployment_response_${1}.json" -d "@${JSON_FILENAME}" https://api.github.com/repos/AnySoftKeyboard/AnySoftKeyboard/deployments
+}
+
+#some deploy logic
+if [[ "${REF_TO_DEPLOY}" == "refs/heads/master" ]]; then
+ deployment_request "app_alpha" "Deployment request by ${API_USERNAME}"
+ deployment_request "addons_alpha" "Deployment request by ${API_USERNAME}"
+elif [[ "${REF_TO_DEPLOY}" == "release-branch-v"* ]]; then
+ deployment_request "app_beta" "Deployment request by ${API_USERNAME}"
+fi
diff --git a/.github/actions/deploy/action.yml b/.github/actions/deploy/action.yml
index 11a6becc2..525d7178a 100644
--- a/.github/actions/deploy/action.yml
+++ b/.github/actions/deploy/action.yml
@@ -1,4 +1,4 @@
-name: "Deploy app"
+name: "deploy"
description: "Deploys the AnySoftKeyboard artifacts to Play Store"
author: "menny"