Skip to content

Commit

Permalink
💚 Fix GitHub Actions
Browse files Browse the repository at this point in the history
Also switches to good ol actions/cache because of actions/setup-java#269
  • Loading branch information
DeJayDev committed Jun 13, 2022
1 parent e58a3c9 commit 922f921
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 10 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/ci.yml
Expand Up @@ -11,8 +11,8 @@ on:

jobs:
build:
name: Test on Java 17
runs-on: ubuntu-latest
name: Build on Java 17
runs-on: ubuntu-22.04

steps:
- name: Checkout
Expand All @@ -23,10 +23,18 @@ jobs:
with:
distribution: 'corretto'
java-version: '17'
cache: 'gradle'

- name: Validate Gradle
uses: gradle/wrapper-validation-action@v1

- name: Cache Gradle Wrapper and Dependencies
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle/wrapper/gradle-wrapper.properties') }}

- name: Build with Gradle
run: ./gradlew build
run: ./gradlew build --no-daemon

17 changes: 13 additions & 4 deletions .github/workflows/docs.yml
@@ -1,12 +1,14 @@
name: Build documentation
name: Generate Javadocs

on:
push:
branches: [master]

jobs:
javadoc:
runs-on: ubuntu-latest
name: Generate Javadocs
runs-on: ubuntu-22.04

steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -16,13 +18,20 @@ jobs:
with:
distribution: 'corretto'
java-version: '17'
cache: 'gradle'

- name: Validate Gradle
uses: gradle/wrapper-validation-action@v1

- name: Cache Gradle Wrapper and Dependencies
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle/wrapper/gradle-wrapper.properties') }}

- name: Build Javadoc
run: ./gradlew javadocs
run: ./gradlew javadoc --no-daemon

# - name: Checkout website repository
# uses: actions/checkout@v2
Expand Down
25 changes: 24 additions & 1 deletion .github/workflows/release.yml
Expand Up @@ -15,13 +15,16 @@
name: Publish new release

on:
workflow_dispatch:
push:
tags:
- 'v*'

jobs:
publish:
runs-on: ubuntu-latest
name: Publish Release
runs-on: ubuntu-22.04

steps:
- name: Checkout
uses: actions/checkout@v2
Expand All @@ -32,3 +35,23 @@ jobs:
distribution: 'corretto'
java-version: '17'
cache: 'gradle'

- name: Validate Gradle
uses: gradle/wrapper-validation-action@v1

- name: Cache Gradle Wrapper and Dependencies
uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-cache-${{ hashFiles('**/*.gradle', '**/*.gradle.kts', '**/gradle/wrapper/gradle-wrapper.properties') }}

- name: Build with Gradle
run: ./gradlew build --no-daemon

- name: Publish to GitHub Packages
run: gradle publish
env:
USERNAME: ${{ github.actor }}
PASSWORD: ${{ secrets.GITHUB_TOKEN }}
13 changes: 12 additions & 1 deletion build.gradle.kts
Expand Up @@ -59,7 +59,18 @@ tasks {
}

publishing {
publications.create<MavenPublication>("maven") {
repositories {
maven {
name = "GitHubPackages"
url = uri("https://maven.pkg.github.com/DeJayDev/ezLib")
credentials {
username = project.findProperty("gpr.user") as String? ?: System.getenv("USERNAME")
password = project.findProperty("gpr.key") as String? ?: System.getenv("TOKEN")
}
}
}

publications.create<MavenPublication>("gpr") {
from(components["java"])
}
}

0 comments on commit 922f921

Please sign in to comment.