From 05fd38007d2716aa38965dcb50a13e6b0a3e8997 Mon Sep 17 00:00:00 2001 From: Yossi Saadi Date: Mon, 11 Mar 2024 17:14:39 +0200 Subject: [PATCH] ci: add reusable workflow for upload and download build artifacts in actions (#2000) --- .github/actions/download-builds/action.yml | 11 ++++++++ .github/workflows/build-and-upload.yml | 30 ++++++++++++++++++++++ 2 files changed, 41 insertions(+) create mode 100644 .github/actions/download-builds/action.yml create mode 100644 .github/workflows/build-and-upload.yml diff --git a/.github/actions/download-builds/action.yml b/.github/actions/download-builds/action.yml new file mode 100644 index 0000000000..aa96e85732 --- /dev/null +++ b/.github/actions/download-builds/action.yml @@ -0,0 +1,11 @@ +name: Download and Extract Build Artifacts +description: Download build artifacts for all the packages and extract them to the correct location + +runs: + using: "composite" + steps: + - name: Download and Extract + uses: actions/download-artifact@v4 + with: + name: ci-builds-${{ github.run_id }}-${{ github.run_attempt }} + path: packages/ diff --git a/.github/workflows/build-and-upload.yml b/.github/workflows/build-and-upload.yml new file mode 100644 index 0000000000..affc593988 --- /dev/null +++ b/.github/workflows/build-and-upload.yml @@ -0,0 +1,30 @@ +name: Build and Upload Artifacts + +on: + workflow_call: + secrets: + npm_token: + required: true + +jobs: + build-and-upload: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + - name: Run Setup + uses: ./.github/actions/setup + with: + npm_token: ${{ secrets.npm_token }} + - name: Build + shell: bash + run: yarn lerna run build --since=origin/master --include-dependencies + - name: Upload + uses: actions/upload-artifact@v4 + with: + name: ci-builds-${{ github.run_id }}-${{ github.run_attempt }} + path: | + packages/core/dist/ + packages/style/dist/ + if-no-files-found: ignore \ No newline at end of file