From 08675fef4d7509c11198342706055fb4f25de193 Mon Sep 17 00:00:00 2001 From: Claudine Date: Tue, 29 Oct 2024 16:02:21 +0000 Subject: [PATCH] add update workflow --- .github/workflows/update_contributions.yml | 57 ++++++++++++++++++++++ README.md | 4 +- 2 files changed, 59 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/update_contributions.yml diff --git a/.github/workflows/update_contributions.yml b/.github/workflows/update_contributions.yml new file mode 100644 index 0000000..9945bc9 --- /dev/null +++ b/.github/workflows/update_contributions.yml @@ -0,0 +1,57 @@ +name: Update Contributions +on: + push: + branches: + - main + schedule: + # * is a special character in YAML so you have to quote this string + - cron: '45 4 * * *' + workflow_dispatch: +permissions: + contents: write + +jobs: + update: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + - name: Setup Python + uses: actions/setup-python@v5 + with: + python-version: 3.x + + - name: Install dependencies + run: pip install -r requirements.txt + + - name: fetch updates and edit database + run: | + cd scripts + python fetch_updates.py + + - name: commit changes + uses: stefanzweifel/git-auto-commit-action@v5 + with: + commit_message: chore(CI) update contributions to database and output files + branch: main + add_options: '-u' + + - name: Get current date + id: date + run: echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV + + - name: update output files + run: | + python to_contribs_txt.py + python to_sources_jsons.py + cd .. + + - uses: actions/upload-artifact@v4 + with: + name: output-files-${{ env.DATE }} + overwrite: true + path: | + pde/contribs.txt + sources/*.json + diff --git a/README.md b/README.md index 64272d6..a7aab6b 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # [WIP] processing-contributions -[!WARNING] -This repository is a work in progress. +> [!WARNING] +> This repository is a work in progress. This repository maintains the contributions to Processing.