diff --git a/.github/workflows/make-doc.sh b/.github/workflows/make-doc.sh deleted file mode 100755 index 640f466b1..000000000 --- a/.github/workflows/make-doc.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -set -eu - -DEST="${GITHUB_REF#refs/*/}" -echo "Uploading docs to https://tweaked.cc/$DEST" - -# Setup ssh key -mkdir -p "$HOME/.ssh/" -echo "$SSH_KEY" > "$HOME/.ssh/key" -chmod 600 "$HOME/.ssh/key" - -# And upload -rsync -avc -e "ssh -i $HOME/.ssh/key -o StrictHostKeyChecking=no -p $SSH_PORT" \ - "$GITHUB_WORKSPACE/projects/web/build/site/" \ - "$SSH_USER@$SSH_HOST:/$DEST" -rsync -avc -e "ssh -i $HOME/.ssh/key -o StrictHostKeyChecking=no -p $SSH_PORT" \ - "$GITHUB_WORKSPACE/projects/common-api/build/docs/javadoc/" \ - "$SSH_USER@$SSH_HOST:/$DEST/javadoc" diff --git a/.github/workflows/make-doc.yml b/.github/workflows/make-doc.yml index 26eeb3c4e..424cbceb7 100644 --- a/.github/workflows/make-doc.yml +++ b/.github/workflows/make-doc.yml @@ -11,30 +11,25 @@ jobs: runs-on: ubuntu-latest steps: - - name: Clone repository + - name: 📥 Clone repository uses: actions/checkout@v4 - - name: Set up Java + - name: 📥 Set up Java uses: actions/setup-java@v4 with: java-version: 17 distribution: 'temurin' - - name: Setup Gradle + - name: 📥 Setup Gradle uses: gradle/actions/setup-gradle@v3 with: cache-read-only: ${{ !startsWith(github.ref, 'refs/heads/mc-') }} - - name: Build with Gradle - run: ./gradlew compileJava --no-daemon || ./gradlew compileJava --no-daemon + - name: ⚒️ Generate documentation + run: ./gradlew docWebsite --no-daemon - - name: Generate documentation - run: ./gradlew docWebsite :common-api:javadoc --no-daemon - - - name: Upload documentation - run: .github/workflows/make-doc.sh 2> /dev/null - env: - SSH_KEY: ${{ secrets.SSH_KEY }} - SSH_USER: ${{ secrets.SSH_USER }} - SSH_HOST: ${{ secrets.SSH_HOST }} - SSH_PORT: ${{ secrets.SSH_PORT }} + - name: 📤 Upload Jar + uses: actions/upload-artifact@v4 + with: + name: Documentation + path: ./projects/web/build/site/ diff --git a/projects/web/build.gradle.kts b/projects/web/build.gradle.kts index 19d83ceb4..887cd4f04 100644 --- a/projects/web/build.gradle.kts +++ b/projects/web/build.gradle.kts @@ -145,6 +145,8 @@ val docWebsite by tasks.registering(Copy::class) { from(illuaminateDocs) { exclude("**/*.html") } // And item/block images from the data export from(file("src/htmlTransform/export/items")) { into("images/items") } + // Add the common-api (and core-api) javadoc + from(project(":common-api").tasks.named("javadoc")) { into("javadoc") } into(layout.buildDirectory.dir("site")) }