Skip to content

Commit a395ae2

Browse files
authored
Configure CI to release on tag push. (#22)
Configure CI to release on tag push.
2 parents 5d244c3 + f302051 commit a395ae2

File tree

8 files changed

+551
-56
lines changed

8 files changed

+551
-56
lines changed

.travis.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
language: node_js
2+
node_js:
3+
- "lts/*"
4+
5+
stages:
6+
- name: build
7+
- name: release
8+
if: tag IS present
9+
10+
jobs:
11+
include:
12+
- stage: build
13+
script: yarn build
14+
- stage: release
15+
script: bin/ci-release.sh
16+
17+
cache: yarn

CHANGELOG.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
## VSCode Extension Changelog
2+
3+
### upcoming (2019/05/02 12:14 +00:00)
4+
- [c9a4a36](https://github.com/scala/vscode-scala-syntax/commit/c9a4a36253af5dd78dfecfa19c81fcac3f023674) Add pre-package check. Add proper build script. Updated .vscodeignore. Updated README. (@PanAeon)
5+
- [f3aca62](https://github.com/scala/vscode-scala-syntax/commit/f3aca62801a0c3fa3faa24c30ad01bd9783e5634) Convert syntax file to Typescript, add utils to work with ts file, update docs (@PanAeon)
6+
- [ebe1ad0](https://github.com/scala/vscode-scala-syntax/commit/ebe1ad0d9a6a2535aa3d1049c820a250d697da39) Add auto-closing pair for string interpolation (@hugo-vrijswijk)
7+
- [2e5e24a](https://github.com/scala/vscode-scala-syntax/commit/2e5e24a61be430abf11eb4e3a4a5a65b7b8edd64) Fix case class/object highlighting (@Hydrotoast)
8+
- [4ad7830](https://github.com/scala/vscode-scala-syntax/commit/4ad7830d41cd172ac2ef5a10a422fab8b8942230) Update publish info (@nicolasstucki)
9+
- [71fc3fd](https://github.com/scala/vscode-scala-syntax/commit/71fc3fdd3bdcb93e9ebb856845f1e391df070153) Add scala syntax as snippet requirement (@gabro)
10+
- [d275c5f](https://github.com/scala/vscode-scala-syntax/commit/d275c5f824c2184d1c52cd0bc0679f5d2788bfef) Split syntax and snippets (@gabro)
11+
- [78ebbbe](https://github.com/scala/vscode-scala-syntax/commit/78ebbbe72f9f054ea7f6cb6d08100e90bd7c93ce) Enable extension on `.sc` files (@Duhemm)
12+
- [19a2051](https://github.com/scala/vscode-scala-syntax/commit/19a2051e58d88b9bf320b9343746d547f8b9648a) Publish as scala-lang (@nicolasstucki)
13+
- [829b8eb](https://github.com/scala/vscode-scala-syntax/commit/829b8ebbce658271d0421f58e9ee9f23e8f52a8a) Update version (@nicolasstucki)
14+
- [aef901c](https://github.com/scala/vscode-scala-syntax/commit/aef901c015c994982294b511c6a83638edebfcfe) Update syntax (@nicolasstucki)
15+
- [a68e1ad](https://github.com/scala/vscode-scala-syntax/commit/a68e1ad10be00f648eaa86b789884a358c30f3ab) Update version (@nicolasstucki)
16+
- [e53ddad](https://github.com/scala/vscode-scala-syntax/commit/e53ddad3fa57e26516713d55937871e0b5af0afc) Add snippets (@nicolasstucki)
17+
- [64aa83c](https://github.com/scala/vscode-scala-syntax/commit/64aa83c48622a50208ca4a3eeadec6b636469c36) Add references (@nicolasstucki)
18+
- [49ec358](https://github.com/scala/vscode-scala-syntax/commit/49ec3584a2658209c24fa74a9da19d26a7b833ed) Update to 0.1.3 (@nicolasstucki)
19+
- [ea80cb7](https://github.com/scala/vscode-scala-syntax/commit/ea80cb74ed611eed3b206316c5946f5ef9259904) Add some keywords (@nicolasstucki)
20+
- [fa7fea7](https://github.com/scala/vscode-scala-syntax/commit/fa7fea79764cd295cbc25005bd5decbe954c9a59) Remove some snippets to keep options simple (@nicolasstucki)
21+
- [27a8e69](https://github.com/scala/vscode-scala-syntax/commit/27a8e6939df0655e8e8f6ac99f1ce68efd549080) Update to 0.1.2 (@nicolasstucki)
22+
- [63e4585](https://github.com/scala/vscode-scala-syntax/commit/63e45856f0f2a78f87813235cfa4e12d18a08bce) Add some basic code snippets (@nicolasstucki)
23+
- [3ff361f](https://github.com/scala/vscode-scala-syntax/commit/3ff361f2cbb91fdca1ed90ff0928e67c1ab12b67) Update version to 0.1.1 (@nicolasstucki)
24+
- [4821223](https://github.com/scala/vscode-scala-syntax/commit/48212238d9891908a0b0e5461e5acc6d53db3d4d) Fix closing brackets not being identified (@nicolasstucki)
25+
- [b1d10d6](https://github.com/scala/vscode-scala-syntax/commit/b1d10d6267abe21fd8423411323b903ce5b74ff1) Add debbug launcher (@nicolasstucki)
26+
- [a19c6c4](https://github.com/scala/vscode-scala-syntax/commit/a19c6c4b8b27f39276b1eef8c7ee2185e60d987e) Update version and publisher (@nicolasstucki)
27+
- [1d9c36e](https://github.com/scala/vscode-scala-syntax/commit/1d9c36e747d3103930112895887f888bb189e8d2) Fix #1: Publish in market place (@nicolasstucki)
28+
- [a95cf09](https://github.com/scala/vscode-scala-syntax/commit/a95cf090518e50db7c825c5baa1247afd6909383) Remove old ported comments (@nicolasstucki)
29+
- [db11ec3](https://github.com/scala/vscode-scala-syntax/commit/db11ec3eb423751bd253dc6cac3dcd7adf61a410) Fix expression and type quotes (@nicolasstucki)
30+
- [5518b86](https://github.com/scala/vscode-scala-syntax/commit/5518b86e30bf6e39dc60fb33950e7d74995115a3) Initial commit (@nicolasstucki)

CONTRIBUTING.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Contributing
2+
3+
This document explains the developer workflow for making changes to the
4+
[Scala Syntax (official) extension](https://marketplace.visualstudio.com/items?itemName=scala-lang.scala)
5+
for Visual Studio Code.
6+
7+
## Prerequisites
8+
9+
Make sure you have the following binaries installed:
10+
11+
- [`yarn`](https://yarnpkg.com/en/): to build the project
12+
- [`vsce`](https://code.visualstudio.com/api/working-with-extensions/publishing-extension):
13+
to package the extension for VS Code.
14+
- [`code`](https://code.visualstudio.com/docs/setup/mac): to launch VS Code from
15+
the terminal.
16+
17+
## Building the project
18+
19+
First, install library dependencies. This step needs to re-run every time a new
20+
dependency is added to `package.json`.
21+
22+
```bash
23+
yarn install
24+
```
25+
26+
Next, open the source language file `src/typescript/Scala.tmlanguage.ts` to make
27+
changes to the code. To generate the the syntax definition file
28+
`syntaxes/Scala.tmLanguage.json` with your local changes, run the following
29+
command:
30+
31+
```bash
32+
yarn build
33+
```
34+
35+
The output tmLanguage file `syntaxes/Scala.tmLanguage.json` is marked as ignored
36+
in git and shouldn't be commited into the repository. The output file is
37+
validated against the json schema before being written.
38+
39+
## Installing the extension locally
40+
41+
Run the following commands to globally install this extension with your local
42+
changes.
43+
44+
```bash
45+
yarn install
46+
yarn build
47+
vsce package
48+
# replace `*` below with the version of the generated vsix file
49+
code --install-extension scala-*.vsix
50+
```

README.md

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,21 @@
1-
# Scala Syntax
1+
# Scala Syntax (official)
22

3-
[VS Code plugin](https://marketplace.visualstudio.com/items?itemName=scala-lang.scala)
3+
[![Install extension](https://img.shields.io/badge/scala-vscode-blue.png)](vscode:extension/scala-lang.scala)
4+
[![Version](https://img.shields.io/github/package-json/v/scala/vscode-scala-syntax.svg)](https://marketplace.visualstudio.com/items?itemName=scala-lang.scala)
45

5-
## Features
6-
7-
Extension providing Scala syntax.
8-
9-
## Requirements
10-
11-
No requirements.
12-
13-
## Development
14-
15-
The source language file is located at `src/typescript/Scala.tmlanguage.ts`. The output tmLanguage file `syntaxes/Scala.tmLanguage.json` is marked as ignored in git and shouldn't be commited.
16-
17-
To generate the ouput file either use build command or run:
18-
19-
```bash
20-
npm install
21-
```
22-
23-
The output file is validated against the json schema before being written.
6+
Visual Studio Code extension providing syntax highlighting for Scala source
7+
files.
248

9+
![Syntax Highlighting Demo](https://i.imgur.com/TDx0mC3.png)
2510

2611
## Based on
27-
* Plugin: https://github.com/daltonjorge/vscode-scala
28-
* Template: https://github.com/sellmerfud/scala.tmbundle (https://github.com/mads-hartmann/scala.tmbundle)
29-
* Textmate json schema: https://github.com/Septh/tmlanguage/blob/master/tmLanguage.schema.json
12+
13+
- Plugin: https://github.com/daltonjorge/vscode-scala
14+
- Template: https://github.com/sellmerfud/scala.tmbundle
15+
(https://github.com/mads-hartmann/scala.tmbundle)
16+
- Textmate JSON schema:
17+
https://github.com/Septh/tmlanguage/blob/master/tmLanguage.schema.json
3018

3119
## License
32-
[MIT](LICENSE)
3320

34-
-----------------------------------------------------------------------------------------------------------
21+
[MIT](LICENSE.md)

bin/ci-release.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/usr/bin/env bash
2+
set -eu
3+
4+
DEPLOY_KEY=${GITHUB_DEPLOY_KEY:-}
5+
NEW_VERSION=${TRAVIS_TAG#"v"}
6+
7+
# Build the extension
8+
yarn install
9+
yarn build
10+
11+
# Update package.json and CHANGELOG.md
12+
set-up-ssh() {
13+
echo "Setting up ssh..."
14+
mkdir -p $HOME/.ssh
15+
ssh-keyscan -t rsa github.com >> ~/.ssh/known_hosts
16+
git config --global user.name "Scala bot"
17+
git config --global user.email "$TRAVIS_BUILD_NUMBER@$TRAVIS_COMMIT"
18+
git config --global push.default simple
19+
DEPLOY_KEY_FILE=$HOME/.ssh/id_rsa
20+
echo "$GITHUB_DEPLOY_KEY" | base64 --decode > ${DEPLOY_KEY_FILE}
21+
chmod 600 ${DEPLOY_KEY_FILE}
22+
eval "$(ssh-agent -s)"
23+
ssh-add ${DEPLOY_KEY_FILE}
24+
}
25+
if [[ -n "$DEPLOY_KEY" ]]; then
26+
set-up-ssh
27+
fi
28+
git checkout -b travis-temp
29+
yarn version --no-git-tag-version --new-version $NEW_VERSION
30+
yarn github-changes -o scala -r vscode-scala-syntax --no-merges -t "Scala Syntax (official) Changelog" -k $GITHUB_TOKEN
31+
git commit -am "Update release notes for $TRAVIS_TAG"
32+
git push origin HEAD:master
33+
34+
# Publish to VS Code Marketplace
35+
yarn vscode:publish -p $VS_MARKETPLACE_TOKEN

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,13 @@
4444
"devDependencies": {
4545
"@types/node": "^11.11.4",
4646
"ajv": "^6.10.0",
47-
"ts-node": "^8.0.2",
47+
"github-changes": "^1.1.2",
48+
"ts-node": "^8.1.0",
4849
"tsc": "^1.20150623.0",
4950
"typescript": "^3.3.3"
5051
},
5152
"scripts": {
5253
"vscode:prepublish": "test -f ./syntaxes/Scala.tmLanguage.json",
53-
"prepare": "npx ts-node src/typescript/GenerateTmLanguageFile.ts > ./syntaxes/Scala.tmLanguage.json"
54+
"build": "ts-node src/typescript/GenerateTmLanguageFile.ts > ./syntaxes/Scala.tmLanguage.json"
5455
}
5556
}

vsc-extension-quickstart.md

Lines changed: 0 additions & 27 deletions
This file was deleted.

0 commit comments

Comments
 (0)