Skip to content

Commit 26e789b

Browse files
authored
Setup workflows for CF pages (#13)
* 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
1 parent 64f8b44 commit 26e789b

File tree

5 files changed

+97
-1
lines changed

5 files changed

+97
-1
lines changed

.github/workflows/docs-pr.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Docs PR
2+
3+
on:
4+
pull_request_target:
5+
branches: [ '**' ]
6+
paths:
7+
- 'dokka/**'
8+
- 'src/main/**'
9+
- '.github/workflows/docs-pr.yml'
10+
11+
concurrency:
12+
group: pages
13+
cancel-in-progress: true
14+
15+
jobs:
16+
deploy:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: read
20+
deployments: write
21+
steps:
22+
- uses: actions/checkout@v3
23+
with:
24+
ref: "${{ github.event.pull_request.merge_commit_sha }}"
25+
fetch-depth: 0
26+
- uses: actions/setup-java@v4
27+
with:
28+
java-version: 17
29+
distribution: zulu
30+
cache: gradle
31+
- name: Build docs
32+
run: ./gradlew --no-daemon dokkaHtml dokkaJavadoc
33+
- name: Copy javadoc subfolder
34+
run: mv build/dokka/javadoc build/dokka/html/
35+
- uses: actions/upload-pages-artifact@v1
36+
with:
37+
path: 'build/dokka/html'
38+
- uses: cloudflare/pages-action@v1
39+
with:
40+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
41+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
42+
projectName: ${{ vars.CLOUDFLARE_PROJECT_NAME }}
43+
directory: build/dokka/html
44+
branch: pr-${{ github.event.pull_request.number }}
45+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/docs.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
name: Docs Push
2+
3+
on:
4+
release:
5+
types: [ published ]
6+
workflow_dispatch: {}
7+
8+
concurrency:
9+
group: pages-${{ github.ref }}
10+
cancel-in-progress: true
11+
12+
jobs:
13+
deploy:
14+
runs-on: ubuntu-latest
15+
permissions:
16+
contents: read
17+
deployments: write
18+
steps:
19+
- uses: actions/checkout@v3
20+
with:
21+
fetch-depth: 0
22+
- uses: actions/setup-java@v4
23+
with:
24+
java-version: 17
25+
distribution: zulu
26+
cache: gradle
27+
- name: Build docs
28+
run: ./gradlew --no-daemon dokkaHtml dokkaJavadoc
29+
- name: Copy javadoc subfolder
30+
run: mv build/dokka/javadoc build/dokka/html/
31+
- uses: actions/upload-pages-artifact@v1
32+
with:
33+
path: 'build/dokka/html'
34+
- uses: cloudflare/pages-action@v1
35+
with:
36+
apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }}
37+
accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
38+
projectName: ${{ vars.CLOUDFLARE_PROJECT_NAME }}
39+
directory: build/dokka/html
40+
gitHubToken: ${{ secrets.GITHUB_TOKEN }}
41+
wranglerVersion: '3'

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,11 @@ Feature overview:
1616

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

19-
Or copy/download it [here](https://maven.arbjerg.dev/#/snapshots/dev/arbjerg/lavalink-client)
19+
Or copy/download it [here](https://maven.arbjerg.dev/#/releases/dev/arbjerg/lavalink-client)
20+
21+
Documentation can be found over at [https://client.lavalink.dev/](https://client.lavalink.dev/)
22+
23+
If you prefer javadoc-style documentation, you can find those [here](https://client.lavalink.dev/javadoc/)
2024

2125
### Gradle instructions
2226
```gradle

src/main/kotlin/dev/arbjerg/lavalink/client/LavalinkNode.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ import java.net.URI
3131
import java.util.function.Consumer
3232
import java.util.function.UnaryOperator
3333

34+
/**
35+
* The Node is a physical instance of the lavalink server software.
36+
*/
3437
class LavalinkNode(
3538
val name: String,
3639
serverUri: URI,

src/main/kotlin/dev/arbjerg/lavalink/client/LavalinkPlayer.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ import dev.arbjerg.lavalink.protocol.v4.PlayerState
88
import dev.arbjerg.lavalink.protocol.v4.VoiceState
99
import kotlin.math.min
1010

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

0 commit comments

Comments
 (0)