-
-
Notifications
You must be signed in to change notification settings - Fork 9
71 lines (62 loc) · 3.03 KB
/
liqi.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: Update Liqi Files
on:
schedule:
- cron: "0 0 * * 0" # Run every Sunday at midnight UTC
workflow_dispatch: # Allow manual triggering
jobs:
update-liqi:
permissions:
pull-requests: write
contents: write
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Get latest AutoLiqi release
id: autoliqi
uses: pozetroninc/github-action-get-latest-release@master
with:
repository: Xerxes-2/AutoLiqi
- name: Read current version
id: current_version
run: echo "version=$(jq -r .liqiVersion liqi_config/settings.json)" >> $GITHUB_OUTPUT
- name: Compare versions
id: compare_versions
run: |
if [ "${{ steps.autoliqi.outputs.release }}" != "${{ steps.current_version.outputs.version }}" ]; then
echo "update_needed=true" >> $GITHUB_OUTPUT
else
echo "update_needed=false" >> $GITHUB_OUTPUT
fi
- name: Download new files
if: steps.compare_versions.outputs.update_needed == 'true'
run: |
curl -LO "https://github.com/Xerxes-2/AutoLiqi/releases/download/${{ steps.autoliqi.outputs.release }}/liqi.desc"
curl -LO "https://github.com/Xerxes-2/AutoLiqi/releases/download/${{ steps.autoliqi.outputs.release }}/liqi.json"
curl -LO "https://github.com/Xerxes-2/AutoLiqi/releases/download/${{ steps.autoliqi.outputs.release }}/liqi.proto"
curl -LO "https://github.com/Xerxes-2/AutoLiqi/releases/download/${{ steps.autoliqi.outputs.release }}/lqc.lqbin"
mv liqi.desc liqi.json lqc.lqbin liqi_config/
mv liqi.proto proto/
- name: Update version in settings files
if: steps.compare_versions.outputs.update_needed == 'true'
run: |
LQBIN_VERSION=$(echo "${{steps.autoliqi.outputs.description}}" | grep "lqc.lqbin" | awk '{print $2}')
jq '.liqiVersion = "${{ steps.autoliqi.outputs.release }}"' liqi_config/settings.json > temp.json && mv temp.json liqi_config/settings.json
jq --arg LQBIN_VERSION "$LQBIN_VERSION" '.version = $LQBIN_VERSION' liqi_config/settings.mod.json > temp.json && mv temp.json liqi_config/settings.mod.json
- name: Create Pull Request
if: steps.compare_versions.outputs.update_needed == 'true'
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update Liqi files to ${{ steps.autoliqi.outputs.release }}
title: Update Liqi files to ${{ steps.autoliqi.outputs.release }}
body: |
This PR updates the Liqi files to the latest version (${{ steps.autoliqi.outputs.release }}) from [AutoLiqi](https://github.com/Xerxes-2/AutoLiqi).
Changes:
- Updated liqi.desc
- Updated liqi.json
- Updated liqi.proto
- Updated lqc.lqbin
- Updated version in settings.json and settings.mod.json
branch: update-liqi-files
base: master