Skip to content

Commit 27b4960

Browse files
author
Augusto Hack
authored
Merge pull request #29 from aiven/ivanyu/workflows
Delete Travis and add GitHub Actions workflows
2 parents be557bc + 11881ce commit 27b4960

File tree

4 files changed

+97
-18
lines changed

4 files changed

+97
-18
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# The workflow to check master after push.
2+
name: Master checks after push
3+
on:
4+
push:
5+
branches: [ master ]
6+
jobs:
7+
build:
8+
name: Build
9+
runs-on: ubuntu-latest
10+
steps:
11+
- name: Checkout code
12+
uses: actions/checkout@v2
13+
with:
14+
fetch-depth: 0
15+
- name: Set up JDK 11
16+
uses: actions/setup-java@v1
17+
with:
18+
java-version: 11
19+
- name: Build with Gradle
20+
run: ./gradlew build
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# The workflow to check pull requests into master.
2+
# This checks the source in the state as if after the merge.
3+
name: Pull request checks
4+
on:
5+
pull_request:
6+
branches: [ master ]
7+
jobs:
8+
build:
9+
name: Build
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v2
14+
- name: Set up JDK 11
15+
uses: actions/setup-java@v1
16+
with:
17+
java-version: 11
18+
- name: Build with Gradle
19+
run: ./gradlew build
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# The workflow to create PRs with release commits.
2+
name: Create release PR
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
release_version:
7+
description: "Release version '0.1.2' (without 'v')"
8+
required: true
9+
snapshot_version:
10+
description: "Snapshot version '0.2.0-SNAPSHOT' (without 'v')"
11+
required: true
12+
13+
jobs:
14+
create_release_pr:
15+
name: Create release PR (job)
16+
runs-on: ubuntu-latest
17+
steps:
18+
- name: Check versions
19+
run: |
20+
echo "Checking release version..."
21+
if echo ${{ github.event.inputs.release_version }} | grep --invert-match '^[0-9]\+\.[0-9]\+\.[0-9]\+$' > /dev/null; then
22+
echo "Release version is invalid"
23+
exit 1
24+
fi
25+
26+
echo "Checking snapshot version..."
27+
if echo ${{ github.event.inputs.snapshot_version }} | grep --invert-match '^[0-9]\+\.[0-9]\+\.[0-9]\+-SNAPSHOT$' > /dev/null; then
28+
echo "Snapshot version is invalid"
29+
exit 1
30+
fi
31+
32+
- name: Checkout master
33+
uses: actions/checkout@v2
34+
with:
35+
ref: master
36+
fetch-depth: 0
37+
38+
- name: Create release commits
39+
run: |
40+
git config --local user.name "GitHub Action"
41+
git config --local user.email "[email protected]"
42+
sed -i -e "s/^version=.\+$/version=${{ github.event.inputs.release_version }}/g" gradle.properties
43+
git add gradle.properties
44+
git commit -m "Release version ${{ github.event.inputs.release_version }}"
45+
sed -i -e "s/^version=.\+$/version=${{ github.event.inputs.snapshot_version }}/g" gradle.properties
46+
git add gradle.properties
47+
git commit -m "Bump version to ${{ github.event.inputs.snapshot_version }}"
48+
49+
- name: Create Pull Request
50+
uses: peter-evans/create-pull-request@v3
51+
with:
52+
branch: release-${{ github.event.inputs.release_version }}
53+
delete-branch: true
54+
draft: true
55+
title: Release version ${{ github.event.inputs.release_version }}
56+
body: |
57+
Proposed changelog:
58+
- *fill in*

.travis.yml

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

0 commit comments

Comments
 (0)