Check the new version of Tixati and upgrade #708
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 'Download Tixati v' | grep -oP '(?<=v)\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 }} |