diff options
| -rw-r--r-- | .github/actions/deploy-request/action.yml | 6 | ||||
| -rwxr-xr-x | .github/actions/deploy-request/request.sh | 4 | ||||
| -rw-r--r-- | .github/workflows/checks.yml | 18 | ||||
| -rw-r--r-- | .github/workflows/deploy.yml | 24 | ||||
| -rw-r--r-- | .github/workflows/localization_update.yml | 8 |
5 files changed, 36 insertions, 24 deletions
diff --git a/.github/actions/deploy-request/action.yml b/.github/actions/deploy-request/action.yml index 9703b66ad..6fc9b2ef8 100644 --- a/.github/actions/deploy-request/action.yml +++ b/.github/actions/deploy-request/action.yml @@ -4,7 +4,10 @@ description: "Performs a deploy request" inputs: ref: - description: "ref to publish" + description: "ref (branch) to publish" + required: true + sha: + description: "commit to deploy" required: true api_user_name: description: "the username to use for API calls" @@ -23,6 +26,7 @@ runs: args: - .github/actions/deploy-request/request.sh - ${{ inputs.ref }} + - ${{ inputs.sha }} - ${{ inputs.api_user_name }} - ${{ inputs.api_user_token }} - ${{ inputs.reports_folder }} diff --git a/.github/actions/deploy-request/request.sh b/.github/actions/deploy-request/request.sh index 8ae0685f5..9002fb399 100755 --- a/.github/actions/deploy-request/request.sh +++ b/.github/actions/deploy-request/request.sh @@ -2,6 +2,8 @@ set -e REF_TO_DEPLOY="${1}" +#we are using exact SHA to deploy, and not branc (which can move) +SHA_TO_DEPLOY="${1}" API_USERNAME="${2}" API_TOKEN="${3}" OUTPUT="${4}" @@ -14,7 +16,7 @@ function deployment_request() { echo "making request to: ${1}" local JSON_TEXT JSON_TEXT=$( jq -n \ - --arg jsonRef "${REF_TO_DEPLOY}" \ + --arg jsonRef "${SHA_TO_DEPLOY}" \ --arg jsonDeployTarget "${1}" \ --arg jsonDescription "${2}" \ '{ ref: $jsonRef, task: "deploy", auto_merge: false, environment: $jsonDeployTarget, description: $jsonDescription, required_contexts: [ "push-ready" ] }' ) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index dde05f860..646698e3f 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -25,15 +25,16 @@ jobs: container: menny/ndk_ask:1.13.5 steps: - uses: actions/checkout@v2 + - name: github_object + env: + GITHUB_CONTEXT_JSON: ${{ toJson(github) }} + run: mkdir -p build/github_object && echo "${GITHUB_CONTEXT_JSON}" > build/github_object/github_object.json + - uses: actions/upload-artifact@v1.0.0 + with: + name: github_object + path: build/github_object - name: setup - run: | - echo "ENV:" - printenv - echo "******" - echo "Event: " - cat ${GITHUB_EVENT_PATH} - echo "***" - ./scripts/ci/ci_setup.sh + run: ./scripts/ci/ci_setup.sh checks: needs: [setup] @@ -198,6 +199,7 @@ jobs: - uses: ./.github/actions/deploy-request with: ref: ${{ github.ref }} + sha: ${{ github.sha }} api_user_name: ${{ secrets.BOT_MASTER_RW_GITHUB_USERNAME }} api_user_token: ${{ secrets.BOT_MASTER_RW_GITHUB_TOKEN }} reports_folder: deploy-reports diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index 2c0a7a93e..39e628efe 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,22 +14,18 @@ jobs: container: menny/ndk_ask:1.13.5 steps: - uses: actions/checkout@v2 - - name: setup + - name: github_object env: GITHUB_CONTEXT_JSON: ${{ toJson(github) }} - - run: | - echo "ENV:" - printenv - echo "******" - echo "Event: " - cat ${GITHUB_EVENT_PATH} - echo "***" - echo "CONTEXT: " - echo "${GITHUB_CONTEXT_JSON}" - ./scripts/ci/ci_setup.sh + run: mkdir -p build/github_object && echo "${GITHUB_CONTEXT_JSON}" > build/github_object/github_object.json + - uses: actions/upload-artifact@v1.0.0 + with: + name: github_object + path: build/github_object + - name: setup + run: ./scripts/ci/ci_setup.sh - uses: ./.github/actions/deploy - if: startsWith(github.event.environment, 'app') + if: startsWith(github.event.deployment.environment, 'app') with: deploy_target: ${{ github.event.environment }} crash_report_email: ${{ secrets.ANYSOFTKEYBOARD_CRASH_REPORT_EMAIL }} @@ -40,7 +36,7 @@ jobs: publish_service_account_creds_url: ${{ secrets.PUBLISH_CERT_FILE_URL }} publish_service_account: ${{ secrets.PUBLISH_APK_SERVICE_ACCOUNT_EMAIL }} - uses: ./.github/actions/deploy - if: startsWith(github.event.environment, 'addons') + if: startsWith(github.event.deployment.environment, 'addons') with: deploy_target: ${{ github.event.environment }} crash_report_email: ${{ secrets.ANYSOFTKEYBOARD_CRASH_REPORT_EMAIL }} diff --git a/.github/workflows/localization_update.yml b/.github/workflows/localization_update.yml index 69cf5123b..5bd5354e5 100644 --- a/.github/workflows/localization_update.yml +++ b/.github/workflows/localization_update.yml @@ -15,6 +15,14 @@ jobs: runs-on: ubuntu-18.04 steps: - uses: actions/checkout@v2 + - name: github_object + env: + GITHUB_CONTEXT_JSON: ${{ toJson(github) }} + run: mkdir -p build/github_object && echo "${GITHUB_CONTEXT_JSON}" > build/github_object/github_object.json + - uses: actions/upload-artifact@v1.0.0 + with: + name: github_object + path: build/github_object - name: Upload strings from ime/app master run: ./scripts/upload_strings_to_crowdin_api.sh keep - name: Download latest translations |
