-
Notifications
You must be signed in to change notification settings - Fork 728
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[dev.go2go] all: merge origin/master@5c4ab5c
Change-Id: I8d2de06cd35143ec1f28ca53a03581d95abde250 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/241617 Reviewed-by: Rebecca Stambler <rstambler@golang.org> Reviewed-by: Ahmed W. <oneofone@gmail.com>
- Loading branch information
Showing
69 changed files
with
6,639 additions
and
707 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,86 +1,108 @@ | ||
name: release | ||
name: Release (golang.go) | ||
|
||
# The new release workflow is triggered when a new tag on the release | ||
# branch is pushed. | ||
# | ||
# Note: our canonical repository is in go.googlesource.com/vscode-go and tagging | ||
# will be done in the canonical repository, and mirrored to the github repository. | ||
# A typical workflow is: | ||
# | ||
# 1. A human operator creates a CL to merge the main dev branch to the 'release' branch. | ||
# CI (GCB builder) will test the CL. | ||
# 2. The CL is reviewed and merged. This triggers the "Long test workflow" (test-long.yml). | ||
# 3. The human operator verifies the "Long test workflow" is green. | ||
# Otherwise, fix (fix, cherry-pick, review, commit) on the 'release' branch. | ||
# 4. When the 'release' branch reaches to the state ready for the release, | ||
# the human operator will tag the commig from the canonical repository. | ||
# (https://go-review.googlesource.com/admin/repos/vscode-go,tags) | ||
# Stable versions should be in the format of 'vX.X.X' (e.g. v0.15.0) | ||
# Release candidates should be in the format of 'vX.X.X-rc.X' (e.g. v0.15.0-rc.1) | ||
# 5. The gopherbot will mirror the tag to the GitHub repo, and that push will trigger | ||
# the 'Release (golang.go)' workflow specified in this file. | ||
# - For stable version release (vX.X.X), check if the package.json has the matching version. | ||
# - Packaging using 'vsce package' | ||
# - Create a release in GitHub | ||
# - Upload the vsix file as an asset of the release | ||
# - For stable version release (vX.X.X), upload to the vscode market place | ||
|
||
# Daily release on 15:00 UTC, monday-thursday. | ||
# Or, force to release by triggering repository_dispatch events by using | ||
# curl -v -H "Accept: application/vnd.github.everest-preview+json" -H "Authorization: token ${GITHUB_TOKEN}" https://api.github.com/repos/golang/vscode-go/dispatches -d '{ "event_type": "force-release" }' | ||
on: | ||
schedule: | ||
- cron: "0 15 * * MON-THU" # 15 UTC, monday-thursday daily | ||
repository_dispatch: | ||
types: [force-release] | ||
push: | ||
tags: | ||
- v* | ||
|
||
jobs: | ||
release: | ||
name: Release Nightly | ||
name: create release | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 20 | ||
if: github.repository == 'golang/vscode-go' | ||
|
||
steps: | ||
- name: Clone repository | ||
- name: checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '10.x' | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: '1.14' | ||
- name: get release version | ||
id: release_version | ||
run: | | ||
TAGGED_VERSION="${GITHUB_REF/refs\/tags\/v/}" | ||
- name: Install dependencies | ||
run: npm ci | ||
if [[ ! "${TAGGED_VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then | ||
echo "Invalid version tag '${TAGGED_VERSION}'" | ||
exit 1 | ||
fi | ||
- name: Prepare Release | ||
run: build/all.bash prepare_nightly | ||
echo ::set-env name=EXT_VERSION::"${TAGGED_VERSION}" | ||
WRITTEN_VERSION="$(cat package.json | jq '.version' -r)" | ||
- name: Compile | ||
run: npm run vscode:prepublish | ||
if [[ ${TAGGED_VERSION} == *"-"* ]]; then | ||
echo ::set-env name=EXT_ISPREVIEW::1 | ||
else | ||
if [[ "${TAGGED_VERSION}" != "${WRITTEN_VERSION}" ]]; then | ||
echo "Release Tag and Version in package.json do not match: '${TAGGED_VERSION}' vs '${WRITTEN_VERSION}'" | ||
exit 1 | ||
fi | ||
echo ::set-env name=EXT_ISPREVIEW::0 | ||
fi | ||
- name: Install Go tools (Modules mode) | ||
- name: stamp version | ||
run: | | ||
go version | ||
go get github.com/acroca/go-symbols \ | ||
github.com/davidrjenni/reftools/cmd/fillstruct \ | ||
github.com/haya14busa/goplay/cmd/goplay \ | ||
github.com/mdempsky/gocode \ | ||
github.com/sqs/goreturns \ | ||
github.com/uudashr/gopkgs/v2/cmd/gopkgs \ | ||
github.com/zmb3/gogetdoc \ | ||
golang.org/x/lint/golint \ | ||
golang.org/x/tools/cmd/gorename \ | ||
golang.org/x/tools/gopls | ||
cat package.json | jq --arg VER "${{ env.EXT_VERSION }}" '.version=$VER' > /tmp/package.json | ||
cp /tmp/package.json ./package.json | ||
npm ci | ||
npm run vscode:prepublish | ||
env: | ||
GO111MODULE: on | ||
- name: package | ||
uses: lannonbr/vsce-action@704da577da0f27de5cdb4ae018374c2f08b5f523 | ||
with: | ||
args: "package" | ||
|
||
- name: Install Go tools (GOPATH mode) | ||
run: | | ||
go version | ||
go get github.com/cweill/gotests/... \ | ||
github.com/rogpeppe/godef \ | ||
github.com/ramya-rao-a/go-outline | ||
# Because some tests depend on the source code checked in GOPATH. TODO: FIX THEM. | ||
- name: create release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GO111MODULE: off | ||
|
||
|
||
- name: Run unit tests | ||
run: npm run unit-test | ||
continue-on-error: true | ||
|
||
- name: Run tests | ||
uses: GabrielBB/xvfb-action@v1.0 | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
run: npm run test | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ env.EXT_VERSION }} | ||
draft: false | ||
prerelease: ${{env.EXT_ISPREVIEW == 1}} | ||
|
||
- name: upload release asset | ||
uses: actions/upload-release-asset@v1 | ||
env: | ||
CODE_VERSION: 'insiders' | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
upload_url: ${{ steps.create_release.outputs.upload_url }} | ||
asset_path: ./go-${{ env.EXT_VERSION }}.vsix | ||
asset_name: go-${{ env.EXT_VERSION }}.vsix | ||
asset_content_type: application/zip | ||
|
||
- name: Publish | ||
if: github.ref == 'refs/heads/master' && github.repository == 'golang/vscode-go' | ||
- name: publish | ||
if: env.EXT_ISPREVIEW != 1 && github.repository == 'golang/vscode-go' | ||
uses: lannonbr/vsce-action@704da577da0f27de5cdb4ae018374c2f08b5f523 | ||
with: | ||
args: "publish -p $VSCE_TOKEN" | ||
env: | ||
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }} | ||
|
||
# TODO: check if the commit is in green state. (test-long.yml results) | ||
# TODO: after publishing, create a gerrit CL to update 'latest' branch if VERSION is for a stable version. |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
name: Long Tests | ||
|
||
on: | ||
push: | ||
branches-ignore: | ||
- 'latest' | ||
- 'upstream' | ||
|
||
jobs: | ||
build: | ||
name: ${{ matrix.os }} ${{ matrix.version }} | ||
runs-on: ${{ matrix.os }} | ||
|
||
# Not containing 'SKIP CI' in the commit message AND | ||
# (Either non-Windows OR triggered on 'push' (if triggered by 'pull_request', github.base_ref is not empty) | ||
if: github.repository == 'golang/vscode-go' && !contains(github.event.head_commit.message, 'SKIP CI') | ||
timeout-minutes: 20 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
version: ['stable'] | ||
|
||
steps: | ||
- name: Clone repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup Node | ||
uses: actions/setup-node@v1 | ||
with: | ||
node-version: '10.x' | ||
|
||
- name: Setup Go | ||
uses: actions/setup-go@v1 | ||
with: | ||
go-version: '1.14' | ||
|
||
- name: Install dependencies | ||
run: npm ci | ||
|
||
- name: Compile | ||
run: npm run vscode:prepublish | ||
|
||
- name: Install Go tools (Modules mode) | ||
run: | | ||
go version | ||
go get github.com/acroca/go-symbols | ||
go get github.com/davidrjenni/reftools/cmd/fillstruct | ||
go get github.com/haya14busa/goplay/cmd/goplay | ||
go get github.com/mdempsky/gocode | ||
go get github.com/sqs/goreturns | ||
go get github.com/uudashr/gopkgs/v2/cmd/gopkgs | ||
go get github.com/zmb3/gogetdoc | ||
go get golang.org/x/lint/golint | ||
go get golang.org/x/tools/cmd/gorename | ||
go get golang.org/x/tools/gopls | ||
env: | ||
GO111MODULE: on | ||
|
||
- name: Install Go tools (GOPATH mode) | ||
run: | | ||
go version | ||
go get github.com/cweill/gotests/... | ||
go get github.com/rogpeppe/godef | ||
go get github.com/ramya-rao-a/go-outline | ||
# Because some tests depend on the source code checked in GOPATH. TODO: FIX THEM. | ||
env: | ||
GO111MODULE: off | ||
|
||
- name: Run unit tests | ||
run: npm run unit-test | ||
|
||
- name: Run tests | ||
uses: GabrielBB/xvfb-action@v1.0 | ||
with: | ||
run: npm run test | ||
env: | ||
CODE_VERSION: ${{ matrix.version }} | ||
|
||
- name: Lint check | ||
run: npm run lint | ||
if: ${{ matrix.os }} == 'ubuntu-latest' |
Oops, something went wrong.