Skip to content

Commit

Permalink
Up the version for kotlin + github actions
Browse files Browse the repository at this point in the history
  • Loading branch information
belyaev-mikhail committed Jan 28, 2020
1 parent 1b3233c commit 2fcc415
Show file tree
Hide file tree
Showing 7 changed files with 120 additions and 100 deletions.
12 changes: 12 additions & 0 deletions .github/bintray-settings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>bintray-vorpal-research-kotlin-maven</id>
<username>${env.BINTRAY_USERNAME}</username>
<password>${env.BINTRAY_PASSWORD}</password>
</server>
</servers>
</settings>
53 changes: 53 additions & 0 deletions .github/workflows/deployment.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Java CD

on:
release:
types: published

jobs:
publish:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Deploy to Bintray
id: deploy-to-bintray
run: |
mvn versions:set -DnewVersion=${{ github.event.release.tag_name }}
mvn deploy -s .github/bintray-settings.xml || echo "deploy failed" >&2
env:
BINTRAY_USERNAME: ${{ secrets.bintray_username }}
BINTRAY_PASSWORD: ${{ secrets.bintray_password }}

- name: Move sources jar file
run: mv target/*-sources.jar sources.jar

- name: Move target jar file
run: mv target/*.jar target.jar

- name: Attach source jar to release
id: upload-source-asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: sources.jar
asset_name: ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}-sources.jar
asset_content_type: application/zip

- name: Attach target jar to release
id: upload-release-asset
uses: actions/[email protected]
env:
GITHUB_TOKEN: ${{ github.token }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: target.jar
asset_name: ${{ github.event.repository.name }}-${{ github.event.release.tag_name }}.jar
asset_content_type: application/zip
17 changes: 17 additions & 0 deletions .github/workflows/integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
name: Java CI

on: [push]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v1
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build with Maven
run: mvn -B package
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
.idea
target
*.iml
*.tokens
59 changes: 37 additions & 22 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<antlr4.visitor>true</antlr4.visitor>
<antlr4.listener>true</antlr4.listener>
<kotlin.version>1.2.51</kotlin.version>
<antlr4.version>4.7.1</antlr4.version>
<kotlin.version>1.3.61</kotlin.version>
<antlr4.version>4.8</antlr4.version>
</properties>

<dependencies>
Expand All @@ -26,11 +26,6 @@
<artifactId>kotlin-stdlib-jdk8</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-reflect</artifactId>
<version>${kotlin.version}</version>
</dependency>
<dependency>
<groupId>org.jetbrains.kotlin</groupId>
<artifactId>kotlin-test</artifactId>
Expand Down Expand Up @@ -65,29 +60,49 @@
<includes><include>**/*.g4</include></includes>
</resource>
</resources>

<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>3.0.0</version>

<executions>
<execution>
<phase>process-sources</phase>
<goals>
<goal>add-source</goal>
</goals>
<configuration>
<sources>
<source>src/main/kotlin</source>
<source>src/main/antlr4</source>
</sources>
</configuration>
</execution>
</executions>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.6</version>
<configuration>
<descriptorRefs>
<descriptorRef>jar-with-dependencies</descriptorRef>
</descriptorRefs>
<archive>
<manifest>
<mainClass>ru.spbstu.grammarConverter.MainKt</mainClass>
</manifest>
</archive>
</configuration>
<artifactId>maven-source-plugin</artifactId>
<executions>
<execution>
<id>make-assembly</id>
<phase>package</phase>
<goals><goal>single</goal></goals>
<id>attach-sources</id>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
<configuration>
<includes>
<include>**/*.kt</include>
<include>**/*.java</include>
<include>**/*.g4</include>
</includes>
</configuration>
</plugin>

<plugin>
<groupId>org.antlr</groupId>
<artifactId>antlr4-maven-plugin</artifactId>
Expand Down
78 changes: 0 additions & 78 deletions src/main/antlr4/ANTLRv4Lexer.tokens

This file was deleted.

Empty file removed src/main/antlr4/LexBasic.tokens
Empty file.

0 comments on commit 2fcc415

Please sign in to comment.