9
0
mirror of https://github.com/Winds-Studio/Leaf.git synced 2025-12-29 03:49:21 +00:00
Files
Leaf/.github/workflows/auto-update.yml
DGun Otto 1fa323987a Fix workflow (#15)
* Create auto-update.yml

* Update auto-update.yml

* Update auto-update.yml

* Updated Upstream (Gale)

* Update auto-update.yml

* Update auto-update.yml

* Updated Upstream (Gale)

* Update auto-update.yml

* Update gradle.properties

* Updated Upstream (Gale)

* test

* Updated Upstream (Gale)

* Update auto-update.yml

* test

* Updated Upstream (Gale)

* Update auto-update.yml

* test

* Update auto-update.yml

* Update auto-update.yml

* Update auto-update.yml

* Updated Upstream (Gale)

* Update auto-update.yml

* Update auto-update.yml

* Update auto-update.yml

* Update auto-update.yml

* Update auto-update.yml

* Update gradle.properties

---------

Co-authored-by: HaHaWTH <HaHaWTH@users.noreply.github.com>
Co-authored-by: Dreeam <61569423+Dreeam-qwq@users.noreply.github.com>
2023-12-17 20:41:25 -05:00

66 lines
1.8 KiB
YAML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: Automatically update Gale commit hash
on:
workflow_dispatch: {}
schedule:
- cron: "0 0 * * *"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Leaf Repository
uses: actions/checkout@v3
with:
path: 'Leaf'
token: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout Gale Repository
uses: actions/checkout@v3
with:
path: 'Gale'
repository: "Dreeam-qwq/Gale"
token: ${{ secrets.GITHUB_TOKEN }}
- name: Get Gale Latest Commit Hash
id: galeCommit
run: |
ls
cd Gale
echo "::set-output name=galeCommit::$(git rev-parse HEAD)"
cd ..
- name: Update galeCommit in Leaf 
run: |
cd Leaf
sed -i "s/\(galeCommit\s*=\s*\).*/\1$PAPER_REF/" gradle.properties
env:
PAPER_REF: ${{ steps.galeCommit.outputs.galeCommit }}
- name: Grant execute permission for gradlew
run: |
cd Leaf
chmod +x gradlew
- name: Running tests before push
run: |
cd Leaf
if ! git diff --quiet; then
echo "Running tests...."
./gradlew applyPatches
./gradlew createReobfPaperclipJar
fi
- name: Check for changes and Write to repository
run: |
cd Leaf
if ! git diff --quiet; then
echo "Writing to repo....."
git add gradle.properties
git config --global user.name "github-actions"
git config --global user.email no-reply@github.com
git commit -m "Updated Upstream (Gale)"
git push
else
echo "No changes to commit."
fi