Skip to content

Merge pull request #5 from EEWBot/renovate/gradle-8.x #21

Merge pull request #5 from EEWBot/renovate/gradle-8.x

Merge pull request #5 from EEWBot/renovate/gradle-8.x #21

Workflow file for this run

name: Build
on:
pull_request:
paths:
- '.github/workflows/build.yml'
- 'src/**'
- 'gradle/**'
- 'gradlew'
- 'gradlew.bat'
- '*.gradle.kts'
push:
branches:
- master
workflow_dispatch:
inputs:
publish:
description: |-
Publish to GitHub Packages
(The master branch always publish regardless this option.)
type: boolean
required: true
default: false
concurrency:
group: ${{ github.workflow }}
jobs:
build:
name: Build library
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup JDK8
uses: actions/setup-java@v4
with:
distribution: 'zulu'
java-version: '8'
cache: gradle
- name: Validate Gradle wrapper
uses: gradle/actions/wrapper-validation@v3
- name: Add permission to Gradle wrapper
run: chmod +x gradlew
- name: Do build
run: ./gradlew build
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: ./build/libs/*
retention-days: 30
- name: Publish to GitHub Packages
if: ${{ github.ref == 'refs/heads/master' || inputs.publish }}
run: ./gradlew publish
env:
GPR_KEY: ${{ secrets.GITHUB_TOKEN }}
SIGNING_KEY: ${{ secrets.GPG_PRIVATE_KEY }}
SIGNING_KEY_ID: ${{ secrets.GPG_KEY_ID }}
SIGNING_KEY_PASSWORD: ${{ secrets.GPG_PASSPHRASE }}