Skip to content

Commit 0b3f8ec

Browse files
committed
cicd: Added early-access workflow
1 parent 847605c commit 0b3f8ec

File tree

1 file changed

+92
-0
lines changed

1 file changed

+92
-0
lines changed

.github/workflows/early-access.yml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: 'Early Access'
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
7+
jobs:
8+
earlyaccess:
9+
name: 'Early Access'
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Cancel previous run
13+
uses: styfle/cancel-workflow-action@0.12.1
14+
with:
15+
access_token: ${{ secrets.GIT_ACCESS_TOKEN }}
16+
17+
- name: Checkout
18+
uses: actions/checkout@v4
19+
with:
20+
fetch-depth: 0
21+
22+
- name: Set up Java
23+
uses: actions/setup-java@v4
24+
with:
25+
java-version: 21
26+
distribution: 'zulu'
27+
28+
- name: Cache Gradle
29+
uses: actions/cache@v4
30+
with:
31+
path: ~/.gradle/caches
32+
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle') }}-${{ hashFiles('**/gradle.properties') }}
33+
restore-keys: |
34+
${{ runner.os }}-gradle-
35+
36+
- name: Cache Gradle wrapper
37+
uses: actions/cache@v4
38+
with:
39+
path: ~/.gradle/wrapper
40+
key: ${{ runner.os }}-gradlew-${{ hashFiles('**/gradlew') }}
41+
restore-keys: ${{ runner.os }}-gradlew-
42+
43+
- name: Build
44+
run: |
45+
./gradlew build test aggregateTestReport -S
46+
47+
- name: Upload test reports
48+
if: failure()
49+
uses: actions/upload-artifact@v4
50+
with:
51+
name: test-report
52+
path: |
53+
build/reports/tests/aggregate
54+
55+
- name: Version
56+
id: vars
57+
shell: bash
58+
run: |
59+
VERSION=$(grep '^version\s*=\s*' gradle.properties | cut -d'=' -f2 | xargs)
60+
echo "VERSION=$VERSION" >> "$GITHUB_OUTPUT"
61+
if [[ "$VERSION" == *-SNAPSHOT ]]; then
62+
echo "SNAPSHOT=true" >> "$GITHUB_OUTPUT"
63+
else
64+
echo "SNAPSHOT=false" >> "$GITHUB_OUTPUT"
65+
fi
66+
67+
- name: Release
68+
if: ${{ steps.vars.outputs.SNAPSHOT }}
69+
uses: jreleaser/release-action@v2
70+
with:
71+
arguments: release
72+
version: 'latest'
73+
env:
74+
JRELEASER_GITHUB_PASSWORD: ${{ secrets.GIT_ACCESS_TOKEN }}
75+
JRELEASER_GITHUB_TOKEN: ${{ secrets.GIT_ACCESS_TOKEN }}
76+
JRELEASER_GITHUB_USERNAME: ${{ secrets.GIT_USER }}
77+
JRELEASER_GPG_PASSPHRASE: ${{ secrets.GPG_PASSPHRASE }}
78+
JRELEASER_GPG_PUBLIC_KEY: ${{ secrets.GPG_PUBLIC_KEY }}
79+
JRELEASER_GPG_SECRET_KEY: ${{ secrets.GPG_SECRET_KEY }}
80+
JRELEASER_MAVENCENTRAL_USERNAME: ${{ secrets.SONATYPE_USERNAME }}
81+
JRELEASER_MAVENCENTRAL_PASSWORD: ${{ secrets.SONATYPE_PASSWORD }}
82+
JRELEASER_PROJECT_VERSION: ${{ steps.vars.outputs.VERSION }}
83+
JRELEASER_SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
84+
85+
- name: JReleaser output
86+
if: always()
87+
uses: actions/upload-artifact@v4
88+
with:
89+
name: artifact
90+
path: |
91+
out/jreleaser/trace.log
92+
out/jreleaser/output.properties

0 commit comments

Comments
 (0)