Update Libraries/Contributing Info #1832
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
name: Update Libraries/Contributing Info | |
on: | |
schedule: | |
- cron: 15 9 * * * | |
workflow_dispatch: | |
jobs: | |
check-repo-owner: | |
# This job is so the entire workflow will end successfully and give some | |
# output to explain why it hasn't run on a non-Adafruit fork. | |
runs-on: ubuntu-latest | |
steps: | |
- name: repository | |
env: | |
OWNER_IS_ADAFRUIT: ${{ startswith(github.repository, 'adafruit/') }} | |
run: | | |
echo "This workflow will only run if Adafruit is the repository owner." | |
echo "Repository owner is Adafruit: $OWNER_IS_ADAFRUIT" | |
update-bundles: | |
runs-on: ubuntu-latest | |
# Only run the build on Adafruit's repository. Forks won't have the secrets. | |
# Its necessary to do this here, since 'schedule' events cannot (currently) | |
# be limited (they run on all forks' default branches). | |
if: startswith(github.repository, 'adafruit/') | |
steps: | |
- name: Dump GitHub context | |
env: | |
GITHUB_CONTEXT: ${{ toJson(github) }} | |
run: echo "$GITHUB_CONTEXT" | |
- name: Set up Python 3.x | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.9 | |
- name: Versions | |
run: | | |
python3 --version | |
- uses: actions/checkout@v4 | |
with: | |
show-progress: false | |
submodules: true | |
- name: Install deps | |
run: | | |
pip install -r adabot/requirements.txt | |
- name: Pip install pylint | |
run: | | |
pip install --force-reinstall pylint==2.7.1 | |
- name: Make Directory For Report Files | |
run: mkdir -p bin/adabot | |
- name: Run adabot.update_cp_org_libraries | |
env: | |
ADABOT_GITHUB_USER: ${{ secrets.ADABOT_GITHUB_USER }} | |
ADABOT_GITHUB_ACCESS_TOKEN: ${{ secrets.ADABOT_GITHUB_ACCESS_TOKEN }} | |
RTD_TOKEN: ${{ secrets.RTD_TOKEN }} | |
run: | | |
cd adabot | |
python3 -u -m adabot.update_cp_org_libraries -o $GITHUB_WORKSPACE/bin/adabot/libraries.v2.json | |
- name: Check For Files | |
run: | | |
ls bin/adabot | |
- name: Upload Reports To AWS S3 | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
run: "[ -z \"$AWS_ACCESS_KEY_ID\" ] || aws s3 cp bin/adabot/ s3://adafruit-circuit-python/adabot/web/ --recursive --no-progress --region us-east-1" |