-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from processing/update-workflow
add update workflow
- Loading branch information
Showing
2 changed files
with
59 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
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