Skip to content

Merge pull request #169 from per1234/bump-website-deps #51

Merge pull request #169 from per1234/bump-website-deps

Merge pull request #169 from per1234/bump-website-deps #51

name: Generate Index
# See: https://docs.github.com/en/actions/reference/events-that-trigger-workflows
on:
push:
branches:
- main
paths:
- "generator/**"
- "firmwares/**"
- "poetry.lock"
- "pyproject.toml"
- ".github/workflows/generate-index.yml"
workflow_dispatch:
repository_dispatch:
jobs:
generate-index:
runs-on: ubuntu-latest
defaults:
run:
working-directory: generator
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Install Taskfile
uses: arduino/setup-task@v1
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Install Poetry
run: pip install poetry
- name: Install Arduino CLI
uses: arduino/setup-arduino-cli@v1
- name: Install platforms
run: |
arduino-cli core update-index -v
arduino-cli version
arduino-cli core install arduino:samd@${{ env.SAMD_V }} -v
arduino-cli core install arduino:megaavr@${{ env.MEGAAVR_V }} -v
arduino-cli core install arduino:mbed_nano@${{ env.MBED_NANO_V }} -v
env:
SAMD_V: 1.8.11
MEGAAVR_V: 1.8.7
MBED_NANO_V: 2.4.1
- name: Install dependencies
run: |
cd $GITHUB_WORKSPACE
task poetry:install-deps
- name: Generate index
run: poetry run ./generator.py -a $(which arduino-cli)
# fix `gpg: signing failed: Inappropriate ioctl for device`
# https://github.com/keybase/keybase-issues/issues/2798
- name: Import GPG key
run: |
echo "${{ secrets.GPG_PRIVATE_KEY }}" | base64 -di > /tmp/private.key
gpg --batch --import --passphrase "${{ secrets.PASSPHRASE }}" /tmp/private.key
echo "GPG_TTY=$(tty)" >> $GITHUB_ENV
# disable gpg pass prompt
# https://stackoverflow.com/questions/49072403/suppress-the-passphrase-prompt-in-gpg-command
- name: sign the json
run: |
gpg \
--pinentry-mode=loopback \
--passphrase "${{ secrets.PASSPHRASE }}" \
--output boards/module_firmware_index.json.sig \
--detach-sign boards/module_firmware_index.json
- name: create the gzip
run: gzip --keep boards/module_firmware_index.json
- name: s3 sync
run: |
aws s3 sync boards/ s3://${{ secrets.DOWNLOADS_BUCKET }}/arduino-fwuploader/boards
aws s3 sync firmwares/ s3://${{ secrets.DOWNLOADS_BUCKET }}/arduino-fwuploader/firmwares
env:
AWS_REGION: "us-east-1" # or https://github.com/aws/aws-cli/issues/5623
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}