diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..464251e --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,34 @@ +name: Main +on: + push: + pull_request: + workflow_dispatch: + workflow_run: + types: + - completed + workflows: + - "Update WIT" + +permissions: + contents: write + pull-requests: write + +jobs: + main: + name: Build, test, and release + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + submodules: true + + - name: Set up Java/Kotlin + uses: actions/setup-java@v6 + with: + distribution: liberica + java-version: "25" + + - name: Build example plugin to test + run: | + ./gradlew build --no-daemon diff --git a/.github/workflows/update-wit.yml b/.github/workflows/update-wit.yml new file mode 100644 index 0000000..cd8ce09 --- /dev/null +++ b/.github/workflows/update-wit.yml @@ -0,0 +1,39 @@ +name: Update WIT +on: + workflow_dispatch: + +permissions: + contents: write + +jobs: + update-wit: + name: Update WIT + runs-on: ubuntu-slim + steps: + - name: Checkout + uses: actions/checkout@v6 + with: + submodules: true + - name: Update submodule + id: update_submodule + run: | + set -eux + + cd wit + git fetch origin master + git checkout FETCH_HEAD + + echo "wit_commit=$(git rev-parse --short HEAD)" >> $GITHUB_OUTPUT + + - name: Commit + run: | + set -eux + + witCommit='${{ steps.update_submodule.outputs.wit_commit }}' + + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + + git add wit + git commit -m "Sync to Pumpkin-MC/pumpkin-plugin-wit@${witCommit}" + git push