Skip to content

Publish

Publish #3

Workflow file for this run

name: Publish
on:
workflow_dispatch:
inputs:
gradleLogLevel:
description: 'Gradle logging level.'
required: false
default: None
type: choice
options:
- None
- Info
- Warn
- Debug
- Stacktrace
jobs:
release:
runs-on: ubuntu-20.04
env:
GITHUB_USERNAME: Robothy
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup Java 17 for Gradle
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: Gradle Cache
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
key: ${{runner.os}}-build-gradle-${{hashFiles('**/gradle-wrapper.properties')}}
- name: Prepare parameters
run: |
git log --pretty=format:"%H - %an, %aI : %s" -5
mkdir -p ~/.gradle
echo "GITHUB_TOKEN=${{secrets.PACKAGES_TOKEN}}" > ~/.gradle/gradle.properties
echo "GITHUB_USERNAME=Robothy" >> ~/.gradle/gradle.properties
echo "signing.secretKey=${{ secrets.SING_SECRET_KEY }}" >> ~/.gradle/gradle.properties
echo "signing.password=${{ secrets.SING_PASSWORD }}" >> ~/.gradle/gradle.properties
echo "OSSRH_USERNAME=${{ secrets.OSSRH_USERNAME }}" >> ~/.gradle/gradle.properties
echo "OSSRH_PASSWORD=${{ secrets.OSSRH_PASSWORD }}" >> ~/.gradle/gradle.properties
chmod +x gradlew
pwd
ls -l
- name: Update release version
run: |
./gradlew releaseVersion
- name: Publish
if: ${{inputs.gradleLogLevel == 'None'}}
run: |
./gradlew check release
- name: Publish(Info)
if: ${{inputs.gradleLogLevel == 'Info'}}
run: .|
./gradlew check release --info
- name: Publish(Warn)
if: ${{inputs.gradleLogLevel == 'Warn'}}
run: .|
./gradlew check release --warn
- name: Publish(Debug)
if: ${{inputs.gradleLogLevel == 'Debug'}}
run: |
./gradlew check release --debug
- name: Publish(Stacktrace)
if: ${{inputs.gradleLogLevel == 'Stacktrace'}}
run: |
./gradlew check release --stacktrace