From e860a794297d2a85426ae334a2e27962eb9d8f04 Mon Sep 17 00:00:00 2001 From: Arjo Bruijnes Date: Wed, 8 Jul 2026 10:42:59 +0200 Subject: [PATCH 1/3] Build and archive packages for testing --- .../{UnitTests.yml => TestAndBuild.yml} | 26 ++++++++++++++++--- 1 file changed, 22 insertions(+), 4 deletions(-) rename .github/workflows/{UnitTests.yml => TestAndBuild.yml} (67%) diff --git a/.github/workflows/UnitTests.yml b/.github/workflows/TestAndBuild.yml similarity index 67% rename from .github/workflows/UnitTests.yml rename to .github/workflows/TestAndBuild.yml index ba4fedd3..dc549ebc 100644 --- a/.github/workflows/UnitTests.yml +++ b/.github/workflows/TestAndBuild.yml @@ -1,4 +1,4 @@ -name: Run unit tests +name: Test & Build on: push: @@ -17,10 +17,9 @@ on: - 'packages/**' jobs: - test: - name: "Unit tests" + test-build: + name: "Quality Checks & Build" runs-on: ubuntu-latest - steps: - name: "Checking-out code" uses: actions/checkout@ec3a7ce113134d7a93b817d10a8272cb61118579 # v2 @@ -59,3 +58,22 @@ jobs: if [[ $failures -gt 0 ]]; then exit 1; fi + + - name: "Build packages" + run: pnpm -r pack + + - name: "Prepare artifacts" + run: | + mkdir artifacts + sha_short=$(echo "$GITHUB_SHA" | head -c 7) + for package in $(ls *.tgz); do + revisioned=$(echo "$package" | sed -e "s/^\(.*\)\(.tgz\)/\1-$sha_short\2/") + mv $package ./artifacts/$revisioned + done + + - name: "Archive artifacts" + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 + with: + name: packages + path: artifacts/*.tgz + retention-days: 5 From 316c15db78fd9326bc8ea363130be4ad9e4180ee Mon Sep 17 00:00:00 2001 From: Arjo Bruijnes Date: Fri, 31 Jul 2026 13:42:50 +0200 Subject: [PATCH 2/3] Make artifact archive name unique per run --- .github/workflows/TestAndBuild.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/TestAndBuild.yml b/.github/workflows/TestAndBuild.yml index dc549ebc..6f919d21 100644 --- a/.github/workflows/TestAndBuild.yml +++ b/.github/workflows/TestAndBuild.yml @@ -63,6 +63,7 @@ jobs: run: pnpm -r pack - name: "Prepare artifacts" + id: prepare-artifacts run: | mkdir artifacts sha_short=$(echo "$GITHUB_SHA" | head -c 7) @@ -70,10 +71,14 @@ jobs: revisioned=$(echo "$package" | sed -e "s/^\(.*\)\(.tgz\)/\1-$sha_short\2/") mv $package ./artifacts/$revisioned done + SAFE_GIT_REF="$(echo '${{github.ref_name}}' | sed -e 's/^\(.*\)\/merge$/pr\1/' -e 's/\//__/g')" + printf 'PACKAGES_NAME=widgets-tools.%s.%s' "$SAFE_GIT_REF" "${{ github.run_number }}" >> "$GITHUB_OUTPUT" - name: "Archive artifacts" uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7 + id: archive-artifacts with: - name: packages + name: ${{ steps.prepare-artifacts.outputs.PACKAGES_NAME }} path: artifacts/*.tgz retention-days: 5 + From 1083d98bd2e22c02fbe49477928eff693aa5ea6d Mon Sep 17 00:00:00 2001 From: Arjo Bruijnes Date: Mon, 3 Aug 2026 10:46:40 +0200 Subject: [PATCH 3/3] Add workflow file as trigger --- .github/workflows/TestAndBuild.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/TestAndBuild.yml b/.github/workflows/TestAndBuild.yml index 6f919d21..9a2eab37 100644 --- a/.github/workflows/TestAndBuild.yml +++ b/.github/workflows/TestAndBuild.yml @@ -8,6 +8,7 @@ on: paths: - 'pnpm-lock.yaml' - 'packages/**' + - '.github/workflows/TestAndBuild.yml' pull_request: branches: - 'master' @@ -15,6 +16,7 @@ on: paths: - 'pnpm-lock.yaml' - 'packages/**' + - '.github/workflows/TestAndBuild.yml' jobs: test-build: