42 lines
1.2 KiB
YAML
42 lines
1.2 KiB
YAML
name: Update Library
|
|
|
|
on:
|
|
# push:
|
|
# branches:
|
|
# - main
|
|
schedule: # run 25 mins after jlcpcb-parts-database
|
|
- cron: "00 6 * * *"
|
|
workflow_dispatch: # allow for manually trigger workflow
|
|
|
|
jobs:
|
|
update-library-from-database:
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
# Give the default GITHUB_TOKEN write permission to commit and push the
|
|
# added or changed files to the repository.
|
|
contents: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ github.head_ref }}
|
|
|
|
- uses: actions/setup-python@v5
|
|
with:
|
|
python-version: '3.13'
|
|
cache: 'pip' # caching pip dependencies
|
|
- run: pip install -r requirements.txt
|
|
- run: python libraryCreatorScript.py
|
|
|
|
# Commit all changed files back to the repository
|
|
- uses: stefanzweifel/git-auto-commit-action@v5
|
|
|
|
- name: Get current date
|
|
run: echo "CURRENT_DATE=$(date +'%Y.%m.%d')" >> $GITHUB_ENV
|
|
|
|
- uses: softprops/action-gh-release@v2
|
|
with:
|
|
name: ${{ env.CURRENT_DATE }}
|
|
tag_name: ${{ env.CURRENT_DATE }}
|
|
files: JLCPCB-KiCad-Library-${{ env.CURRENT_DATE }}.zip
|