Skip to content

Commit 2934e0c

Browse files
authored
Create gradle-cicd.yml
1 parent 82b85b5 commit 2934e0c

File tree

1 file changed

+51
-0
lines changed

1 file changed

+51
-0
lines changed

.github/workflows/gradle-cicd.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# This workflow uses actions that are not certified by GitHub.
2+
# They are provided by a third-party and are governed by
3+
# separate terms of service, privacy policy, and support
4+
# documentation.
5+
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
6+
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
7+
8+
name: Gradle Publish
9+
10+
on:
11+
release:
12+
types: [created]
13+
14+
jobs:
15+
build:
16+
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
packages: write
21+
22+
steps:
23+
- uses: actions/checkout@v3
24+
- name: Set up JDK 11
25+
uses: actions/setup-java@v3
26+
with:
27+
java-version: '11'
28+
distribution: 'temurin'
29+
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
30+
settings-path: ${{ github.workspace }} # location for the settings.xml file
31+
32+
- name: Set up Gradle
33+
uses: gradle/gradle-build-action@v2
34+
35+
- name: Build with Gradle
36+
#run: ./gradlew build
37+
uses: gradle/gradle-build-action@v2
38+
with:
39+
arguments: build
40+
# gradle-version: 7.6
41+
42+
# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
43+
# the publishing section of your build.gradle
44+
- name: Publish to GitHub Packages
45+
uses: gradle/gradle-build-action@v2
46+
with:
47+
arguments: publish
48+
# gradle-version: 7.6
49+
env:
50+
USERNAME: ekodevelops
51+
TOKEN: ${{ secrets.CICD_GITHUB_TOKEN }}

0 commit comments

Comments
 (0)