Skip to content

Commit 9057516

Browse files
committed
Migrate deployments to GitHub Actions
1 parent 0352d72 commit 9057516

File tree

5 files changed

+73
-68
lines changed

5 files changed

+73
-68
lines changed

.github/workflows/continuous-integration.yml

+8-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
name: continuous-integration
22

3-
on: [push, pull_request]
3+
# Only run for pushes to a branch, not to a tag
4+
on:
5+
push:
6+
branches:
7+
- '*'
8+
pull_request:
9+
branches:
10+
- '*'
411

512
jobs:
613
build-and-test:
@@ -16,4 +23,3 @@ jobs:
1623
- run: yarn
1724
- run: yarn build
1825
- run: yarn test
19-

.github/workflows/deploy.yml

+65
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: deploy
2+
3+
on:
4+
push:
5+
tags:
6+
- '*.*.*'
7+
8+
env:
9+
OWNER: scala
10+
REPOSITORY: vscode-scala-syntax
11+
RELEASE_BRANCH: master
12+
13+
jobs:
14+
deploy:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: actions/setup-node@v1
19+
- name: Cache Node.js modules
20+
uses: actions/cache@v2
21+
with:
22+
path: "**/node_modules"
23+
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
24+
- run: yarn
25+
26+
- name: Update package.json version
27+
run: yarn version --no-git-tag-version --new-version ${GITHUB_REF#refs/*/}
28+
- name: Generate CHANGELOG.md
29+
run: npx github-changes --owner $OWNER --repository $REPOSITORY --branch $RELEASE_BRANCH --no-merges --title "Scala Syntax (official) Changelog"
30+
- run: yarn build
31+
- run: yarn test
32+
- name: Commit generated files
33+
run: |
34+
git config --global user.name "Scala bot"
35+
git config --global user.email "$GITHUB_RUN_NUMBER@$GITHUB_SHA"
36+
git commit -am "Release ${GITHUB_REF#refs/*/}"
37+
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
38+
git push origin HEAD:$RELEASE_BRANCH
39+
40+
- name: Release extension
41+
run: yarn vscode:publish --pat ${{ secrets.VS_MARKETPLACE_TOKEN }}
42+
43+
- name: Generate GitHub Release notes
44+
run: npx github-changes --owner $OWNER --repository $REPOSITORY --branch $RELEASE_BRANCH --no-merges --title "Changelog" --for-tag ${GITHUB_REF#refs/*/} --file release-notes.md
45+
- name: Create GitHub Release
46+
id: create-release
47+
uses: actions/create-release@v1
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
with:
51+
tag_name: ${{ github.ref }}
52+
release_name: Release ${{ github.ref }}
53+
body_path: release-notes.md
54+
draft: false
55+
prerelease: false
56+
- run: mv scala-*.vsix scala.vsix
57+
- name: Upload Release Asset
58+
uses: actions/upload-release-asset@v1
59+
env:
60+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
61+
with:
62+
upload_url: ${{ steps.create-release.outputs.upload_url }}
63+
asset_path: ./scala.vsix
64+
asset_name: scala.vsix
65+
asset_content_type: application/zip

.travis.yml

-27
This file was deleted.

README.md

-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
[![Install extension](https://img.shields.io/badge/scala-vscode-blue.png)](vscode:extension/scala-lang.scala)
44
[![Version](https://img.shields.io/github/package-json/v/scala/vscode-scala-syntax.svg)](https://marketplace.visualstudio.com/items?itemName=scala-lang.scala)
5-
[![Travis Build Status](https://travis-ci.org/scala/vscode-scala-syntax.svg?branch=master)](//travis-ci.org/scala/vscode-scala-syntax)
65
![GitHub Actions Build Status](https://github.com/scala/vscode-scala-syntax/workflows/continuous-integration/badge.svg)
76

87
Visual Studio Code extension providing syntax highlighting for Scala 2 and Scala 3 source files.

bin/ci-release.sh

-38
This file was deleted.

0 commit comments

Comments
 (0)