9
0
mirror of https://github.com/BX-Team/DivineMC.git synced 2025-12-27 10:49:14 +00:00
Files
DivineMC/.github/workflows/automatic-update.yml
NONPLAYT 9a892d0c1d Updated Upstream (Purpur)
Upstream has released updates that appear to apply and compile correctly

Purpur Changes:
PurpurMC/Purpur@6aec125 Updated Upstream (Paper)
2023-12-26 00:36:48 +03:00

48 lines
1.4 KiB
YAML

name: Automatically update Purpur commit hash
on:
workflow_dispatch: {}
schedule:
- cron: "0 0 * * *"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout DivineMC Repository
uses: actions/checkout@v3
with:
path: 'DivineMC'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout Purpur Repository
uses: actions/checkout@v3
with:
path: 'Purpur'
repository: "PurpurMC/Purpur"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Get Purpur Latest Commit Hash
id: purpurRef
run: |
ls
cd Purpur
echo "::set-output name=purpurRef::$(git rev-parse HEAD)"
cd ..
- name: Update purpurRef in DivineMC
run: |
cd DivineMC
sed -i "s/\(purpurRef\s*=\s*\).*/\1$PAPER_REF/" gradle.properties
env:
PAPER_REF: ${{ steps.purpurRef.outputs.purpurRef }}
- name: Check for changes and Write to repository
run: |
cd DivineMC
if ! git diff --quiet; then
git add gradle.properties
git config --global user.email "no-reply@github.com" && git config --global user.name "Github Actions"
git commit -m "Updated Upstream (Purpur)"
git push
else
echo "No changes to commit."
fi