From 3f6ece762e180d792adef028177158ef89918ff8 Mon Sep 17 00:00:00 2001 From: Andrew Fiedler Date: Tue, 11 Apr 2023 15:25:26 -0700 Subject: [PATCH 01/18] Add a workflow to build the dist and store it as an artifact --- .../.github/workflows/dist.yml | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 ui-frontend/packages/catalog-ui-search/.github/workflows/dist.yml diff --git a/ui-frontend/packages/catalog-ui-search/.github/workflows/dist.yml b/ui-frontend/packages/catalog-ui-search/.github/workflows/dist.yml new file mode 100644 index 00000000000..eafbc59531e --- /dev/null +++ b/ui-frontend/packages/catalog-ui-search/.github/workflows/dist.yml @@ -0,0 +1,23 @@ +name: Build distribution for downstream consumption +working-directory: ${{ github.workspace }} +on: [push] + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout code + uses: actions/checkout@v2 + + - name: Install dependencies + run: yarn install + + - name: Build project + run: yarn run publish:build + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: my-artifact + path: dist From e09af47fd1e491548d84df34c66323a50457773d Mon Sep 17 00:00:00 2001 From: Andrew Fiedler Date: Tue, 11 Apr 2023 15:31:03 -0700 Subject: [PATCH 02/18] Add working directory --- .../packages/catalog-ui-search/.github/workflows/dist.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-frontend/packages/catalog-ui-search/.github/workflows/dist.yml b/ui-frontend/packages/catalog-ui-search/.github/workflows/dist.yml index eafbc59531e..3a43f6b8147 100644 --- a/ui-frontend/packages/catalog-ui-search/.github/workflows/dist.yml +++ b/ui-frontend/packages/catalog-ui-search/.github/workflows/dist.yml @@ -5,7 +5,7 @@ on: [push] jobs: build: runs-on: ubuntu-latest - + working-directory: ui-frontend/packages/catalog-ui-search steps: - name: Checkout code uses: actions/checkout@v2 From c728d7ce12522610bcc5f64762b935921694c6b6 Mon Sep 17 00:00:00 2001 From: Andrew Fiedler Date: Tue, 11 Apr 2023 15:33:04 -0700 Subject: [PATCH 03/18] Update name --- .../packages/catalog-ui-search/.github/workflows/dist.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ui-frontend/packages/catalog-ui-search/.github/workflows/dist.yml b/ui-frontend/packages/catalog-ui-search/.github/workflows/dist.yml index 3a43f6b8147..f0705d0ad66 100644 --- a/ui-frontend/packages/catalog-ui-search/.github/workflows/dist.yml +++ b/ui-frontend/packages/catalog-ui-search/.github/workflows/dist.yml @@ -1,4 +1,4 @@ -name: Build distribution for downstream consumption +name: dist working-directory: ${{ github.workspace }} on: [push] From bd1ff3ee7f9028d475ca9f74aa834d5a8abdfcc1 Mon Sep 17 00:00:00 2001 From: Andrew Fiedler Date: Tue, 11 Apr 2023 15:37:29 -0700 Subject: [PATCH 04/18] Slight refactoring --- .../catalog-ui-search/.github/workflows/dist.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ui-frontend/packages/catalog-ui-search/.github/workflows/dist.yml b/ui-frontend/packages/catalog-ui-search/.github/workflows/dist.yml index f0705d0ad66..d9367206b13 100644 --- a/ui-frontend/packages/catalog-ui-search/.github/workflows/dist.yml +++ b/ui-frontend/packages/catalog-ui-search/.github/workflows/dist.yml @@ -1,23 +1,26 @@ name: dist working-directory: ${{ github.workspace }} -on: [push] +on: [push, pull_request] jobs: build: runs-on: ubuntu-latest - working-directory: ui-frontend/packages/catalog-ui-search steps: - name: Checkout code uses: actions/checkout@v2 + with: + path: 'ui-frontend' - name: Install dependencies + working-directory: ui-frontend/packages/catalog-ui-search run: yarn install - name: Build project + working-directory: ui-frontend/packages/catalog-ui-search run: yarn run publish:build - name: Upload artifact uses: actions/upload-artifact@v3 with: name: my-artifact - path: dist + path: ui-frontend/packages/catalog-ui-search/dist From a4de4ef6b6205a7cc6d7122d502f35e761cf0671 Mon Sep 17 00:00:00 2001 From: Andrew Fiedler Date: Tue, 11 Apr 2023 15:40:31 -0700 Subject: [PATCH 05/18] change workflow location --- .../catalog-ui-search/.github => .github}/workflows/dist.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {ui-frontend/packages/catalog-ui-search/.github => .github}/workflows/dist.yml (95%) diff --git a/ui-frontend/packages/catalog-ui-search/.github/workflows/dist.yml b/.github/workflows/dist.yml similarity index 95% rename from ui-frontend/packages/catalog-ui-search/.github/workflows/dist.yml rename to .github/workflows/dist.yml index d9367206b13..085560704bb 100644 --- a/ui-frontend/packages/catalog-ui-search/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -9,7 +9,7 @@ jobs: - name: Checkout code uses: actions/checkout@v2 with: - path: 'ui-frontend' + path: "ui-frontend" - name: Install dependencies working-directory: ui-frontend/packages/catalog-ui-search From efab322e61dedd77e5ee062524f2e57418478d67 Mon Sep 17 00:00:00 2001 From: Andrew Fiedler Date: Tue, 11 Apr 2023 15:41:55 -0700 Subject: [PATCH 06/18] change how we set working dir --- .github/workflows/dist.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml index 085560704bb..88ec0f4ec38 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -1,5 +1,4 @@ name: dist -working-directory: ${{ github.workspace }} on: [push, pull_request] jobs: @@ -8,15 +7,14 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 - with: - path: "ui-frontend" + + - name: Change directory + run: cd ui-frontend/packages/catalog-ui-search - name: Install dependencies - working-directory: ui-frontend/packages/catalog-ui-search run: yarn install - name: Build project - working-directory: ui-frontend/packages/catalog-ui-search run: yarn run publish:build - name: Upload artifact From e391c677262787c032167a33a7ca02ba7353b9f5 Mon Sep 17 00:00:00 2001 From: Andrew Fiedler Date: Tue, 11 Apr 2023 15:43:46 -0700 Subject: [PATCH 07/18] Update change dir --- .github/workflows/dist.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml index 88ec0f4ec38..ea4b99277c9 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -9,7 +9,7 @@ jobs: uses: actions/checkout@v2 - name: Change directory - run: cd ui-frontend/packages/catalog-ui-search + run: cd ../../ui-frontend/packages/catalog-ui-search - name: Install dependencies run: yarn install From 39ee32cbd8057c791c9da6714f056ea8f3ca1335 Mon Sep 17 00:00:00 2001 From: Andrew Fiedler Date: Tue, 11 Apr 2023 15:44:38 -0700 Subject: [PATCH 08/18] Update change dir --- .github/workflows/dist.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml index ea4b99277c9..e2da5634642 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -9,7 +9,7 @@ jobs: uses: actions/checkout@v2 - name: Change directory - run: cd ../../ui-frontend/packages/catalog-ui-search + run: cd ddf-ui/ui-frontend/packages/catalog-ui-search - name: Install dependencies run: yarn install From 9a798b6d0809a2a134f42cd1628e1000e93abef9 Mon Sep 17 00:00:00 2001 From: Andrew Fiedler Date: Tue, 11 Apr 2023 15:48:52 -0700 Subject: [PATCH 09/18] change checkout --- .github/workflows/dist.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml index e2da5634642..2dd673e6400 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -1,5 +1,7 @@ name: dist -on: [push, pull_request] +on: + push: + pull_request: jobs: build: @@ -7,8 +9,10 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 + with: + path: "ddf-ui" - - name: Change directory + - name: Change directory to subdirectory run: cd ddf-ui/ui-frontend/packages/catalog-ui-search - name: Install dependencies @@ -21,4 +25,4 @@ jobs: uses: actions/upload-artifact@v3 with: name: my-artifact - path: ui-frontend/packages/catalog-ui-search/dist + path: dist From bb0a4cf375b93d07cda5e7588f83625323050a8f Mon Sep 17 00:00:00 2001 From: Andrew Fiedler Date: Tue, 11 Apr 2023 15:50:04 -0700 Subject: [PATCH 10/18] change working dir --- .github/workflows/dist.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml index 2dd673e6400..5353e2bfd46 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -13,6 +13,7 @@ jobs: path: "ddf-ui" - name: Change directory to subdirectory + working-directory: ddf-ui/ui-frontend/packages/catalog-ui-search run: cd ddf-ui/ui-frontend/packages/catalog-ui-search - name: Install dependencies From 98097a0dd905f86964fa40d25b6fdf0050df750b Mon Sep 17 00:00:00 2001 From: Andrew Fiedler Date: Tue, 11 Apr 2023 15:52:42 -0700 Subject: [PATCH 11/18] Update how we use working dir --- .github/workflows/dist.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml index 5353e2bfd46..970e408e93a 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -12,18 +12,17 @@ jobs: with: path: "ddf-ui" - - name: Change directory to subdirectory - working-directory: ddf-ui/ui-frontend/packages/catalog-ui-search - run: cd ddf-ui/ui-frontend/packages/catalog-ui-search - - name: Install dependencies run: yarn install + working-directory: ./ddf-ui/ui-frontend/packages/catalog-ui-search - name: Build project run: yarn run publish:build + working-directory: ./ddf-ui/ui-frontend/packages/catalog-ui-search - name: Upload artifact uses: actions/upload-artifact@v3 + working-directory: ./ddf-ui/ui-frontend/packages/catalog-ui-search with: name: my-artifact path: dist From 048c35ccd3ce7bd861b30baea1eb4cad17a4ff6d Mon Sep 17 00:00:00 2001 From: Andrew Fiedler Date: Tue, 11 Apr 2023 15:54:23 -0700 Subject: [PATCH 12/18] change working dir --- .github/workflows/dist.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml index 970e408e93a..d6533619d61 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -12,17 +12,17 @@ jobs: with: path: "ddf-ui" + - name: Change directory to subdirectory + run: cd ./ddf-ui/ui-frontend/packages/catalog-ui-search + - name: Install dependencies run: yarn install - working-directory: ./ddf-ui/ui-frontend/packages/catalog-ui-search - name: Build project run: yarn run publish:build - working-directory: ./ddf-ui/ui-frontend/packages/catalog-ui-search - name: Upload artifact uses: actions/upload-artifact@v3 - working-directory: ./ddf-ui/ui-frontend/packages/catalog-ui-search with: name: my-artifact path: dist From 35b35c8389e693cbaca3de03918840f00c657a31 Mon Sep 17 00:00:00 2001 From: Andrew Fiedler Date: Tue, 11 Apr 2023 16:00:50 -0700 Subject: [PATCH 13/18] Update run --- .github/workflows/dist.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml index d6533619d61..1e22df50bd5 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -11,18 +11,18 @@ jobs: uses: actions/checkout@v2 with: path: "ddf-ui" - - - name: Change directory to subdirectory - run: cd ./ddf-ui/ui-frontend/packages/catalog-ui-search - - name: Install dependencies - run: yarn install + run: | + cd ./ddf-ui/ui-frontend/packages/catalog-ui-search + yarn install - name: Build project - run: yarn run publish:build + run: | + cd ./ddf-ui/ui-frontend/packages/catalog-ui-search + yarn run publish:build - name: Upload artifact uses: actions/upload-artifact@v3 with: name: my-artifact - path: dist + path: ./ddf-ui/ui-frontend/packages/catalog-ui-search/dist From 1c9a12292b9047993aadc8c3a0f926dc958b7bc3 Mon Sep 17 00:00:00 2001 From: Andrew Fiedler Date: Tue, 11 Apr 2023 16:07:15 -0700 Subject: [PATCH 14/18] Specify node version --- .github/workflows/dist.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml index 1e22df50bd5..195d17b0806 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -11,6 +11,12 @@ jobs: uses: actions/checkout@v2 with: path: "ddf-ui" + + - name: Set up Node.js + uses: actions/setup-node@v2 + with: + node-version: "16.x" + - name: Install dependencies run: | cd ./ddf-ui/ui-frontend/packages/catalog-ui-search From 5a3fd0b65fb59564e3c136f607e0f67f40c6bbc0 Mon Sep 17 00:00:00 2001 From: Andrew Fiedler Date: Tue, 11 Apr 2023 16:41:25 -0700 Subject: [PATCH 15/18] Update to use packages rather than artifacts --- .github/workflows/dist.yml | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/.github/workflows/dist.yml b/.github/workflows/dist.yml index 195d17b0806..93fccdb23cb 100644 --- a/.github/workflows/dist.yml +++ b/.github/workflows/dist.yml @@ -1,10 +1,13 @@ -name: dist +name: publish-package + on: push: + branches: [main] pull_request: + branches: [main] jobs: - build: + publish: runs-on: ubuntu-latest steps: - name: Checkout code @@ -27,8 +30,10 @@ jobs: cd ./ddf-ui/ui-frontend/packages/catalog-ui-search yarn run publish:build - - name: Upload artifact - uses: actions/upload-artifact@v3 + - name: Publish to GitHub Packages + uses: docker/build-push-action@v2 with: - name: my-artifact - path: ./ddf-ui/ui-frontend/packages/catalog-ui-search/dist + context: ./ddf-ui/ui-frontend/packages/catalog-ui-search/dist + push: true + tags: | + ghcr.io/${{ github.repository_owner }}/${{ github.event.pull_request.head.repo.name }}:${{ github.event.pull_request.number }} From f5f11f90af7f900078700990396b760bd545a49f Mon Sep 17 00:00:00 2001 From: Andrew Fiedler Date: Tue, 11 Apr 2023 16:44:23 -0700 Subject: [PATCH 16/18] Rename file --- .github/workflows/{dist.yml => publish-package.yml} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename .github/workflows/{dist.yml => publish-package.yml} (100%) diff --git a/.github/workflows/dist.yml b/.github/workflows/publish-package.yml similarity index 100% rename from .github/workflows/dist.yml rename to .github/workflows/publish-package.yml From ecdfe5c1d78a684263d6ffa20e7c5b548cc8c704 Mon Sep 17 00:00:00 2001 From: Andrew Fiedler Date: Tue, 11 Apr 2023 16:46:18 -0700 Subject: [PATCH 17/18] Update when to run --- .github/workflows/publish-package.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 93fccdb23cb..153f1255d64 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -1,10 +1,7 @@ name: publish-package on: - push: - branches: [main] pull_request: - branches: [main] jobs: publish: From ebb90a313a28ccdbfb071b20bf53437635217663 Mon Sep 17 00:00:00 2001 From: Andrew Fiedler Date: Tue, 11 Apr 2023 16:59:29 -0700 Subject: [PATCH 18/18] package workflow --- .github/workflows/publish-package.yml | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/.github/workflows/publish-package.yml b/.github/workflows/publish-package.yml index 153f1255d64..c3b9dc8027f 100644 --- a/.github/workflows/publish-package.yml +++ b/.github/workflows/publish-package.yml @@ -27,10 +27,24 @@ jobs: cd ./ddf-ui/ui-frontend/packages/catalog-ui-search yarn run publish:build - - name: Publish to GitHub Packages - uses: docker/build-push-action@v2 + - name: Create Release + id: create_release + uses: actions/create-release@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - context: ./ddf-ui/ui-frontend/packages/catalog-ui-search/dist - push: true - tags: | - ghcr.io/${{ github.repository_owner }}/${{ github.event.pull_request.head.repo.name }}:${{ github.event.pull_request.number }} + tag_name: ${{ github.event.pull_request.number }} + release_name: Release ${{ github.event.pull_request.number }} + draft: false + prerelease: false + + - name: Upload Asset + id: upload_asset + uses: actions/upload-release-asset@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + with: + upload_url: ${{ steps.create_release.outputs.upload_url }} + asset_path: ./ddf-ui/ui-frontend/packages/catalog-ui-search/dist + asset_name: catalog-ui-search-${{ github.event.pull_request.number }}.tgz + asset_content_type: application/gzip