Skip to content

Commit 9966947

Browse files
committed
Updated workflows; updated parent to .17
1 parent 6bfc36f commit 9966947

File tree

6 files changed

+75
-101
lines changed

6 files changed

+75
-101
lines changed

.github/workflows/feature-ci.yml renamed to .github/workflows/branch-ci.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,17 @@
1-
name: Feature Branch CI
1+
name: Branch CI
22

33
on:
44
push:
55
paths-ignore:
66
- '.github/workflows/**'
7-
- 'README.md'
7+
- '*.md'
8+
- '*.txt'
89
branches-ignore:
9-
- 'master'
10-
- 'develop'
1110
- 'release*'
1211

1312
jobs:
1413
build:
15-
name: Feature Branch CI
14+
name: Branch CI
1615
runs-on: ubuntu-latest
1716
steps:
1817
- uses: actions/checkout@v2

.github/workflows/master-ci.yml

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

.github/workflows/pre-release-ci.yml

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: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@ name: Release CI
22

33
on:
44
release:
5-
types: [published]
5+
types: [released]
66

77
jobs:
88
build:
99
name: Release CI
1010
runs-on: ubuntu-latest
1111
steps:
1212
- uses: actions/checkout@v2
13+
with:
14+
fetch-depth: 0
15+
- run: git checkout ${{ github.event.release.target_commitish }}
1316
- uses: actions/cache@v1
1417
with:
1518
path: ~/.m2/repository
@@ -23,16 +26,35 @@ jobs:
2326
server-id: github
2427
server-username: GITHUB_ACTOR
2528
server-password: GITHUB_TOKEN
26-
- name: Deploy release version
27-
run: |
28-
# `tag` is the concatenation of `v` and a version by the tag convention.
29-
release_version=$(echo ${{ github.event.release.tag_name }} | sed "s/v//")
30-
echo Release version $release_version
31-
mvn versions:set -DnewVersion=$release_version -DgenerateBackupPoms=false
32-
mvn versions:commit
33-
mvn clean deploy -B -V
29+
- name: Maven Build
30+
run: mvn clean install -DskipTests=true -Ddockerfile.skip=true -B -V
3431
env:
3532
GITHUB_TOKEN: ${{ secrets.ORGANIZATION_TOKEN }}
36-
- name: Rollback release (remove tag)
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
3752
if: failure()
38-
run: git push origin :refs/tags/${{ github.event.release.tag_name }}
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

DEVELOPMENT.md

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

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<parent>
66
<groupId>io.scalecube</groupId>
77
<artifactId>scalecube-parent-pom</artifactId>
8-
<version>0.2.1</version>
8+
<version>0.2.17</version>
99
</parent>
1010

1111
<artifactId>scalecube-cluster-parent</artifactId>

0 commit comments

Comments
 (0)