Add NINA FW 2.0.0 (#263) #78
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: Generate Index | |
env: | |
PROJECT_NAME: arduino-fwuploader | |
AWS_REGION: "us-east-1" | |
# 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 | |
environment: production | |
permissions: | |
contents: write | |
id-token: write # This is required for requesting the JWT | |
defaults: | |
run: | |
working-directory: generator | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Install Taskfile | |
uses: arduino/setup-task@v2 | |
- name: Install Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: "3.9" | |
- name: Install Poetry | |
run: pip install poetry | |
- name: Install dependencies | |
run: | | |
cd $GITHUB_WORKSPACE | |
task poetry:install-deps | |
- name: Generate plugin firmware index | |
run: poetry run ./generator.py | |
# 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 plugin firmware index json | |
run: | | |
gpg \ | |
--pinentry-mode=loopback \ | |
--passphrase "${{ secrets.PASSPHRASE }}" \ | |
--output boards/plugin_firmware_index.json.sig \ | |
--detach-sign boards/plugin_firmware_index.json | |
- name: create the gzip | |
run: gzip --keep boards/plugin_firmware_index.json | |
- name: configure aws credentials | |
uses: aws-actions/configure-aws-credentials@v4 | |
with: | |
role-to-assume: ${{ secrets.AWS_ROLE_TO_ASSUME }} | |
role-session-name: "github_${{ env.PROJECT_NAME }}" | |
aws-region: ${{ env.AWS_REGION }} | |
- name: s3 sync | |
run: | | |
aws s3 sync boards/ s3://${{ secrets.DOWNLOADS_BUCKET }}/${{ env.PROJECT_NAME }}/boards | |
aws s3 sync firmwares/ s3://${{ secrets.DOWNLOADS_BUCKET }}/${{ env.PROJECT_NAME }}/firmwares | |
env: | |
AWS_REGION: ${{ env.AWS_REGION }} # or https://github.com/aws/aws-cli/issues/5623 |