forked from JakeWharton/flip-tables
-
Notifications
You must be signed in to change notification settings - Fork 2
62 lines (52 loc) · 1.62 KB
/
ci.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
name: flip-tables CI
on:
pull_request:
branches: [ '*' ]
push:
branches: [ 'master' ]
tags: [ '*' ]
permissions:
contents: read
id-token: write
jobs:
gradle-build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '8'
- uses: gradle/actions/setup-gradle@v3
- name: Build Release Version
if: ${{ github.ref_type == 'tag' }}
run: ./gradlew clean assemble --info -Dorg.gradle.project.version=${{ github.ref_name }}
- name: Build Non-Release Version
if: ${{ github.ref_type != 'tag' }}
run: ./gradlew clean assemble --info
- name: Bundle/TAR up JAR files
run: |
tar -cvzf ./build/libs/java.tar.gz ./build/libs/*.jar
ls -ls ./build/libs
- name: Publish Artifact
uses: actions/upload-artifact@v4
with:
name: flip-tables
path: ./build/libs/flip-tables-*.*.jar
- name: Publish Snapshot
if: ${{ github.ref_type != 'tag' && github.ref_name != 'master' && hashFiles('./build/libs/*-SNAPSHOT.jar') != '' }}
uses: actions/upload-artifact@v4
with:
name: flip-tables-snapshot
path: ./build/libs/*-SNAPSHOT.jar
Unit-Test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v4
with:
distribution: 'corretto'
java-version: '8'
- uses: gradle/actions/setup-gradle@v3
- name: Run Tests
run: ./gradlew --no-daemon --console=plain test