Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Commit

Permalink
Merge pull request #39 from epinio/update-release-job
Browse files Browse the repository at this point in the history
Update release job to match release-next and build ui from epinio/ui
  • Loading branch information
richard-cox committed Jul 3, 2023
2 parents 81f783a + d8fd3bb commit a81e847
Showing 1 changed file with 43 additions and 7 deletions.
50 changes: 43 additions & 7 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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: ${{ steps.get_tag.outputs.TAG }}
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
Expand Down

0 comments on commit a81e847

Please sign in to comment.