sdk-codegen-scripts: v21.5.19 #876
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Send publish metrics to bigquery | |
on: | |
release: | |
types: published | |
jobs: | |
publish: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Authenticate to Google Cloud | |
uses: google-github-actions/auth@v2 | |
with: | |
credentials_json: ${{ secrets.GCP_BQ_METRICS_KEY }} | |
project_id: ${{ secrets.GCP_PROJECT_ID }} | |
create_credentials_file: true | |
export_environment_variables: true | |
- name: Set up Cloud SDK | |
uses: google-github-actions/setup-gcloud@v2 | |
- run: 'jq -c ''.release | | |
{ | |
package_name: .name | split(" ")[0], | |
name, | |
tag_name, | |
version: .tag_name | split("-v")[1], | |
html_url, | |
target_commitish, | |
created_at, | |
published_at, | |
draft, | |
prerelease | |
}'' $GITHUB_EVENT_PATH > releases.json' | |
# Avoid rate limit exceeded error in bq load step | |
- name: Sleep for random time | |
run: sleep $((RANDOM % 120)) | |
- run: bq load --source_format=NEWLINE_DELIMITED_JSON metrics.releases releases.json |