Skip to content

Fix workflow

Fix workflow #31

Workflow file for this run

name: Export Dynamic Plugin Packages
on:
workflow_dispatch:
inputs:
node-version:
description: node-version to execute the export
required: false
type: choice
default: '20.x'
options:
- '18.x'
- '20.x'
upload-project-on-error:
description: Upload the complete project as a workflow artifact in case of error in order to troubleshoot.
required: false
type: boolean
default: false
push:
tags: ["v*.*.*"]
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
jobs:
prepare:
runs-on: ubuntu-latest
name: Prepare
outputs:
node-version: ${{ steps.set-env-vars.outputs.NODE_VERSION }}
workspaces: ${{ steps.gather-workspaces.outputs.workspaces }}
upload-project-on-error: ${{ steps.set-env-vars.outputs.UPLOAD_PROJECT_ON_ERROR }}
steps:
- name: Set environment variables
id: set-env-vars
shell: bash
run: |
if [[ "${{ github.event.inputs.node-version }}" != "" ]]
then
echo "NODE_VERSION=${{ github.event.inputs.node-version }}" >> $GITHUB_OUTPUT
echo "UPLOAD_PROJECT_ON_ERROR='${{ github.event.inputs.upload-project-on-error }}'" >> $GITHUB_OUTPUT
else
echo "NODE_VERSION=20.x" >> $GITHUB_OUTPUT
echo "UPLOAD_PROJECT_ON_ERROR='false'" >> $GITHUB_OUTPUT
fi
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Gather workspaces
id: gather-workspaces
shell: bash
run: |
json=$(
echo -n '['
for d in $(find workspaces -mindepth 1 -type d)
do
if [[ -f "${d}/plugins-list.yaml" ]] && [[ -f "${d}/ref" ]]
then
echo -n "${comma} {\"plugins-root\": \"${d}\", \"plugins-repo-ref\": \"$(cat ${d}/ref)\"}"
comma=','
fi
done
echo -n ']'
)
echo "Workspaces to export:"
echo "$json"
echo "workspaces=${json}" >> $GITHUB_OUTPUT
export:
needs: prepare
uses: davidfestal/rhdh-plugin-export-utils/.github/workflows/export-dynamic.yaml@better-troubleshooting
strategy:
fail-fast: false
matrix:
workspace: ${{ fromJSON(needs.prepare.outputs.workspaces) }}
with:
plugins-repo: backstage/community-plugins
plugins-repo-ref: ${{ matrix.workspace.plugins-repo-ref }}
plugins-root: ${{ matrix.workspace.plugins-root }}
overlay-repo: ${{ github.repository }}
overlay-repo-ref: ${{ github.ref_name }}
node-version: ${{ needs.prepare.outputs.node-version }}
upload-project-on-error: ${{ needs.prepare.outputs.upload-project-on-error == 'true' }}
publish-release-assets: ${{ github.ref_type == 'tag' && github.event == 'push' }}
permissions:
contents: write