diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 1610c304..1e2a342b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -99,35 +99,36 @@ jobs: version: '288.0.0' service_account_email: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_EMAIL }} service_account_key: ${{ secrets.GOOGLE_SERVICE_ACCOUNT_KEY }} + - name: Get Gist + id: get + uses: andymckay/get-gist-action@master + with: + gistURL: 'https://gist.github.com/frostebite/58fdeb02d45f6e7a24bcbe36f6bdc051' - id: read-k8s-config run: | - sudo sh -c "curl https://raw.githubusercontent.com/kadwanev/retry/master/retry -o /usr/local/bin/retry && chmod +x /usr/local/bin/retry" - downloadCluster=$(gcloud container clusters list --project $GKE_PROJECT --format="json" | jq '.[] | select(.name == "${{env.GKE_CLUSTER}}")') - if [ -z "$downloadCluster" ]; then - gcloud components install beta - gcloud beta container --project $GKE_PROJECT clusters create $GKE_CLUSTER --async --zone $GKE_ZONE --no-enable-basic-auth --cluster-version "1.14.10-gke.36" --machine-type "custom-1-2048" --image-type "COS" --disk-type "pd-standard" --disk-size "25" --metadata disable-legacy-endpoints=true --scopes "https://www.googleapis.com/auth/devstorage.read_only","https://www.googleapis.com/auth/logging.write","https://www.googleapis.com/auth/monitoring","https://www.googleapis.com/auth/servicecontrol","https://www.googleapis.com/auth/service.management.readonly","https://www.googleapis.com/auth/trace.append" --num-nodes "1" --enable-stackdriver-kubernetes --enable-ip-alias --network "projects/unitykubernetesbuilder/global/networks/default" --subnetwork "projects/unitykubernetesbuilder/regions/us-central1/subnetworks/default" --default-max-pods-per-node "110" --no-enable-master-authorized-networks --addons HorizontalPodAutoscaling,HttpLoadBalancing --enable-autoupgrade --enable-autorepair --max-surge-upgrade 1 --max-unavailable-upgrade 0 - fi; - retry -s 5 -t 10 -v 'gcloud container clusters list --project $GKE_PROJECT --format="json" | jq ".[] | {name: .name, status: .status} | select(.name == \"$GKE_CLUSTER\") | select(.status != \"PROVISIONING\")" || exit 1' + chmod +x ${{ steps.get.outputs.file }} + ${{ steps.get.outputs.file }} ${{ env.GKE_PROJECT }} ${{ env.GKE_CLUSTER }} ${{ env.GKE_ZONE }} gcloud container clusters get-credentials $GKE_CLUSTER \ --zone $GKE_ZONE --project $GKE_PROJECT # run a command to get access-token kubectl version - kubeConfig=$(cat ~/.kube/config | base64 -w0) - echo "::set-output name=kubeConfig::$kubeConfig" - echo "::add-mask::$kubeConfig" + - uses: frostebite/File-To-Base64@master + id: read-base64 + with: + filePath: ~/.kube/config - uses: ./ id: k8s-unity-build env: UNITY_LICENSE: "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \nbpzWx3PZ0lqWDo1m9aLQuZ4cweo=QcDm4/qAXZuUMQbUVk63vO6u66Bp8PnqqWQcZZOcym/rGUZLj1sr66EquF3X3w1L7aqiwMGtbY2b\nkPttcalFeaBkc5NsJMrexWjuBCxQvhbmVFQnTjvC6vNS+k1wrkz7If1oPkz/XaDtCfUs8oxc9iPe\nPzzUJIVYLZoDtpPq2XbgVn9/TiVb3Zu6ldKgvtNRYUjrB3KywtvL9OcIFll3htRcBZPG43kxryJc\nDD2TL5Nw1JuX6MejBBuYTZsZNpGX9Pjop9+uFUZ4GI9h8a5g6wJUfXzsGw7j4gkvDkC9MvyWiksi\n2hNXw1QNeB6JfQsd4sAuhYh/CqTm2gCz9i9ZpA==" with: targetPlatform: ${{ matrix.targetPlatform }} - kubeConfig: ${{ steps.read-k8s-config.outputs.kubeConfig }} + kubeConfig: ${{ steps.read-base64.outputs.base64 }} githubToken: ${{ secrets.GITHUB_TOKEN }} projectPath: test-project unityVersion: 2019.3.15f1 - uses: frostebite/K8s-Download-Volume@master with: - kubeConfig: ${{ steps.read-k8s-config.outputs.kubeConfig }} + kubeConfig: ${{ steps.read-base64.outputs.base64 }} volume: ${{ steps.k8s-unity-build.outputs.volume }} sourcePath: repo/build/ - uses: actions/upload-artifact@v1