Files
starter-workflows/ci/gradle-publish.yml
T

46 lines
1.5 KiB
YAML
Raw Normal View History

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.
2020-02-20 12:44:22 -05:00
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created
2021-04-05 17:44:33 +03:00
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle
2020-02-20 11:33:16 -05:00
name: Gradle Package
on:
release:
types: [created]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
2020-02-20 11:33:16 -05:00
steps:
2022-03-28 13:10:48 -04:00
- uses: actions/checkout@v3
- name: Set up JDK 11
2022-03-28 13:10:48 -04:00
uses: actions/setup-java@v3
2020-02-20 11:33:16 -05:00
with:
java-version: '11'
distribution: 'temurin'
2020-02-20 11:33:16 -05:00
server-id: github # Value of the distributionManagement/repository/id field of the pom.xml
settings-path: ${{ github.workspace }} # location for the settings.xml file
2020-02-20 12:54:19 -05:00
- name: Build with Gradle
2022-06-20 09:13:25 -06:00
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: build
2020-02-20 11:33:16 -05:00
2020-03-15 03:47:21 -07:00
# The USERNAME and TOKEN need to correspond to the credentials environment variables used in
2020-02-21 12:55:06 -05:00
# the publishing section of your build.gradle
2020-02-20 12:54:19 -05:00
- name: Publish to GitHub Packages
2022-06-20 09:13:25 -06:00
uses: gradle/gradle-build-action@67421db6bd0bf253fb4bd25b31ebb98943c375e1
with:
arguments: publish
2020-02-20 11:33:16 -05:00
env:
2020-02-20 12:54:19 -05:00
USERNAME: ${{ github.actor }}
2020-03-15 03:47:21 -07:00
TOKEN: ${{ secrets.GITHUB_TOKEN }}