Skip to content

wholly-artifact: v0.1.20 #878

wholly-artifact: v0.1.20

wholly-artifact: v0.1.20 #878

Workflow file for this run

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