| # This workflow will be triggered daily. |
| # For local testing, run: |
| # gcloud builds submit --config release-nightly.yaml --no-source |
| # This will check out the vscode-go repo master branch and run the build from it. |
| steps: |
| # TODO: check build/test status |
| - name: gcr.io/cloud-builders/git |
| args: |
| - clone |
| - '--branch=master' |
| - '--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: |
| - build/all.bash |
| - prepare_nightly |
| dir: vscode-go |
| id: prepare nightly release |
| entrypoint: bash |
| - name: us-docker.pkg.dev/$PROJECT_ID/vscode-go-docker-repo/ci-image |
| args: |
| - run |
| - package |
| dir: vscode-go/extension |
| id: build .vsix |
| entrypoint: npm |
| - name: ubuntu |
| args: |
| - '-c' |
| - ls -1 go-nightly-*.vsix | tee /workspace/vsix_name.txt |
| dir: vscode-go/extension |
| id: store the vsix file name |
| entrypoint: bash |
| - name: us-docker.pkg.dev/$PROJECT_ID/vscode-go-docker-repo/ci-image |
| env: |
| - IN_RELEASE_WORKFLOW=true |
| args: |
| - build/all.bash |
| - test_nightly |
| dir: vscode-go |
| id: run tests |
| entrypoint: bash |
| - name: us-docker.pkg.dev/$PROJECT_ID/vscode-go-docker-repo/ci-image |
| args: |
| - '-c' |
| - > |
| npx vsce publish -i $(cat /workspace/vsix_name.txt) -p $$VSCE_PAT |
| --baseContentUrl=https://github.com/golang/vscode-go |
| --baseImagesUrl=https://github.com/golang/vscode-go |
| dir: vscode-go/extension |
| id: publish nightly extension |
| entrypoint: bash |
| secretEnv: |
| - VSCE_PAT |
| timeout: 1800s |
| options: |
| machineType: E2_HIGHCPU_8 |
| substitutionOption: ALLOW_LOOSE |
| artifacts: |
| objects: |
| location: 'gs://$PROJECT_ID/nightly' |
| paths: |
| - vscode-go/extension/*.vsix |
| availableSecrets: |
| secretManager: |
| - versionName: projects/$PROJECT_ID/secrets/$_VSCE_TOKEN/versions/latest |
| env: VSCE_PAT |