Skip to content

Update dependencies #2627

Update dependencies

Update dependencies #2627

Workflow file for this run

name: Update dependencies
on:
schedule:
- cron: '17 */6 * * *' # every 30min
workflow_dispatch: # allow manual run if needed
push:
branches: [ main ]
paths:
- 'manifest.json'
permissions:
contents: write
actions: write
issues: write
jobs:
sync:
if: github.actor != 'github-actions[bot]' || github.event_name == 'schedule'
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.x'
- name: Install Python libraries
run: |
pip install requests packaging toml colorama
- name: Run dependency updater
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_REPOSITORY: ${{ github.repository }}
THUNDERSTORE_TEAM: ${{ vars.THUNDERSTORE_TEAM }}
run: |
python update_dependencies.py
- name: Read new version
id: get-version
run: echo "VERSION=$(cat version.txt)" >> $GITHUB_ENV
- name: Commit and push changes
if: env.VERSION != ''
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add manifest.json thunderstore.toml .dependencies_snapshot.json CHANGELOG.md
git diff --cached --quiet || git commit -m "chore: update dependencies and bump to v${{ env.VERSION }}"
git push
- name: Create and push Git tag
if: env.VERSION != ''
run: |
git fetch --tags
git tag v${{ env.VERSION }}
git push origin v${{ env.VERSION }}
- name: Trigger Publish and Release Workflow
if: env.VERSION != ''
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "🚀 Triggering Publish Workflow..."
curl -X POST \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer $GH_TOKEN" \
https://api.github.com/repos/${{ github.repository }}/actions/workflows/publish.yml/dispatches \
-d "{\"ref\":\"v${{ env.VERSION }}\"}"