aboutsummaryrefslogtreecommitdiff
path: root/.github
diff options
context:
space:
mode:
authorMenny Even Danan <menny@evendanan.net>2020-03-15 19:10:21 +0000
committerMenny Even Danan <menny@evendanan.net>2020-03-15 21:37:34 +0000
commit33188df76e30bcb9506668dd8cbdaa331d8e2573 (patch)
tree87c0816dd1b817c3e9da473fbfd42deae02ba976 /.github
parentcd5e733a4d3e03cd962630b870132acd0cd0496f (diff)
downloadAnySoftKeyboard-33188df76e30bcb9506668dd8cbdaa331d8e2573.tar.gz
AnySoftKeyboard-33188df76e30bcb9506668dd8cbdaa331d8e2573.tar.bz2
fix promote script and support halt-publishing
Diffstat (limited to '.github')
-rw-r--r--.github/actions/deploy-request/action.yml40
-rwxr-xr-x.github/actions/deploy-request/deployment_request.sh18
-rwxr-xr-x.github/actions/deploy/deploy.sh2
-rw-r--r--.github/workflows/checks.yml12
-rw-r--r--.github/workflows/deployment_promote.yml12
5 files changed, 74 insertions, 10 deletions
diff --git a/.github/actions/deploy-request/action.yml b/.github/actions/deploy-request/action.yml
new file mode 100644
index 000000000..8ba8a188a
--- /dev/null
+++ b/.github/actions/deploy-request/action.yml
@@ -0,0 +1,40 @@
+name: "deploy-request"
+description: "Request a deployment"
+author: "menny"
+
+inputs:
+ sha:
+ description: "SHA to deploy"
+ required: true
+ ref:
+ description: "branch to deploy"
+ required: true
+ new_deploy:
+ description: "whether this is a new deploy"
+ required: true
+ api_username:
+ description: "username for github api"
+ required: true
+ api_token:
+ description: "token for github api"
+ required: true
+runs:
+ using: "docker"
+ image: "docker://menny/ndk_ask:1.13.6"
+ env:
+ TERM: dumb
+ GRADLE_OPTS: "-Dorg.gradle.daemon=false --stacktrace"
+ GRADLE_USER_HOME: ".github_cache_gradle/"
+
+ entrypoint: /bin/bash
+ args:
+ - .github/actions/deploy-request/deployment_request.sh
+ - ${{ inputs.sha }}
+ - ${{ inputs.ref }}
+ - ${{ inputs.new_deploy }}
+ - ${{ inputs.api_username }}
+ - ${{ inputs.api_token }}
+
+branding:
+ icon: 'upload-cloud'
+ color: 'blue'
diff --git a/.github/actions/deploy-request/deployment_request.sh b/.github/actions/deploy-request/deployment_request.sh
new file mode 100755
index 000000000..d9696085e
--- /dev/null
+++ b/.github/actions/deploy-request/deployment_request.sh
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+set -e
+
+SHA="${1}"
+shift
+REF="${1}"
+shift
+NEW_DEPLOY="${1}"
+shift
+API_USERNAME="${1}"
+shift
+API_TOKEN="${1}"
+shift
+
+echo "Request deployment flow for sha ${SHA} on branch ${REF}. New deployment: ${NEW_DEPLOY}."
+./gradlew :deployment:deploymentRequestProcess -PRequest.sha="${SHA}" -PRequest.ref="${REF}" -PRequest.new_deploy="${NEW_DEPLOY}" -PRequest.apiUsername="${API_USERNAME}" -PRequest.apiUserToken="${API_TOKEN}"
+
+[[ -n "${GITHUB_ACTIONS}" ]] && chmod -R a+rwx .
diff --git a/.github/actions/deploy/deploy.sh b/.github/actions/deploy/deploy.sh
index f5872e6ba..70b00636e 100755
--- a/.github/actions/deploy/deploy.sh
+++ b/.github/actions/deploy/deploy.sh
@@ -95,6 +95,4 @@ echo "Counter is ${BUILD_COUNT_FOR_VERSION}, crash email: ${ANYSOFTKEYBOARD_CRAS
./gradlew "${DEPLOY_TASKS[@]}"
-## TODO: kill previous enabled environments
-
[[ -n "${GITHUB_ACTIONS}" ]] && chmod -R a+rwx .
diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml
index cc0c95742..f9e1e1aa0 100644
--- a/.github/workflows/checks.yml
+++ b/.github/workflows/checks.yml
@@ -198,7 +198,11 @@ jobs:
container: menny/android_base:1.13.6
steps:
- uses: actions/checkout@v2
- - name: request-new-deploys
- run: |
- ./gradlew :deployment:imeOnMasterPush :deployment:addOnsOnMasterPush \
- -PRequest.sha=${{ github.sha }} -PRequest.apiUsername=${{ secrets.BOT_MASTER_RW_GITHUB_USERNAME }} -PRequest.apiUserToken=${{ secrets.BOT_MASTER_RW_GITHUB_TOKEN }}
+ - uses: ./.github/actions/deploy-request
+ name: request-new-deploys
+ with:
+ sha: ${{ github.sha }}
+ ref: ${{ github.ref }}
+ new_deploy: true
+ api_username: ${{ secrets.BOT_MASTER_RW_GITHUB_USERNAME }}
+ api_token: ${{ secrets.BOT_MASTER_RW_GITHUB_TOKEN }}
diff --git a/.github/workflows/deployment_promote.yml b/.github/workflows/deployment_promote.yml
index 1d397778b..f7a5c5151 100644
--- a/.github/workflows/deployment_promote.yml
+++ b/.github/workflows/deployment_promote.yml
@@ -15,7 +15,11 @@ jobs:
container: menny/android_base:1.13.6
steps:
- uses: actions/checkout@v2
- - name: requets-pre-release-promote
- run: |
- ./gradlew :deployment:imePromoteMaster :deployment:addOnsPromoteMaster \
- -PRequest.sha=${{ github.sha }} -PRequest.apiUsername=${{ secrets.BOT_MASTER_RW_GITHUB_USERNAME }} -PRequest.apiUserToken=${{ secrets.BOT_MASTER_RW_GITHUB_TOKEN }}
+ - name: request-scheduled-promote
+ uses: ./.github/actions/deploy-request
+ with:
+ sha: ${{ github.sha }}
+ ref: ${{ github.ref }}
+ new_deploy: false
+ api_username: ${{ secrets.BOT_MASTER_RW_GITHUB_USERNAME }}
+ api_token: ${{ secrets.BOT_MASTER_RW_GITHUB_TOKEN }}