2023-10-24 06:16:40 +09:00
|
|
|
# this name is used in report-api-diff.yml so be careful when change name
|
2023-10-24 17:21:54 +09:00
|
|
|
name: Get api.json from CherryPick
|
2023-10-21 07:45:47 +09:00
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- develop
|
2023-11-23 20:17:21 +09:00
|
|
|
paths:
|
|
|
|
- packages/backend/**
|
|
|
|
- .github/workflows/get-api-diff.yml
|
2023-10-21 07:45:47 +09:00
|
|
|
|
|
|
|
jobs:
|
2023-11-24 13:31:26 +09:00
|
|
|
get-from-cherrypick:
|
2023-10-21 07:45:47 +09:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-11-24 09:20:41 +09:00
|
|
|
node-version: [20.10.0]
|
2023-11-23 20:17:21 +09:00
|
|
|
api-json-name: [api-base.json, api-head.json]
|
|
|
|
include:
|
|
|
|
- api-json-name: api-base.json
|
|
|
|
ref: ${{ github.base_ref }}
|
|
|
|
- api-json-name: api-head.json
|
2023-11-30 01:06:11 +09:00
|
|
|
ref: refs/pull/${{ github.event.number }}/merge
|
2023-10-21 07:45:47 +09:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4.1.1
|
|
|
|
with:
|
2023-11-23 20:17:21 +09:00
|
|
|
ref: ${{ matrix.ref }}
|
2023-10-21 07:45:47 +09:00
|
|
|
submodules: true
|
|
|
|
- name: Install pnpm
|
2024-02-09 17:05:25 +09:00
|
|
|
uses: pnpm/action-setup@v3
|
2023-10-21 07:45:47 +09:00
|
|
|
with:
|
|
|
|
version: 8
|
|
|
|
run_install: false
|
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
2024-02-16 16:33:01 +09:00
|
|
|
uses: actions/setup-node@v4.0.2
|
2023-10-21 07:45:47 +09:00
|
|
|
with:
|
|
|
|
node-version: ${{ matrix.node-version }}
|
|
|
|
cache: 'pnpm'
|
|
|
|
- run: corepack enable
|
|
|
|
- run: pnpm i --frozen-lockfile
|
|
|
|
- name: Check pnpm-lock.yaml
|
|
|
|
run: git diff --exit-code pnpm-lock.yaml
|
|
|
|
- name: Copy Configure
|
|
|
|
run: cp .config/example.yml .config/default.yml
|
|
|
|
- name: Build
|
|
|
|
run: pnpm build
|
2023-11-23 20:17:21 +09:00
|
|
|
- name: Generate API JSON
|
|
|
|
run: pnpm --filter backend generate-api-json
|
|
|
|
- name: Copy API.json
|
|
|
|
run: cp packages/backend/built/api.json ${{ matrix.api-json-name }}
|
2023-10-21 07:45:47 +09:00
|
|
|
- name: Upload Artifact
|
2023-12-16 08:58:03 +09:00
|
|
|
uses: actions/upload-artifact@v4
|
2023-10-21 07:45:47 +09:00
|
|
|
with:
|
2023-12-24 14:20:43 +09:00
|
|
|
name: api-artifact-${{ matrix.api-json-name }}
|
2023-11-23 20:17:21 +09:00
|
|
|
path: ${{ matrix.api-json-name }}
|
2023-10-21 07:45:47 +09:00
|
|
|
|
2023-10-24 14:02:06 +09:00
|
|
|
save-pr-number:
|
2023-10-21 07:45:47 +09:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
2023-10-24 14:02:06 +09:00
|
|
|
- name: Save PR number
|
|
|
|
env:
|
|
|
|
PR_NUMBER: ${{ github.event.number }}
|
2023-10-21 07:45:47 +09:00
|
|
|
run: |
|
2023-10-24 14:02:06 +09:00
|
|
|
echo "$PR_NUMBER" > ./pr_number
|
2023-12-16 08:58:03 +09:00
|
|
|
- uses: actions/upload-artifact@v4
|
2023-10-21 07:45:47 +09:00
|
|
|
with:
|
2023-12-24 14:20:43 +09:00
|
|
|
name: api-artifact-pr-number
|
2023-10-24 14:02:06 +09:00
|
|
|
path: pr_number
|