From a9c64b01ca1b02807c497417623b6c3a77521d3f Mon Sep 17 00:00:00 2001 From: Richard Cox Date: Mon, 3 Jul 2023 14:20:14 +0100 Subject: [PATCH 1/2] Update release job to match release-next and build ui from epinio/ui --- .github/workflows/release.yml | 50 ++++++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 7 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index bc8846d32b..5f784c70f7 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -4,11 +4,15 @@ on: push: tags: - "v*" + workflow_dispatch: + inputs: + ui_bundle_url: + description: "ui_bundle_url" + required: false + type: string env: SETUP_GO_VERSION: '1.18' - # change this to embed a different UI dashboard - UI_BUNDLE_URL: https://github.com/rancher/dashboard/releases/download/epinio-standalone-v1.8.1-0.0.1/rancher-dashboard-epinio-standalone-embed.tar.gz jobs: release: @@ -44,22 +48,54 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - + name: Get current tag + id: get_tag + run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT + # if the ui_bundle_url is defined download and unpack the dashboard - name: Download dashboard + if: ${{ github.event.inputs.ui_bundle_url != '' }} run: | mkdir ui - wget "${{ env.UI_BUNDLE_URL }}" + wget "${{ github.event.inputs.ui_bundle_url }}" tar xfz *.tar.gz -C ui + # otherwise fetch and build the latest dashboard from the repository - - name: Get current tag - id: get_tag - run: echo "TAG=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT + name: Checkout Rancher Dashboard UI + if: ${{ github.event.inputs.ui_bundle_url == '' }} + uses: actions/checkout@v3 + with: + repository: epinio/ui + ref: main + submodules: recursive + fetch-depth: 0 + path: epinio-ui + - + name: Build Epinio dashboard + if: ${{ github.event.inputs.ui_bundle_url == '' }} + # go to the repo's directory, build the ui, move the build to `ui` in the workflow root (as per location when downloading from url) + run: | + pushd epinio-ui + ./.github/workflows/scripts/build-ui.sh + mv dashboard/$OUTPUT_DIR/$ARTIFACT_NAME ../ui + popd + rm -rf epinio-ui + env: + RANCHER_ENV: epinio + EXCLUDES_PKG: rancher-components,harvester + EXCLUDE_OPERATOR_PKG: true + OUTPUT_DIR: dist + RELEASE_DIR: release + ARTIFACT_NAME: rancher-dashboard-epinio-standalone + NODE_OPTIONS: "--max-old-space-size=4096" + LOGIN_LOCALE_SELECTOR: false - name: Run GoReleaser Cross run: ./build/bk-release.sh release --rm-dist env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - UI_BUNDLE_URL: "${{ env.UI_BUNDLE_URL }}" + UI_BUNDLE_URL: "${{ github.event.inputs.ui_bundle_url }}" # The "id-token: write" permission for the OIDC will set the ACTIONS_ID_TOKEN_REQUEST_URL and ACTIONS_ID_TOKEN_REQUEST_TOKEN # environment variables. Since we are running goreleaser-cross from a Docker image we need to pass those to the script and the container. # See: https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect#updating-your-actions-for-oidc From d8fd3bbc5a72401bb6d091c6114502f6308c6002 Mon Sep 17 00:00:00 2001 From: Richard Cox Date: Mon, 3 Jul 2023 14:40:03 +0100 Subject: [PATCH 2/2] Fix git ref for pulling epinio/ui code --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 5f784c70f7..3cf07b8f60 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -67,7 +67,7 @@ jobs: uses: actions/checkout@v3 with: repository: epinio/ui - ref: main + ref: ${{ steps.get_tag.outputs.TAG }} submodules: recursive fetch-depth: 0 path: epinio-ui