Skip to content

Commit e8824f5

Browse files
committed
Migrate CI scripts to GitHub actions
1 parent 7b48721 commit e8824f5

File tree

6 files changed

+99
-51
lines changed

6 files changed

+99
-51
lines changed

.editorconfig

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ indent_style=space
88
indent_size=4
99
trim_trailing_whitespace=true
1010

11-
[.travis.yml]
11+
[*.yml]
1212
indent_size=2

.github/workflows/build.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
name: Build
2+
on: [push]
3+
4+
jobs:
5+
build:
6+
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
java: ['11']
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Setup JDK
13+
uses: actions/setup-java@v1
14+
with:
15+
java-version: ${{ matrix.java }}
16+
- name: Build
17+
run: ./gradlew :server:build :shared:build

.github/workflows/deploy.yml

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Deploy
2+
on:
3+
push:
4+
tags:
5+
- '*'
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Setup JDK
13+
uses: actions/setup-java@v1
14+
with:
15+
java-version: 11
16+
- name: Build distribution
17+
run: ./gradlew :server:distZip :grammars:distZip
18+
- name: Create release
19+
uses: actions/create-release@v1
20+
id: create_release
21+
env:
22+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
23+
with:
24+
tag_name: ${{ github.ref }}
25+
release_name: Version ${{ github.ref }}
26+
draft: false
27+
prerelease: false
28+
- name: Upload server asset
29+
uses: actions/upload-release-asset@v1
30+
env:
31+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
with:
33+
upload_url: ${{ steps.create_release.outputs.upload_url }}
34+
asset_path: ./server/build/distributions/server.zip
35+
asset_name: server.zip
36+
asset_content_type: application/zip
37+
- name: Upload grammar asset
38+
uses: actions/upload-release-asset@v1
39+
env:
40+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
41+
with:
42+
upload_url: ${{ steps.create_release.outputs.upload_url }}
43+
asset_path: ./grammars/build/distributions/grammars.zip
44+
asset_name: grammars.zip
45+
asset_content_type: application/zip
46+
47+
# deploy:
48+
# - stage: "Deploy"
49+
# before_deploy:
50+
# - ./gradlew :server:distZip :grammars:distZip --no-watch-fs
51+
# deploy:
52+
# # Binaries (GitHub Releases)
53+
# - provider: releases
54+
# api_key: "$GITHUB_TOKEN"
55+
# file_glob: true
56+
# file:
57+
# - "server/build/distributions/*.zip"
58+
# - "grammars/build/distributions/*.zip"
59+
# skip_cleanup: true
60+
# name: "Version $TRAVIS_TAG"
61+
# on:
62+
# tags: true
63+
# repo: fwcd/kotlin-language-server
64+
65+
# # Maven (GitHub Packages)
66+
# - provider: script
67+
# script: bash scripts/maven-deploy.sh
68+
# skip_cleanup: true
69+
# on:
70+
# tags: true
71+
# repo: fwcd/kotlin-language-server
72+
73+
# # Docker (GitHub Packages)
74+
# - provider: script
75+
# script: bash scripts/docker-deploy.sh
76+
# skip_cleanup: true
77+
# on:
78+
# tags: true
79+
# repo: fwcd/kotlin-language-server

.travis.yml

-48
This file was deleted.

scripts/docker-deploy.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
#!/bin/bash
2-
docker login docker.pkg.github.com -u fwcd -p "$GH_TOKEN"
2+
docker login docker.pkg.github.com -u fwcd -p "$GITHUB_TOKEN"
33
docker build -t docker.pkg.github.com/fwcd/kotlin-language-server/server:latest .
44
docker push docker.pkg.github.com/fwcd/kotlin-language-server/server:latest

scripts/maven-deploy.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
#!/bin/bash
2-
./gradlew :shared:publish :server:publish -x test -Pgpr.user=fwcd -Pgpr.key="$GH_TOKEN"
2+
./gradlew :shared:publish :server:publish -x test -Pgpr.user=fwcd -Pgpr.key="$GITHUB_TOKEN"

0 commit comments

Comments
 (0)