Skip to content

Commit eb8f4c1

Browse files
committed
switch to setup-java@v2
add release-from-tag
1 parent 4677c8b commit eb8f4c1

3 files changed

Lines changed: 27 additions & 22 deletions

File tree

.github/workflows/maven-build.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,9 @@ jobs:
1919
runs-on: ${{ matrix.os }}
2020
strategy:
2121
matrix:
22-
os: [ ubuntu-latest ]
2322
java: [8, 11]
23+
os: [ubuntu-latest]
24+
distribution: [temurin]
2425

2526
steps:
2627
# Check out Git repository
@@ -29,18 +30,11 @@ jobs:
2930

3031
# Set up environment with Java and Maven
3132
- name: Setup JDK
32-
uses: actions/setup-java@v1
33+
uses: actions/setup-java@v2
3334
with:
35+
distribution: ${{ matrix.distribution }}
3436
java-version: ${{ matrix.java }}
35-
36-
# Set up dependency cache
37-
- name: Cache local Maven repository
38-
uses: actions/cache@v2
39-
with:
40-
path: ~/.m2/repository
41-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
42-
restore-keys: |
43-
${{ runner.os }}-maven-
37+
cache: 'maven'
4438

4539
# Build & verify
4640
- name: Build and verify

.github/workflows/maven-deploy.yml

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,11 @@ jobs:
2626
2727
# Set up environment with Java and Maven
2828
- name: Setup JDK
29-
uses: actions/setup-java@v1
29+
uses: actions/setup-java@v2
3030
with:
31-
java-version: 1.8
32-
33-
# Set up dependency cache
34-
- name: Cache local Maven repository
35-
uses: actions/cache@v2
36-
with:
37-
path: ~/.m2/repository
38-
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
39-
restore-keys: |
40-
${{ runner.os }}-maven-
31+
distribution: temurin
32+
java-version: 8
33+
cache: 'maven'
4134

4235
# Build, deploy to ossrh
4336
- name: Build, verify, deploy
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
name: Release from Tag
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
workflow_dispatch:
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: write
14+
steps:
15+
- uses: actions/checkout@v2
16+
- uses: ncipollo/release-action@v1
17+
with:
18+
token: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)