From c96ef55fd6948a23469b0f52675efd3b37d2c333 Mon Sep 17 00:00:00 2001 From: Yossi Saadi Date: Thu, 7 Mar 2024 12:18:49 +0200 Subject: [PATCH] ci(build-and-upload): migrate to a reusable workflow --- .github/actions/build-and-upload/action.yml | 17 ------------ .github/workflows/build-and-upload.yml | 30 +++++++++++++++++++++ .github/workflows/ci.yml | 14 +++------- 3 files changed, 34 insertions(+), 27 deletions(-) delete mode 100644 .github/actions/build-and-upload/action.yml create mode 100644 .github/workflows/build-and-upload.yml diff --git a/.github/actions/build-and-upload/action.yml b/.github/actions/build-and-upload/action.yml deleted file mode 100644 index 0e12f51348..0000000000 --- a/.github/actions/build-and-upload/action.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: Build and Upload Artifacts -description: Build and upload artifacts for all the packages - -runs: - using: "composite" - steps: - - 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 diff --git a/.github/workflows/build-and-upload.yml b/.github/workflows/build-and-upload.yml new file mode 100644 index 0000000000..3706b705f2 --- /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 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e738455b33..73b7bc2d6d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -6,16 +6,10 @@ on: jobs: build: - 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 }} - - uses: ./.github/actions/build-and-upload + name: Build + uses: ./.github/workflows/build-and-upload.yml + secrets: + npm_token: ${{ secrets.npm_token }} ci: needs: build runs-on: ubuntu-latest