Skip to content

Commit 4c96794

Browse files
authored
Create gradle-publish_temp.yml
1 parent 4fa8c85 commit 4c96794

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
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 Package
9+
10+
on:
11+
release:
12+
types: [created]
13+
14+
jobs:
15+
build:
16+
17+
runs-on: ubuntu-latest
18+
permissions:
19+
20+
contents: read
21+
packages: write
22+
23+
steps:
24+
- uses: actions/checkout@v2
25+
- name: Set up JDK 11
26+
uses: actions/setup-java@v2
27+
with:
28+
java-version: '11'
29+
distribution: 'adopt'
30+
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
31+
settings-path: ${{ github.workspace }} # location for the settings.xml file
32+
33+
- name: Build with Gradle
34+
uses: gradle/gradle-build-action@4137be6a8bf7d7133955359dbd952c0ca73b1021
35+
with:
36+
arguments: build
37+
38+
# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
39+
# the publishing section of your build.gradle
40+
- name: Publish to GitHub Packages
41+
uses: gradle/gradle-build-action@4137be6a8bf7d7133955359dbd952c0ca73b1021
42+
with:
43+
arguments: publish
44+
env:
45+
USERNAME: ${{ github.actor }}
46+
TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)