mirror of
https://github.com/BX-Team/DivineMC.git
synced 2025-12-19 23:09:26 +00:00
Merge pull request #10 from HaHaWTH/ver/1.20.4
Add auto update Purpur commit workflow
This commit is contained in:
48
.github/workflows/automatic-update.yml
vendored
Normal file
48
.github/workflows/automatic-update.yml
vendored
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
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 user.name "HaHaWTH"
|
||||||
|
git config user.email HaHaWTH@users.noreply.github.com
|
||||||
|
git commit -m "Updated Upstream (Purpur)"
|
||||||
|
git push
|
||||||
|
else
|
||||||
|
echo "No changes to commit."
|
||||||
|
fi
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
group = gq.bxteam.divinemc
|
group = gq.bxteam.divinemc
|
||||||
|
|
||||||
version = 1.20.4-R0.1-SNAPSHOT
|
version = 1.20.4-R0.1-SNAPSHOT
|
||||||
purpurRef = 9e1216de506439171c08773730faea0f0a617a83
|
purpurRef = eb3b67d5b277d279c4ff67322a49fc5f0764ad82
|
||||||
|
|
||||||
org.gradle.caching = true
|
org.gradle.caching = true
|
||||||
org.gradle.parallel = true
|
org.gradle.parallel = true
|
||||||
|
|||||||
Reference in New Issue
Block a user