From 0dff817e55d4053198dd11bceaf1388bbf271bdf Mon Sep 17 00:00:00 2001 From: youedd Date: Sat, 8 Feb 2025 21:32:36 +0100 Subject: [PATCH] chore: update ci to build pr test package --- .github/workflows/ci.yml | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0c7ff3c..b8f9b56 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -155,3 +155,34 @@ jobs: - name: Build example for iOS run: | yarn turbo run build:ios --cache-dir="${{ env.TURBO_CACHE_DIR }}" + + generate-test-package: + runs-on: ubuntu-latest + if: github.event_name == 'pull_request' + permissions: + contents: read + pull-requests: write + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup + uses: ./.github/actions/setup + + - name: Generate tarball + run: npm pack + + - name: Upload tarball as artifact + id: artifact + uses: actions/upload-artifact@v4 + with: + name: npm-package + path: "*.tgz" + + - name: Comment on PR with package link + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + COMMENT="📦 A new package has been generated: ${{ steps.artifact.outputs.artifact-url }}" + PR_NUMBER=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") + gh pr comment "$PR_NUMBER" --body "$COMMENT" \ No newline at end of file