Skip to content

Commit 2c09aca

Browse files
committed
github/workflow: daily release workflow
Daily release workflow is triggered everyday between Mon-Thu, 15:00 UTC (11am EDT). This prepares the version string through local modification on package.json and runs the tests again before publishing. The newly released version has the version string computed based on the last git commit's commit timestamp. <Year>.<Month>.<Day>-<Short Commit Hash> That means, if there is no commit since the last release, the publishing step will fail (because the MS VS Code extension market will detect the identical version). Update #5 Change-Id: Ief59f5ed4e89eea66df3607f20263c3f6b75e716 GitHub-Last-Rev: b888148 GitHub-Pull-Request: #10 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/223677 Reviewed-by: Tyler Bui-Palsulich <[email protected]>
1 parent ff99b03 commit 2c09aca

File tree

3 files changed

+109
-2
lines changed

3 files changed

+109
-2
lines changed

.github/workflows/release.yml

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
name: release
2+
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]
11+
12+
env:
13+
GOPATH: /tmp/go
14+
# Because some tests require explicit setting of GOPATH. TODO: FIX THEM.
15+
16+
jobs:
17+
release:
18+
name: Release Nightly
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 20
21+
22+
steps:
23+
- name: Clone repository
24+
uses: actions/checkout@v1
25+
26+
- name: Setup Node
27+
uses: actions/setup-node@v1
28+
with:
29+
node-version: '10.x'
30+
31+
- name: Setup Go
32+
uses: actions/setup-go@v1
33+
with:
34+
go-version: '1.14'
35+
36+
- name: Install dependencies
37+
run: npm ci
38+
39+
- name: Install Go tools (Modules mode)
40+
run: |
41+
go version
42+
go get github.com/acroca/go-symbols \
43+
github.com/davidrjenni/reftools/cmd/fillstruct \
44+
github.com/haya14busa/goplay/cmd/goplay \
45+
github.com/mdempsky/gocode \
46+
github.com/sqs/goreturns \
47+
github.com/uudashr/gopkgs/v2/cmd/gopkgs \
48+
github.com/zmb3/gogetdoc \
49+
golang.org/x/lint/golint \
50+
golang.org/x/tools/cmd/gorename
51+
env:
52+
GO111MODULE: on
53+
54+
- name: Install Go tools (GOPATH mode)
55+
run: |
56+
go version
57+
go get github.com/cweill/gotests/... \
58+
github.com/rogpeppe/godef \
59+
github.com/ramya-rao-a/go-outline
60+
# Because some tests depend on the source code checked in GOPATH. TODO: FIX THEM.
61+
env:
62+
GO111MODULE: off
63+
64+
- name: Prepare Release
65+
run: build/all.bash prepare_nightly
66+
67+
- name: Run unit tests
68+
run: npm run unit-test
69+
continue-on-error: true
70+
71+
- name: Run tests
72+
uses: GabrielBB/[email protected]
73+
with:
74+
run: npm run test
75+
env:
76+
CODE_VERSION: 'insiders'
77+
78+
- name: Publish
79+
if: github.ref == 'refs/heads/master' && github.repository == 'golang/vscode-go'
80+
uses: lannonbr/vsce-action@704da577da0f27de5cdb4ae018374c2f08b5f523
81+
with:
82+
args: "publish -p $VSCE_TOKEN"
83+
env:
84+
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}

build/all.bash

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,26 @@ run_test_in_docker() {
5151
docker run --workdir=/workspace -v "$(pwd):/workspace" vscode-test-env ci
5252
}
5353

54+
prepare_nightly() {
55+
local VER=`git log -1 --format=%cd-%h --date="format:%Y.%-m.%-d"`
56+
echo "**** Preparing nightly release : $VER ***"
57+
58+
# Update package.json
59+
(cat package.json | jq --arg VER "${VER}" '
60+
.version=$VER |
61+
.preview=true |
62+
.name="go-nightly" |
63+
.displayName="Go Nightly" |
64+
.publisher="golang" |
65+
.description="Rich Go language support for Visual Studio Code (Nightly)" |
66+
.author.name="Go Team at Google" |
67+
.repository.url="https://github.com/golang/vscode-go" |
68+
.bugs.url="https://github.com/golang/vscode-go/issues"
69+
') > /tmp/package.json && mv /tmp/package.json package.json
70+
71+
# TODO(hyangah): Update README.md and CHANGELOG.md
72+
}
73+
5474
main() {
5575
cd "$(root_dir)" # always run from the script root.
5676
case "$1" in
@@ -70,9 +90,12 @@ main() {
7090
setup_virtual_display
7191
run_test
7292
;;
93+
"prepare_nightly")
94+
prepare_nightly
95+
;;
7396
*)
7497
usage
7598
exit 2
7699
esac
77100
}
78-
main $@
101+
main $@

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "go-nightly",
33
"displayName": "Go Nightly",
4-
"version": "2020.3.144",
4+
"version": "0.0.0-development",
55
"publisher": "golang",
66
"description": "Rich Go language support for Visual Studio Code (Nightly)",
77
"author": {

0 commit comments

Comments
 (0)