Skip to content

Migrate deployments to GitHub Actions #175

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

Merged
merged 1 commit into from
Dec 16, 2020
Merged
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
10 changes: 8 additions & 2 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
name: continuous-integration

on: [push, pull_request]
# Only run for pushes to a branch, not to a tag
on:
push:
branches:
- '*'
pull_request:
branches:
- '*'

jobs:
build-and-test:
Expand All @@ -16,4 +23,3 @@ jobs:
- run: yarn
- run: yarn build
- run: yarn test

65 changes: 65 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: deploy

on:
push:
tags:
- '*.*.*'

env:
OWNER: scala
REPOSITORY: vscode-scala-syntax
RELEASE_BRANCH: master

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
- name: Cache Node.js modules
uses: actions/cache@v2
with:
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- run: yarn

- name: Update package.json version
run: yarn version --no-git-tag-version --new-version ${GITHUB_REF#refs/*/}
- name: Generate CHANGELOG.md
run: npx github-changes --owner $OWNER --repository $REPOSITORY --branch $RELEASE_BRANCH --no-merges --title "Scala Syntax (official) Changelog"
- run: yarn build
- run: yarn test
- name: Commit generated files
run: |
git config --global user.name "Scala bot"
git config --global user.email "$GITHUB_RUN_NUMBER@$GITHUB_SHA"
git commit -am "Release ${GITHUB_REF#refs/*/}"
git remote set-url origin https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git push origin HEAD:$RELEASE_BRANCH

- name: Release extension
run: yarn vscode:publish --pat ${{ secrets.VS_MARKETPLACE_TOKEN }}

- name: Generate GitHub Release notes
run: npx github-changes --owner $OWNER --repository $REPOSITORY --branch $RELEASE_BRANCH --no-merges --title "Changelog" --for-tag ${GITHUB_REF#refs/*/} --file release-notes.md
- name: Create GitHub Release
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
body_path: release-notes.md
draft: false
prerelease: false
- run: mv scala-*.vsix scala.vsix
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create-release.outputs.upload_url }}
asset_path: ./scala.vsix
asset_name: scala.vsix
asset_content_type: application/zip
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

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

Visual Studio Code extension providing syntax highlighting for Scala 2 and Scala 3 source files.
Expand Down
38 changes: 0 additions & 38 deletions bin/ci-release.sh

This file was deleted.