Skip to content

Commit

Permalink
GitHub actions (#56)
Browse files Browse the repository at this point in the history
* Added github actions; removed travis files; upadated pom

* Fixed jackson version

* Updated scalecube-parent-pom version

* Fixed jackson

* Set to skip tests (tests depends on remote 3rdparty)
  • Loading branch information
artem-v authored Sep 17, 2020
1 parent c2a163b commit a30b8c4
Show file tree
Hide file tree
Showing 11 changed files with 215 additions and 120 deletions.
9 changes: 9 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
insert_final_newline = true
trim_trailing_whitespace = true
10 changes: 10 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Auto detect text files and perform LF normalization
* text=auto
*.txt text
*.sh text eol=lf
*.html text eol=lf diff=html
*.css text eol=lf
*.js text eol=lf
*.jpg -text
*.pdf -text
*.java text diff=java
37 changes: 37 additions & 0 deletions .github/workflows/feature-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Feature Branch CI

on:
push:
paths-ignore:
- '.github/workflows/**'
- 'README.md'
branches-ignore:
- 'master'
- 'develop'
- 'release*'

jobs:
build:
name: Feature Branch CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
server-id: github
server-username: GITHUB_ACTOR
server-password: GITHUB_TOKEN
- name: Maven Build
run: mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -Ddockerfile.skip=true -B -V
env:
GITHUB_TOKEN: ${{ secrets.ORGANIZATION_TOKEN }}
- name: Maven Verify
run: mvn verify -B
64 changes: 64 additions & 0 deletions .github/workflows/master-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Master branch CI

on:
push:
branches:
- 'master'

jobs:
build:
name: Master Branch CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
server-id: github
server-username: GITHUB_ACTOR
server-password: GITHUB_TOKEN
- name: Maven Build
run: mvn clean install -DskipTests=true -Ddockerfile.skip=true -B -V
env:
GITHUB_TOKEN: ${{ secrets.ORGANIZATION_TOKEN }}
- name: Maven Verify
run: mvn verify -B
- name: Configure git
run: |
echo "Git checkout branch ${GITHUB_REF##*/}, commit ${GITHUB_SHA} was pushed by ${GITHUB_ACTOR}"
git checkout ${GITHUB_REF##*/}
echo "Git reset hard to ${GITHUB_SHA}"
git reset --hard ${GITHUB_SHA}
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
git config --global user.name "${GITHUB_ACTOR}"
- name: Prepare release
id: prepare_release
run: |
mvn --batch-mode build-helper:parse-version release:prepare -P release \
-DreleaseVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.incrementalVersion} \
-DdevelopmentVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.nextIncrementalVersion}-SNAPSHOT \
-DautoVersionSubmodules=true -Darguments="-DskipTests=true"
echo ::set-output name=release_tag::$(git describe --tags --abbrev=0)
- name: Perform release
run: mvn --batch-mode release:perform -P release -Darguments="-DskipTests=true -Ddocker.image.extra-tag=master"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }}
- name: Rollback release
if: failure()
run: |
mvn release:rollback || echo "nothing to rollback"
if [ ! -z "${{ steps.prepare_release.outputs.release_tag }}" ]
then
git tag -d ${{ steps.prepare_release.outputs.release_tag }}
git push origin :refs/tags/${{ steps.prepare_release.outputs.release_tag }}
fi
38 changes: 38 additions & 0 deletions .github/workflows/release-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Release CI

on:
release:
types: [published]

jobs:
build:
name: Release CI
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/cache@v1
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 1.8
uses: actions/setup-java@v1
with:
java-version: 1.8
server-id: github
server-username: GITHUB_ACTOR
server-password: GITHUB_TOKEN
- name: Deploy release version
run: |
# `tag` is the concatenation of `v` and a version by the tag convention.
release_version=$(echo ${{ github.event.release.tag_name }} | sed "s/v//")
echo Release version $release_version
mvn versions:set -DnewVersion=$release_version -DgenerateBackupPoms=false
mvn versions:commit
mvn clean deploy -B -V
env:
GITHUB_TOKEN: ${{ secrets.ORGANIZATION_TOKEN }}
- name: Rollback release (remove tag)
if: failure()
run: git push origin :refs/tags/${{ github.event.release.tag_name }}
21 changes: 7 additions & 14 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,20 +1,13 @@
# everything that starts with dot (hidden files)
.*
# except this file
!.gitignore
# except this file-extention
!.gitattributes
!.github
!.editorconfig
!.*.yml

# Build targets
!.env.example
**/target/

# logs and reports
*.iml
**/logs/*.log
*.db
*.csv
*.log
*.zip

# IntelliJ IDEA project files and directories
*.iml

**/pom.xml.releaseBackup
/release.properties
28 changes: 0 additions & 28 deletions .travis.yml

This file was deleted.

17 changes: 17 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
extends: default
rules:
document-start:
present: false
truthy: disable
comments:
min-spaces-from-content: 1
line-length:
max: 150
braces:
min-spaces-inside: 0
max-spaces-inside: 0
brackets:
min-spaces-inside: 0
max-spaces-inside: 0
indentation:
indent-sequences: consistent
40 changes: 33 additions & 7 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,28 +1,48 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>io.scalecube</groupId>
<artifactId>scalecube-parent-pom</artifactId>
<version>0.1.0-RC1</version>
<version>0.2.1</version>
</parent>

<artifactId>trace-reporter</artifactId>
<version>0.0.26-SNAPSHOT</version>

<name>ScaleCube Trace Reporter</name>

<repositories>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/scalecube/packages</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>

<distributionManagement>
<repository>
<id>github</id>
<name>GitHub Packages</name>
<url>https://maven.pkg.github.com/scalecube/${project.artifactId}</url>
</repository>
</distributionManagement>

<scm>
<url>https://github.com/scalecube/trace-reporter</url>
<connection>scm:git:git@github.com:scalecube/trace-reporter.git</connection>
<developerConnection>scm:git:git@github.com:scalecube/trace-reporter.git
<connection>scm:git:https://github.com/scalecube/trace-reporter.git</connection>
<developerConnection>scm:git:https://github.com/scalecube/trace-reporter.git
</developerConnection>
<tag>HEAD</tag>
</scm>

<properties>
<jackson.version>2.9.10.3</jackson.version>
<jackson.version>2.11.0</jackson.version>
</properties>

<dependencies>
Expand Down Expand Up @@ -71,6 +91,12 @@

<build>
<plugins>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
</plugin>
Expand Down Expand Up @@ -103,5 +129,5 @@
</plugin>
</plugins>
</build>
</project>

</project>
16 changes: 0 additions & 16 deletions scripts/create-chart.sh

This file was deleted.

55 changes: 0 additions & 55 deletions travis-settings.xml

This file was deleted.

0 comments on commit a30b8c4

Please sign in to comment.