Skip to content

Commit b1e1782

Browse files
SessionHero01SessionHero01
authored andcommitted
Add gradle publishing CI
1 parent c86d5b9 commit b1e1782

File tree

1 file changed

+40
-0
lines changed

1 file changed

+40
-0
lines changed
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Gradle Package
2+
3+
on:
4+
push:
5+
branches: [ main ]
6+
tags:
7+
- 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
permissions:
13+
contents: read
14+
packages: write
15+
16+
steps:
17+
- uses: actions/checkout@v4
18+
with:
19+
submodules: 'recursive'
20+
- name: Set up JDK 17
21+
uses: actions/setup-java@v4
22+
with:
23+
java-version: '17'
24+
distribution: 'temurin'
25+
26+
- name: Build with Gradle
27+
run: ./gradlew build
28+
29+
- name: Gather version name from git describe
30+
id: version
31+
run: echo ::set-output name=version::$(git describe --tags --dirty)
32+
33+
# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
34+
# the publishing section of your build.gradle
35+
- name: Publish to GitHub Packages
36+
run: ./gradlew publish
37+
env:
38+
GITHUB_USER: ${{ github.actor }}
39+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
40+
VERSION: ${{ steps.version.outputs.version }}

0 commit comments

Comments
 (0)