Updated message from maintainer #239
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: build and upload plugins | |
on: [push, workflow_dispatch] | |
defaults: | |
run: | |
working-directory: plugins | |
jobs: | |
build_and_upload_plugins: | |
runs-on: ubuntu-20.04 | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Setup required packages | |
run: | | |
sudo apt update | |
sudo apt install --yes fakeroot bridge-utils pipenv | |
- name: Set up yq - portable yaml processor | |
run: | | |
sudo wget https://github.com/mikefarah/yq/releases/download/v4.9.3/yq_linux_amd64 -O /usr/local/bin/yq &&\ | |
sudo chmod +x /usr/local/bin/yq | |
- name: Install Python dependcies with pipenv | |
run: pipenv install | |
- id: changed_files | |
name: Collect changed files | |
# Until "the HEAD commit ahead of base commit" is fixed we switch to a | |
# fork with a fix by Ana06. | |
# https://github.com/jitterbit/get-changed-files/issues/11 | |
# uses: jitterbit/get-changed-files@v1 | |
uses: Ana06/[email protected] | |
# Detect changed Coinboot plugin creation files and trigger build only for these. | |
# Omit all upstream code directories and only use yaml files in "src". | |
- name: Build Coinboot plugins with Coinbootmaker and upload to object storage | |
if: github.ref == 'refs/heads/main' | |
run: | | |
for plugin in ${{ steps.changed_files.outputs.added_modified }}; do | |
if [[ "$plugin" != */upstream/* ]]; then | |
if [[ "$plugin" == *.yaml ]] && [[ "$plugin" == *plugins/src* ]]; then | |
echo "Changes in $plugin, triggering build..." | |
pipenv run ./coinbootmaker_helper create plugin $plugin --upload | |
fi | |
fi | |
done | |
- name: Build Coinboot plugins with Coinbootmaker | |
if: github.ref != 'refs/heads/main' | |
run: | | |
for plugin in ${{ steps.changed_files.outputs.added_modified }}; do | |
if [[ "$plugin" != */upstream/* ]]; then | |
if [[ "$plugin" == *.yaml ]] && [[ "$plugin" == *plugins/src* ]]; then | |
echo "Changes in $plugin, triggering build..." | |
pipenv run ./coinbootmaker_helper create plugin $plugin | |
fi | |
fi | |
done | |
- name: Create README with list of available Coinboot plugins | |
run: | | |
pipenv run ./coinbootmaker_helper create readme | |
cat README.md | |
- name: List build artifacts | |
run: | | |
ls -la build | |
- name: Push automatic changes on README.md | |
uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Apply automatic changes of Coinboot plugin table [skip ci] | |
file_pattern: plugins/README.md |