Skip to content

Commit f6e6cc5

Browse files
committed
Add CI
1 parent 8b161d6 commit f6e6cc5

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "gradle"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"

.github/workflows/gradle.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
name: CI
2+
on: [ push ]
3+
jobs:
4+
build:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v3
8+
- name: Set up JDK 11
9+
uses: actions/setup-java@v3
10+
with:
11+
distribution: 'temurin'
12+
java-version: '11'
13+
cache: 'gradle'
14+
- name: Build with Gradle
15+
run: ./gradlew build

.github/workflows/publish.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Publish
2+
on:
3+
release:
4+
types: [ published ]
5+
jobs:
6+
publish-release:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- uses: actions/checkout@v3
10+
- name: Set up JDK 11
11+
uses: actions/setup-java@v3
12+
with:
13+
distribution: 'temurin'
14+
java-version: '11'
15+
cache: 'gradle'
16+
- name: Publish artifact
17+
env:
18+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19+
# The GITHUB_REF tag comes in the format 'refs/tags/xxx'.
20+
# So if we split on '/' and take the 3rd value, we can get the release name.
21+
run: |
22+
NEW_VERSION=$(echo "${GITHUB_REF}" | cut -d "/" -f3)
23+
./gradlew -Pversion=${NEW_VERSION} publish

0 commit comments

Comments
 (0)