-
Notifications
You must be signed in to change notification settings - Fork 167
/
cloudbuild-publish.yaml
35 lines (35 loc) · 1.31 KB
/
cloudbuild-publish.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
steps:
- name: 'gcr.io/cloud-builders/gcloud'
script: |
#!/usr/bin/env bash
gcloud secrets versions access latest --secret=github-token-access --format='get(payload.data)' | tr '_-' '/+' | base64 -d > ~/token.txt
REPO_TOKEN="$(gcloud auth print-access-token)" NPM_TOKEN=$NPM_TOKEN ./scripts/create_npmrc
secretEnv: ['NPM_TOKEN']
- name: gcr.io/cloud-builders/bazel:5.4.0
script: |
#!/usr/bin/env bash
./scripts/publish
- name: 'gcr.io/$PROJECT_ID/github'
entrypoint: 'bash'
args:
- '-c'
- |
set -e
version=$(cat version.bzl | grep DF_VERSION | awk '{ print $3 }' | sed "s/\"//g")
echo "Creating release notes for $version"
gh auth login --with-token < ~/token.txt
gh release create $version --generate-notes
availableSecrets:
secretManager:
- versionName: projects/178487900909/secrets/npm-publish-token/versions/2
env: 'NPM_TOKEN'
artifacts:
npmPackages:
- repository: 'https://us-central1-npm.pkg.dev/dataform-open-source/dataform-open-source'
packagePath: './bazel-bin/packages/@dataform/cli'
- repository: 'https://us-central1-npm.pkg.dev/dataform-open-source/dataform-open-source'
packagePath: './bazel-bin/packages/@dataform/core'
options:
machineType: E2_HIGHCPU_8
requestedVerifyOption: VERIFIED
timeout: 3600s