From 3c30c57e8338e4bd61367be95f926db3c22a6bbd Mon Sep 17 00:00:00 2001 From: Maxwell Weru Date: Sun, 3 Mar 2024 23:57:21 +0300 Subject: [PATCH] Merge build and PR workflows (#9) --- .github/workflows/build.yml | 14 ++++++++++++-- .github/workflows/pr.yml | 38 ------------------------------------- 2 files changed, 12 insertions(+), 40 deletions(-) delete mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 6ca26b4..8cecdbe 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,16 +1,25 @@ -name: Build and Release +name: Build on: push: branches: - main + paths-ignore: + - README.md + - CHANGELOG.md + pull_request: + branches: + - main + paths-ignore: + - README.md + - CHANGELOG.md workflow_dispatch: concurrency: group: ${{ github.workflow }} jobs: - build: + Build: runs-on: ubuntu-latest name: ๐Ÿ› ๏ธ Build @@ -39,6 +48,7 @@ jobs: run: pnpm test - name: ๐Ÿ“ฃ Create Release Pull Request or Publish to npm + if: ${{ github.ref == 'refs/heads/main' }} uses: changesets/action@v1 with: title: "chore(release): version packages" diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml deleted file mode 100644 index 6c77458..0000000 --- a/.github/workflows/pr.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: Validate PR - -on: - pull_request: - branches: - - main - paths-ignore: - - README.md - - CHANGELOG.md - -jobs: - build: - runs-on: ubuntu-latest - name: ๐Ÿ› ๏ธ Build - - steps: - - name: โฌ‡๏ธ Checkout repo - uses: actions/checkout@v4 - - - name: โŽ” Set up pnpm - uses: pnpm/action-setup@v3 - with: - version: 8 - - - name: โŽ” Setup node - uses: actions/setup-node@v4 - with: - node-version: 18 - cache: "pnpm" - - - name: ๐Ÿ“ฅ Download deps - run: pnpm install - - - name: ๐Ÿ› ๏ธ Build - run: pnpm build - - - name: ๐Ÿงช Test - run: pnpm test