-
Notifications
You must be signed in to change notification settings - Fork 3
57 lines (54 loc) · 1.81 KB
/
check-and-upgrade.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
name: Check the new version of Tixati and upgrade
on:
schedule:
- cron: '45 6 * * *'
push:
branches:
- dev-master
paths:
- .github/workflows/check-and-upgrade.yml
jobs:
run:
uses: kyzima-spb/gh-actions/.github/workflows/bump-version.yml@master
permissions:
contents: write
pull-requests: write
secrets:
github-token: ${{ secrets.GITHUB_TOKEN }}
with:
commit-message: "Bump Tixati from {current} to {latest}"
get-current-release-command: |
jq -r '.include[] | select(.latest == true) | .version' .github/matrix.json
get-latest-release-command: |
wget -qO- https://www.tixati.com/download | grep 'Now Available!' | grep -oP '(?<=Version )\d+(\.\d+)?'
patch-files-command: |
perl -i -pe 's|(?<=TIXATI_VERSION=")[^"]+|'${LATEST_VERSION}'|' docker/Dockerfile
pushd .github
jq --arg version "$LATEST_VERSION" '
.version += [$version]
| (.include[] | select(.latest == true) | .version) = $version
' matrix.json | tee matrix.tmp.json && mv matrix.tmp.json matrix.json
popd
backup:
needs: run
if: ${{ !fromJSON(needs.run.outputs.is-latest) }}
runs-on: ubuntu-latest
env:
LOCAL_DIR: ./downloads/
steps:
-
name: Checkout
uses: actions/checkout@v4
-
name: Download latest Tixati releases
run: |
bash scripts/download.sh "${{ fromJSON(needs.run.outputs.latest-version) }}" "${{ env.LOCAL_DIR }}"
-
name: Backup to FTP Server
uses: SamKirkland/[email protected]
with:
protocol: ftps
server: ${{ secrets.FTP_HOST }}
username: ${{ secrets.FTP_USER }}
password: ${{ secrets.FTP_PASSWORD }}
local-dir: ${{ env.LOCAL_DIR }}