Skip to content

Commit

Permalink
Add workflow for updating LibGui docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Juuxel committed Sep 26, 2023
1 parent 5b56575 commit bb58ec3
Showing 1 changed file with 45 additions and 0 deletions.
45 changes: 45 additions & 0 deletions .github/workflows/update_libgui.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Update LibGui docs
on: workflow_dispatch
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Check out docs repository
uses: actions/checkout@v4
with:
path: docs
- name: Find latest LibGui release
run: |
gh api repos/CottonMC/LibGui/releases/latest > latest.json
latest_name=$(cat latest.json | jq -r '.name')
latest_tag=$(cat latest.json | jq -r '.tag_name')
echo "latest-name=$latest_name" >> GITHUB_OUTPUT
echo "latest-tag=$latest_tag" >> GITHUB_OUTPUT
id: find-latest
- name: Check out LibGui
uses: actions/checkout@v4
with:
path: libgui
ref: ${{steps.find-latest.outputs.latest-tag}}
- name: Set up Java
uses: actions/setup-java@v3
with:
# Minecraft uses the Microsoft JDK builds
distribution: 'microsoft'
java-version: '17'
- name: Build LibGui documentation
run: |
cd libgui
./gradlew :javadoc
- name: Move docs
run: |
rm -rf docs/libgui/*
cp -R libgui/build/docs/javadoc/ docs/libgui
- name: Commit docs
run: |
cd docs
git config user.name "github-actions[bot]"
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add libgui
git commit --allow-empty -m "LibGui ${{steps.find-latest.outputs.latest-name}}"
git push

0 comments on commit bb58ec3

Please sign in to comment.