Periodic Data Update #38
This file contains hidden or 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: Periodic Data Update | |
on: | |
schedule: | |
- cron: '0 * * * *' | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
update-data: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install swiftly | |
run: | | |
sudo apt-get -y install libcurl4-openssl-dev pkg-config python3-lldb-13 | |
curl -L -o /tmp/swiftly.tar.gz https://download.swift.org/swiftly/linux/swiftly-0.4.0-x86_64.tar.gz | |
tar -xzf /tmp/swiftly.tar.gz -C /usr/local/bin/ | |
swiftly init -y --skip-install | |
- name: Run data update scripts | |
run: | | |
source "$HOME/.local/share/swiftly/env.sh" | |
python ./tools/update-builds.py | |
python ./tools/update-tag-by-version.py | |
- name: Commit changes if there are any | |
run: | | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git add v1/ | |
git diff --quiet && git diff --staged --quiet || git commit -m "Automatic data update $(date +'%Y-%m-%d %H:%M:%S')" | |
git push |