Skip to content

github/workflow: daily release workflow #10

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
84 changes: 84 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
name: release

# 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]

env:
GOPATH: /tmp/go
# Because some tests require explicit setting of GOPATH. TODO: FIX THEM.

jobs:
release:
name: Release Nightly
runs-on: ubuntu-latest
timeout-minutes: 20

steps:
- name: Clone repository
uses: actions/checkout@v1

- 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: Install Go tools (Modules mode)
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
env:
GO111MODULE: on

- 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.
env:
GO111MODULE: off

- name: Prepare Release
run: build/all.bash prepare_nightly

- name: Run unit tests
run: npm run unit-test
continue-on-error: true

- name: Run tests
uses: GabrielBB/[email protected]
with:
run: npm run test
env:
CODE_VERSION: 'insiders'

- name: Publish
if: github.ref == 'refs/heads/master' && github.repository == 'golang/vscode-go'
uses: lannonbr/vsce-action@704da577da0f27de5cdb4ae018374c2f08b5f523
with:
args: "publish -p $VSCE_TOKEN"
env:
VSCE_TOKEN: ${{ secrets.VSCE_TOKEN }}
25 changes: 24 additions & 1 deletion build/all.bash
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,26 @@ run_test_in_docker() {
docker run --workdir=/workspace -v "$(pwd):/workspace" vscode-test-env ci
}

prepare_nightly() {
local VER=`git log -1 --format=%cd-%h --date="format:%Y.%-m.%-d"`
echo "**** Preparing nightly release : $VER ***"

# Update package.json
(cat package.json | jq --arg VER "${VER}" '
.version=$VER |
.preview=true |
.name="go-nightly" |
.displayName="Go Nightly" |
.publisher="golang" |
.description="Rich Go language support for Visual Studio Code (Nightly)" |
.author.name="Go Team at Google" |
.repository.url="https://github.com/golang/vscode-go" |
.bugs.url="https://github.com/golang/vscode-go/issues"
') > /tmp/package.json && mv /tmp/package.json package.json

# TODO(hyangah): Update README.md and CHANGELOG.md
}

main() {
cd "$(root_dir)" # always run from the script root.
case "$1" in
Expand All @@ -70,9 +90,12 @@ main() {
setup_virtual_display
run_test
;;
"prepare_nightly")
prepare_nightly
;;
*)
usage
exit 2
esac
}
main $@
main $@
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "go-nightly",
"displayName": "Go Nightly",
"version": "2020.3.144",
"version": "0.0.0-development",
"publisher": "golang",
"description": "Rich Go language support for Visual Studio Code (Nightly)",
"author": {
Expand Down