From ce0507ee994ced11e790644b86bcab14f9c8865d Mon Sep 17 00:00:00 2001 From: Carlos Alcaide Corvo Date: Mon, 16 May 2022 12:05:32 -0700 Subject: [PATCH] Update UI artifacts consumption (#2074) Update UI artifacts consumption to allow UI editions --- .github/workflows/build.yml | 26 +++++++++++++++++++++++--- Makefile | 10 ++++++++++ internal/ui/VERSION | 2 +- 3 files changed, 34 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 24fdc6633..1d1e7bf32 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -60,10 +60,28 @@ jobs: project="$(go list -m)" sha="$(git rev-parse HEAD)" echo "::set-output name=ldflags::"-s -w -X \'$project/version.GitCommit=$sha\'"" + + get-product-edition: + runs-on: ubuntu-latest + outputs: + product-edition: ${{ steps.get-product-edition.outputs.product-edition}} + steps: + - uses: actions/checkout@v3 + - name: Setup Go + uses: actions/setup-go@v3 + with: + go-version: "1.18.1" + - name: Get product edition + id: get-product-edition + run: | + make edition + echo "::set-output name=product-edition::$(make edition)" + build-other: needs: - get-product-version + - get-product-edition - set-ld-flags runs-on: ubuntu-latest strategy: @@ -102,7 +120,7 @@ jobs: workflow: build-admin-ui.yaml commit: ${{ steps.set-sha.outputs.sha }} repo: "hashicorp/boundary-ui" - name: admin-ui + name: admin-ui-${{ needs.get-product-edition.outputs.product-edition }} path: internal/ui/.tmp/boundary-ui/ui/admin/dist - name: Go Build env: @@ -124,6 +142,7 @@ jobs: build-linux: needs: - get-product-version + - get-product-edition - set-ld-flags runs-on: ubuntu-latest strategy: @@ -157,7 +176,7 @@ jobs: workflow: build-admin-ui.yaml commit: ${{ steps.set-sha.outputs.sha }} repo: "hashicorp/boundary-ui" - name: admin-ui + name: admin-ui-${{ needs.get-product-edition.outputs.product-edition }} path: internal/ui/.tmp/boundary-ui/ui/admin/dist - name: Go Build env: @@ -209,6 +228,7 @@ jobs: build-darwin: needs: - get-product-version + - get-product-edition - set-ld-flags runs-on: macos-latest strategy: @@ -239,7 +259,7 @@ jobs: workflow: build-admin-ui.yaml commit: ${{ steps.set-sha.outputs.sha }} repo: "hashicorp/boundary-ui" - name: admin-ui + name: admin-ui-${{ needs.get-product-edition.outputs.product-edition }} path: internal/ui/.tmp/boundary-ui/ui/admin/dist - name: Go Build env: diff --git a/Makefile b/Makefile index 3229a1973..0c2502934 100644 --- a/Makefile +++ b/Makefile @@ -323,3 +323,13 @@ ci-verify: # This is used for release builds by .github/workflows/build.yml version: @go run ./cmd/boundary version | awk '/Version Number:/ { print $$3 }' + +EDITION?= +.PHONY: edition +# This is used for release builds by .github/workflows/build.yml +edition: + @if [ -z "$(EDITION)" ]; then \ + go run ./cmd/boundary version -format=json | jq -r '.version_metadata // "oss"'; \ + else \ + echo $(EDITION); \ + fi; \ diff --git a/internal/ui/VERSION b/internal/ui/VERSION index e1c104f63..812447e69 100644 --- a/internal/ui/VERSION +++ b/internal/ui/VERSION @@ -1,4 +1,4 @@ -8545697b430a432bd50c1bde6a080759f803f157 Add toolbar regions to align refresh button to the right (#1098) +7e792d3f7664bf3efdf33a66539022d3f3cdaf4c Refactor UI generated artifacts creation. (#1104) # This file determines the version of the UI to embed in the boundary binary. # Update this file by running 'make update-ui-version' from the root of this repo. # Set UI_COMMITISH when running the above target to update to a specific version.