Skip to content

Commit df2939a

Browse files
committed
[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 <[email protected]> Reviewed-by: Ahmed W. <[email protected]>
1 parent 38e85e5 commit df2939a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+6639
-707
lines changed

.github/workflows/codeql-analysis.yml

Lines changed: 0 additions & 41 deletions
This file was deleted.
Lines changed: 32 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,21 @@
1-
name: build
1+
name: Release (golang.go-nightly)
22

3-
on: [push, pull_request]
3+
# Daily release on 15:00 UTC, monday-thursday.
4+
# Or, force to release by triggering repository_dispatch events by using
5+
# 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" }'
6+
on:
7+
schedule:
8+
- cron: "0 15 * * MON-THU" # 15 UTC, monday-thursday daily
9+
repository_dispatch:
10+
types: [force-release]
411

512
jobs:
6-
build:
7-
name: ${{ matrix.os }} ${{ matrix.version }}
8-
runs-on: ${{ matrix.os }}
9-
10-
if: "!contains(github.event.head_commit.message, 'SKIP CI')"
13+
release:
14+
if: github.ref == 'refs/heads/master' && github.repository == 'golang/vscode-go'
15+
16+
name: Release Nightly
17+
runs-on: ubuntu-latest
1118
timeout-minutes: 20
12-
strategy:
13-
fail-fast: false
14-
matrix:
15-
os: [ubuntu-latest]
16-
version: ['stable']
1719

1820
steps:
1921
- name: Clone repository
@@ -31,7 +33,10 @@ jobs:
3133

3234
- name: Install dependencies
3335
run: npm ci
34-
36+
37+
- name: Prepare Release
38+
run: build/all.bash prepare_nightly
39+
3540
- name: Compile
3641
run: npm run vscode:prepublish
3742

@@ -48,9 +53,10 @@ jobs:
4853
golang.org/x/lint/golint \
4954
golang.org/x/tools/cmd/gorename \
5055
golang.org/x/tools/gopls
56+
5157
env:
52-
GO111MODULE: on
53-
58+
GO111MODULE: on
59+
5460
- name: Install Go tools (GOPATH mode)
5561
run: |
5662
go version
@@ -60,34 +66,23 @@ jobs:
6066
# Because some tests depend on the source code checked in GOPATH. TODO: FIX THEM.
6167
env:
6268
GO111MODULE: off
63-
69+
70+
6471
- name: Run unit tests
6572
run: npm run unit-test
66-
continue-on-error: true
67-
73+
6874
- name: Run tests
6975
uses: GabrielBB/[email protected]
7076
with:
7177
run: npm run test
7278
env:
73-
CODE_VERSION: ${{ matrix.version }}
74-
75-
eslint:
76-
runs-on: ubuntu-latest
77-
if: "!contains(github.event.head_commit.message, 'SKIP CI')"
79+
CODE_VERSION: 'insiders'
80+
VSCODEGO_BEFORE_RELEASE_TESTS: true
7881

79-
steps:
80-
- name: Clone repository
81-
uses: actions/checkout@v1
82-
83-
- name: Setup Node
84-
uses: actions/setup-node@v1
82+
- name: Publish
83+
if: github.ref == 'refs/heads/master' && github.repository == 'golang/vscode-go'
84+
uses: lannonbr/vsce-action@704da577da0f27de5cdb4ae018374c2f08b5f523
8585
with:
86-
node-version: '10.x'
87-
88-
- name: Install Dependencies
89-
run: 'npm ci'
90-
shell: bash
91-
92-
- name: Lint check
93-
run: npm run lint
86+
args: "publish -p $VSCE_TOKEN"
87+
env:
88+
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}

.github/workflows/release.yml

Lines changed: 82 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -1,86 +1,108 @@
1-
name: release
1+
name: Release (golang.go)
2+
3+
# The new release workflow is triggered when a new tag on the release
4+
# branch is pushed.
5+
#
6+
# Note: our canonical repository is in go.googlesource.com/vscode-go and tagging
7+
# will be done in the canonical repository, and mirrored to the github repository.
8+
# A typical workflow is:
9+
#
10+
# 1. A human operator creates a CL to merge the main dev branch to the 'release' branch.
11+
# CI (GCB builder) will test the CL.
12+
# 2. The CL is reviewed and merged. This triggers the "Long test workflow" (test-long.yml).
13+
# 3. The human operator verifies the "Long test workflow" is green.
14+
# Otherwise, fix (fix, cherry-pick, review, commit) on the 'release' branch.
15+
# 4. When the 'release' branch reaches to the state ready for the release,
16+
# the human operator will tag the commig from the canonical repository.
17+
# (https://go-review.googlesource.com/admin/repos/vscode-go,tags)
18+
# Stable versions should be in the format of 'vX.X.X' (e.g. v0.15.0)
19+
# Release candidates should be in the format of 'vX.X.X-rc.X' (e.g. v0.15.0-rc.1)
20+
# 5. The gopherbot will mirror the tag to the GitHub repo, and that push will trigger
21+
# the 'Release (golang.go)' workflow specified in this file.
22+
# - For stable version release (vX.X.X), check if the package.json has the matching version.
23+
# - Packaging using 'vsce package'
24+
# - Create a release in GitHub
25+
# - Upload the vsix file as an asset of the release
26+
# - For stable version release (vX.X.X), upload to the vscode market place
227

3-
# Daily release on 15:00 UTC, monday-thursday.
4-
# Or, force to release by triggering repository_dispatch events by using
5-
# 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" }'
628
on:
7-
schedule:
8-
- cron: "0 15 * * MON-THU" # 15 UTC, monday-thursday daily
9-
repository_dispatch:
10-
types: [force-release]
29+
push:
30+
tags:
31+
- v*
1132

1233
jobs:
1334
release:
14-
name: Release Nightly
35+
name: create release
1536
runs-on: ubuntu-latest
16-
timeout-minutes: 20
37+
if: github.repository == 'golang/vscode-go'
1738

1839
steps:
19-
- name: Clone repository
40+
- name: checkout code
2041
uses: actions/checkout@v2
2142

22-
- name: Setup Node
23-
uses: actions/setup-node@v1
24-
with:
25-
node-version: '10.x'
26-
27-
- name: Setup Go
28-
uses: actions/setup-go@v1
29-
with:
30-
go-version: '1.14'
43+
- name: get release version
44+
id: release_version
45+
run: |
46+
TAGGED_VERSION="${GITHUB_REF/refs\/tags\/v/}"
3147
32-
- name: Install dependencies
33-
run: npm ci
48+
if [[ ! "${TAGGED_VERSION}" =~ ^[0-9]+\.[0-9]+\.[0-9]+.*$ ]]; then
49+
echo "Invalid version tag '${TAGGED_VERSION}'"
50+
exit 1
51+
fi
3452
35-
- name: Prepare Release
36-
run: build/all.bash prepare_nightly
53+
echo ::set-env name=EXT_VERSION::"${TAGGED_VERSION}"
54+
WRITTEN_VERSION="$(cat package.json | jq '.version' -r)"
3755
38-
- name: Compile
39-
run: npm run vscode:prepublish
56+
if [[ ${TAGGED_VERSION} == *"-"* ]]; then
57+
echo ::set-env name=EXT_ISPREVIEW::1
58+
else
59+
if [[ "${TAGGED_VERSION}" != "${WRITTEN_VERSION}" ]]; then
60+
echo "Release Tag and Version in package.json do not match: '${TAGGED_VERSION}' vs '${WRITTEN_VERSION}'"
61+
exit 1
62+
fi
63+
echo ::set-env name=EXT_ISPREVIEW::0
64+
fi
4065
41-
- name: Install Go tools (Modules mode)
66+
- name: stamp version
4267
run: |
43-
go version
44-
go get github.com/acroca/go-symbols \
45-
github.com/davidrjenni/reftools/cmd/fillstruct \
46-
github.com/haya14busa/goplay/cmd/goplay \
47-
github.com/mdempsky/gocode \
48-
github.com/sqs/goreturns \
49-
github.com/uudashr/gopkgs/v2/cmd/gopkgs \
50-
github.com/zmb3/gogetdoc \
51-
golang.org/x/lint/golint \
52-
golang.org/x/tools/cmd/gorename \
53-
golang.org/x/tools/gopls
68+
cat package.json | jq --arg VER "${{ env.EXT_VERSION }}" '.version=$VER' > /tmp/package.json
69+
cp /tmp/package.json ./package.json
70+
npm ci
71+
npm run vscode:prepublish
5472
55-
env:
56-
GO111MODULE: on
73+
- name: package
74+
uses: lannonbr/vsce-action@704da577da0f27de5cdb4ae018374c2f08b5f523
75+
with:
76+
args: "package"
5777

58-
- name: Install Go tools (GOPATH mode)
59-
run: |
60-
go version
61-
go get github.com/cweill/gotests/... \
62-
github.com/rogpeppe/godef \
63-
github.com/ramya-rao-a/go-outline
64-
# Because some tests depend on the source code checked in GOPATH. TODO: FIX THEM.
78+
- name: create release
79+
id: create_release
80+
uses: actions/create-release@v1
6581
env:
66-
GO111MODULE: off
67-
68-
69-
- name: Run unit tests
70-
run: npm run unit-test
71-
continue-on-error: true
72-
73-
- name: Run tests
74-
uses: GabrielBB/[email protected]
82+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
7583
with:
76-
run: npm run test
84+
tag_name: ${{ github.ref }}
85+
release_name: Release ${{ env.EXT_VERSION }}
86+
draft: false
87+
prerelease: ${{env.EXT_ISPREVIEW == 1}}
88+
89+
- name: upload release asset
90+
uses: actions/upload-release-asset@v1
7791
env:
78-
CODE_VERSION: 'insiders'
92+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
93+
with:
94+
upload_url: ${{ steps.create_release.outputs.upload_url }}
95+
asset_path: ./go-${{ env.EXT_VERSION }}.vsix
96+
asset_name: go-${{ env.EXT_VERSION }}.vsix
97+
asset_content_type: application/zip
7998

80-
- name: Publish
81-
if: github.ref == 'refs/heads/master' && github.repository == 'golang/vscode-go'
99+
- name: publish
100+
if: env.EXT_ISPREVIEW != 1 && github.repository == 'golang/vscode-go'
82101
uses: lannonbr/vsce-action@704da577da0f27de5cdb4ae018374c2f08b5f523
83102
with:
84103
args: "publish -p $VSCE_TOKEN"
85104
env:
86105
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}
106+
107+
# TODO: check if the commit is in green state. (test-long.yml results)
108+
# TODO: after publishing, create a gerrit CL to update 'latest' branch if VERSION is for a stable version.

.github/workflows/test-long.yml

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
name: Long Tests
2+
3+
on:
4+
push:
5+
branches-ignore:
6+
- 'latest'
7+
- 'upstream'
8+
9+
jobs:
10+
build:
11+
name: ${{ matrix.os }} ${{ matrix.version }}
12+
runs-on: ${{ matrix.os }}
13+
14+
# Not containing 'SKIP CI' in the commit message AND
15+
# (Either non-Windows OR triggered on 'push' (if triggered by 'pull_request', github.base_ref is not empty)
16+
if: github.repository == 'golang/vscode-go' && !contains(github.event.head_commit.message, 'SKIP CI')
17+
timeout-minutes: 20
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
os: [ubuntu-latest, windows-latest, macos-latest]
22+
version: ['stable']
23+
24+
steps:
25+
- name: Clone repository
26+
uses: actions/checkout@v2
27+
28+
- name: Setup Node
29+
uses: actions/setup-node@v1
30+
with:
31+
node-version: '10.x'
32+
33+
- name: Setup Go
34+
uses: actions/setup-go@v1
35+
with:
36+
go-version: '1.14'
37+
38+
- name: Install dependencies
39+
run: npm ci
40+
41+
- name: Compile
42+
run: npm run vscode:prepublish
43+
44+
- name: Install Go tools (Modules mode)
45+
run: |
46+
go version
47+
go get github.com/acroca/go-symbols
48+
go get github.com/davidrjenni/reftools/cmd/fillstruct
49+
go get github.com/haya14busa/goplay/cmd/goplay
50+
go get github.com/mdempsky/gocode
51+
go get github.com/sqs/goreturns
52+
go get github.com/uudashr/gopkgs/v2/cmd/gopkgs
53+
go get github.com/zmb3/gogetdoc
54+
go get golang.org/x/lint/golint
55+
go get golang.org/x/tools/cmd/gorename
56+
go get golang.org/x/tools/gopls
57+
env:
58+
GO111MODULE: on
59+
60+
- name: Install Go tools (GOPATH mode)
61+
run: |
62+
go version
63+
go get github.com/cweill/gotests/...
64+
go get github.com/rogpeppe/godef
65+
go get github.com/ramya-rao-a/go-outline
66+
# Because some tests depend on the source code checked in GOPATH. TODO: FIX THEM.
67+
env:
68+
GO111MODULE: off
69+
70+
- name: Run unit tests
71+
run: npm run unit-test
72+
73+
- name: Run tests
74+
uses: GabrielBB/[email protected]
75+
with:
76+
run: npm run test
77+
env:
78+
CODE_VERSION: ${{ matrix.version }}
79+
80+
- name: Lint check
81+
run: npm run lint
82+
if: ${{ matrix.os }} == 'ubuntu-latest'

0 commit comments

Comments
 (0)