Skip to content

Commit f59a5f9

Browse files
authored
Merge pull request #86 from scalecube/github-actions
GitHub actions
2 parents e137abc + a3de05e commit f59a5f9

29 files changed

+635
-590
lines changed

.editorconfig

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_style = space
7+
indent_size = 2
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true

.gitattributes

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# Auto detect text files and perform LF normalization
2+
* text=auto
3+
*.txt text
4+
*.sh text eol=lf
5+
*.html text eol=lf diff=html
6+
*.css text eol=lf
7+
*.js text eol=lf
8+
*.jpg -text
9+
*.pdf -text
10+
*.java text diff=java

.github/workflows/branch-ci.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Branch CI
2+
3+
on:
4+
push:
5+
paths-ignore:
6+
- '.github/workflows/**'
7+
- '*.md'
8+
- '*.txt'
9+
branches-ignore:
10+
- 'release*'
11+
12+
jobs:
13+
build:
14+
name: Branch CI
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v2
18+
- uses: actions/cache@v1
19+
with:
20+
path: ~/.m2/repository
21+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
22+
restore-keys: |
23+
${{ runner.os }}-maven-
24+
- name: Set up JDK 1.8
25+
uses: actions/setup-java@v1
26+
with:
27+
java-version: 1.8
28+
server-id: github
29+
server-username: GITHUB_ACTOR
30+
server-password: GITHUB_TOKEN
31+
- name: Maven Build
32+
run: mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true -Ddockerfile.skip=true -B -V
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.ORGANIZATION_TOKEN }}
35+
- name: Maven Verify
36+
run: mvn verify -B
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: Pre-release CI
2+
3+
on:
4+
release:
5+
types: [prereleased]
6+
7+
jobs:
8+
build:
9+
name: Pre-release CI
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
- uses: actions/cache@v1
14+
with:
15+
path: ~/.m2/repository
16+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
17+
restore-keys: |
18+
${{ runner.os }}-maven-
19+
- name: Set up JDK 1.8
20+
uses: actions/setup-java@v1
21+
with:
22+
java-version: 1.8
23+
server-id: github
24+
server-username: GITHUB_ACTOR
25+
server-password: GITHUB_TOKEN
26+
- name: Deploy pre-release version
27+
run: |
28+
pre_release_version=${{ github.event.release.tag_name }}
29+
echo Pre-release version $pre_release_version
30+
mvn versions:set -DnewVersion=$pre_release_version -DgenerateBackupPoms=false
31+
mvn versions:commit
32+
mvn clean deploy -B -V
33+
env:
34+
GITHUB_TOKEN: ${{ secrets.ORGANIZATION_TOKEN }}
35+
- name: Rollback pre-release (remove tag)
36+
if: failure()
37+
run: git push origin :refs/tags/${{ github.event.release.tag_name }}

.github/workflows/release-ci.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: Release CI
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
jobs:
8+
build:
9+
name: Release CI
10+
runs-on: ubuntu-latest
11+
steps:
12+
- uses: actions/checkout@v2
13+
with:
14+
fetch-depth: 0
15+
- run: git checkout ${{ github.event.release.target_commitish }}
16+
- uses: actions/cache@v1
17+
with:
18+
path: ~/.m2/repository
19+
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
20+
restore-keys: |
21+
${{ runner.os }}-maven-
22+
- name: Set up JDK 1.8
23+
uses: actions/setup-java@v1
24+
with:
25+
java-version: 1.8
26+
server-id: github
27+
server-username: GITHUB_ACTOR
28+
server-password: GITHUB_TOKEN
29+
- name: Maven Build
30+
run: mvn clean install -DskipTests=true -Ddockerfile.skip=true -B -V
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.ORGANIZATION_TOKEN }}
33+
- name: Maven Verify
34+
run: mvn verify -B
35+
- name: Configure git
36+
run: |
37+
git config --global user.email "${GITHUB_ACTOR}@users.noreply.github.com"
38+
git config --global user.name "${GITHUB_ACTOR}"
39+
- name: Prepare release
40+
id: prepare_release
41+
run: |
42+
mvn -B build-helper:parse-version release:prepare \
43+
-DreleaseVersion=\${parsedVersion.majorVersion}.\${parsedVersion.minorVersion}.\${parsedVersion.incrementalVersion} \
44+
-Darguments="-DskipTests=true -Ddockerfile.skip=true"
45+
echo ::set-output name=release_tag::$(git describe --tags --abbrev=0)
46+
- name: Perform release
47+
run: mvn -B release:perform -Darguments="-DskipTests=true -Ddockerfile.skip=true"
48+
env:
49+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
50+
GITHUB_REPOSITORY: ${{ secrets.GITHUB_REPOSITORY }}
51+
- name: Rollback release
52+
if: failure()
53+
run: |
54+
mvn release:rollback || echo "nothing to rollback"
55+
git push origin :refs/tags/${{ github.event.release.tag_name }}
56+
if [ ! -z "${{ steps.prepare_release.outputs.release_tag }}" ]
57+
then
58+
git tag -d ${{ steps.prepare_release.outputs.release_tag }}
59+
git push origin :refs/tags/${{ steps.prepare_release.outputs.release_tag }}
60+
fi

.gitignore

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,13 @@
1-
# everything that starts with dot (hidden files)
21
.*
3-
# except this file
42
!.gitignore
5-
# except this file-extention
3+
!.gitattributes
4+
!.github
5+
!.editorconfig
66
!.*.yml
7-
8-
# Build targets
7+
!.env.example
98
**/target/
10-
11-
# logs and reports
9+
*.iml
10+
**/logs/*.log
11+
*.db
1212
*.csv
1313
*.log
14-
*.zip
15-
16-
# IntelliJ IDEA project files and directories
17-
*.iml
18-
19-
**/pom.xml.releaseBackup
20-
/release.properties

.travis.yml

Lines changed: 0 additions & 28 deletions
This file was deleted.

.yamllint.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
extends: default
2+
rules:
3+
document-start:
4+
present: false
5+
truthy: disable
6+
comments:
7+
min-spaces-from-content: 1
8+
line-length:
9+
max: 150
10+
braces:
11+
min-spaces-inside: 0
12+
max-spaces-inside: 0
13+
brackets:
14+
min-spaces-inside: 0
15+
max-spaces-inside: 0
16+
indentation:
17+
indent-sequences: consistent

0 commit comments

Comments
 (0)