-
Notifications
You must be signed in to change notification settings - Fork 2
40 lines (31 loc) · 1.26 KB
/
gradle.yml
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
name: Bump Patch and Publish (Gradle)
on:
push:
branches: [ master ]
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Install Java and Gradle
uses: actions/setup-java@v1
with:
java-version: 17
- name: Fix gradlew permissions (optional)
run: chmod +x gradlew
- name: Get Version Info with Specific Commits (using custom task)
# Pass numCommits from workflow to Gradle task as a property
env:
MAVEN_USERNAME: ${{ secrets.USERNAME }} # Reference the secret\
run: ./gradlew getVersion -PnumCommits=${{ github.event.commits }}
# Optional: Get Current Version (consider modifying for clarity)
- name: Get Current Version (optional)
id: get_version # Assuming the task sets a 'numCommits' property after filtering
run: echo "::set-output name=CURRENT_VERSION=$(./gradlew properties -q | grep numCommits | cut -d= -f2)"
- name: Build and Test (Java Specific)
run: ./gradlew test
- name: Publish
env:
MAVEN_USERNAME: ${{ secrets.USERNAME }} # Reference the secret\
MAVEN_PASSWORD: ${{ secrets.PASSWORD }} # Reference the secret\
run: ./gradlew publish -DskipTests