Switch ubuntu-latest to ubuntu-22.04 #15
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |