Skip to content

Commit

Permalink
Setup workflows for CF pages (#13)
Browse files Browse the repository at this point in the history
* Setup workflows for CF pages

* Copy javadoc to html subfolder

* Also trigger on push for main deploy

* Setup new action for specific brances

* Stuff

* Different ref name for push actin

* Differnt name?

* Right, nothing in these folders changed

* Prod docs would get updated

* Update some docs

* Add workflow dispatch to be safe
  • Loading branch information
duncte123 authored Dec 17, 2023
1 parent 64f8b44 commit 26e789b
Show file tree
Hide file tree
Showing 5 changed files with 97 additions and 1 deletion.
45 changes: 45 additions & 0 deletions .github/workflows/docs-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Docs PR

on:
pull_request_target:
branches: [ '**' ]
paths:
- 'dokka/**'
- 'src/main/**'
- '.github/workflows/docs-pr.yml'

concurrency:
group: pages
cancel-in-progress: true

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- uses: actions/checkout@v3
with:
ref: "${{ github.event.pull_request.merge_commit_sha }}"
fetch-depth: 0
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: zulu
cache: gradle
- name: Build docs
run: ./gradlew --no-daemon dokkaHtml dokkaJavadoc
- name: Copy javadoc subfolder
run: mv build/dokka/javadoc build/dokka/html/
- uses: actions/upload-pages-artifact@v1
with:
path: 'build/dokka/html'
- uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ vars.CLOUDFLARE_PROJECT_NAME }}
directory: build/dokka/html
branch: pr-${{ github.event.pull_request.number }}
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
41 changes: 41 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: Docs Push

on:
release:
types: [ published ]
workflow_dispatch: {}

concurrency:
group: pages-${{ github.ref }}
cancel-in-progress: true

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: read
deployments: write
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: actions/setup-java@v4
with:
java-version: 17
distribution: zulu
cache: gradle
- name: Build docs
run: ./gradlew --no-daemon dokkaHtml dokkaJavadoc
- name: Copy javadoc subfolder
run: mv build/dokka/javadoc build/dokka/html/
- uses: actions/upload-pages-artifact@v1
with:
path: 'build/dokka/html'
- uses: cloudflare/pages-action@v1
with:
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
projectName: ${{ vars.CLOUDFLARE_PROJECT_NAME }}
directory: build/dokka/html
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
wranglerVersion: '3'
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,11 @@ Feature overview:

Current version (remove the `v` prefix): ![Latest version][VERSION]

Or copy/download it [here](https://maven.arbjerg.dev/#/snapshots/dev/arbjerg/lavalink-client)
Or copy/download it [here](https://maven.arbjerg.dev/#/releases/dev/arbjerg/lavalink-client)

Documentation can be found over at [https://client.lavalink.dev/](https://client.lavalink.dev/)

If you prefer javadoc-style documentation, you can find those [here](https://client.lavalink.dev/javadoc/)

### Gradle instructions
```gradle
Expand Down
3 changes: 3 additions & 0 deletions src/main/kotlin/dev/arbjerg/lavalink/client/LavalinkNode.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ import java.net.URI
import java.util.function.Consumer
import java.util.function.UnaryOperator

/**
* The Node is a physical instance of the lavalink server software.
*/
class LavalinkNode(
val name: String,
serverUri: URI,
Expand Down
3 changes: 3 additions & 0 deletions src/main/kotlin/dev/arbjerg/lavalink/client/LavalinkPlayer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import dev.arbjerg.lavalink.protocol.v4.PlayerState
import dev.arbjerg.lavalink.protocol.v4.VoiceState
import kotlin.math.min

/**
* Represents a player that is tied to a guild.
*/
class LavalinkPlayer(private val node: LavalinkNode, protocolPlayer: Player) : IUpdatablePlayer {
val guildId = protocolPlayer.guildId.toLong()

Expand Down

0 comments on commit 26e789b

Please sign in to comment.