-
Notifications
You must be signed in to change notification settings - Fork 792
/
Copy pathrelease.yaml
65 lines (65 loc) · 2.06 KB
/
release.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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# This workflow will be triggered when a new release tag (of the form vX.Y.Z) is
# pushed to the vscode-go repo.)
# For local testing, run:
# gcloud builds submit --config release.yaml --no-source --substitutions=_TAG_NAME="v0.40.1-rc.1",_GITHUB_TOKEN="alias1",_VSCE_TOKEN="alias2"
#
# WARNING: this will publish the extension.
#
# This will check out the vscode-go repo on the specified tag, build the extension,
# and publish it to the VS Code Marketplace and the GitHub Releases page if not published already.
steps:
# TODO: check build/test status
# TODO: configure failure notification https://cloud.google.com/build/docs/configuring-notifications/notifiers
- name: gcr.io/cloud-builders/git
args:
- clone
- '--branch=$TAG_NAME'
- '--single-branch'
- '--depth=1'
- 'https://go.googlesource.com/vscode-go'
- vscode-go
id: clone vscode-go repo
- name: gcr.io/cloud-builders/docker
args:
- '-R'
- '1000:1000'
- /workspace
- /builder/home
dir: /
id: adjust file permissions
entrypoint: chown
- name: us-docker.pkg.dev/$PROJECT_ID/vscode-go-docker-repo/ci-image
args:
- ci
dir: vscode-go/extension
id: install npm dependencies
entrypoint: npm
- name: us-docker.pkg.dev/$PROJECT_ID/vscode-go-docker-repo/ci-image
args:
- -c
- |
go run -C extension tools/release/release.go package &&
go run -C extension tools/release/release.go publish
dir: vscode-go
id: package and publish the extension
entrypoint: bash
env:
- 'TAG_NAME=$TAG_NAME'
- 'COMMIT_SHA=$COMMIT_SHA'
secretEnv:
- VSCE_PAT
- GITHUB_TOKEN
timeout: 1800s
options:
substitutionOption: ALLOW_LOOSE
artifacts:
objects:
location: 'gs://$PROJECT_ID/releases/$TAG_NAME'
paths:
- vscode-go/extension/*.vsix
availableSecrets:
secretManager:
- versionName: projects/$PROJECT_ID/secrets/$_VSCE_TOKEN/versions/latest
env: VSCE_PAT
- versionName: projects/$PROJECT_ID/secrets/$_GITHUB_TOKEN/versions/latest
env: GITHUB_TOKEN