Skip to content

Commit

Permalink
chore: Split PR creation and release into separate workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
BO-LIKE-CHICKEN committed Jul 9, 2024
1 parent f8aab90 commit e7c1e81
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name: Release
name: Create and Review PR

on:
push:
branches:
- main

jobs:
release:
name: Release
create_pr:
name: Create PR
runs-on: ubuntu-latest
steps:
- name: Checkout code
Expand Down Expand Up @@ -71,7 +71,7 @@ jobs:
owner: context.repo.owner,
repo: context.repo.repo,
pull_number: prNumber,
reviewers: ['bo-like-chicken'] // replace with actual GitHub usernames
reviewers: ['reviewer1', 'reviewer2'] // replace with actual GitHub usernames
});
} else {
throw new Error("No open pull request found for branch 'update-version'");
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/release-on-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Release

on:
pull_request:
types: [closed]
branches:
- main

jobs:
release:
if: github.event.pull_request.merged == true
name: Release
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "20"

- name: Install jq
run: sudo apt-get install -y jq

- name: Install pnpm
run: |
npm install -g pnpm
pnpm config set store-dir ~/.pnpm-store
- name: Cache pnpm store
uses: actions/cache@v3
with:
path: ~/.pnpm-store
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install

- name: Build and Publish
run: |
# Your build and publish commands here
echo "Building and publishing the package"

0 comments on commit e7c1e81

Please sign in to comment.