From 0bdf7ab1ebfdc211a72a394788cfc892a8eb3388 Mon Sep 17 00:00:00 2001 From: MT Lewis Date: Sun, 14 Apr 2024 21:16:04 +0100 Subject: [PATCH] sync_release-manifest: add yarn-plugin to release directory Since yarn plugins aren't installable via npm, we need a place to make the version available for each release. Since versions.backstage.io already provides an API backed by a git repo organized by release (and even includes release line links), it seems like the perfect spot. This commit adds the yarn plugin to the appropriate directory when the sync_release-management workflow runs, reorganizing the existing functionality for pushing the changes to the versions repo with a little bit of refactoring. Signed-off-by: MT Lewis --- .github/workflows/sync_release-manifest.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/.github/workflows/sync_release-manifest.yml b/.github/workflows/sync_release-manifest.yml index 34bbabcd0b..e7c06747f7 100644 --- a/.github/workflows/sync_release-manifest.yml +++ b/.github/workflows/sync_release-manifest.yml @@ -31,6 +31,10 @@ jobs: path: backstage cache-prefix: ${{ runner.os }}-v18.x + - name: Build yarn plugin + working-directory: backstage/packages/yarn-plugin + run: yarn build + # Checkout backstage/versions into /backstage/versions, which is where store the output - name: Checkout versions uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 @@ -51,6 +55,20 @@ jobs: mkdir -p scripts wget -O scripts/assemble-manifest.js https://raw.githubusercontent.com/backstage/backstage/master/scripts/assemble-manifest.js node scripts/assemble-manifest.js ${{ github.event.client_payload.version }} + + # Copies the build output of the yarn-plugin package to the appropriate + # directory, allowing the plugin to be installed with a command like + # `yarn plugin import https://versions.backstage.io/v1/tags/main/yarn-plugin` + - name: Add yarn plugin to release + working-directory: backstage/packages/yarn-plugin + run: >- + cp + bundles/@yarnpkg/plugin-backstage.js + ../../versions/v1/releases/${{ github.event.client_payload.version }}/yarn-plugin + + - name: Commit to versions repo + working-directory: backstage/versions + run: | cd versions git add . git commit -am "${{ github.event.client_payload.version }}"