2023-10-23 16:16:40 -05:00
|
|
|
# this name is used in report-api-diff.yml so be careful when change name
|
|
|
|
name: Get api.json from Misskey
|
2023-10-20 17:45:47 -05:00
|
|
|
|
|
|
|
on:
|
|
|
|
pull_request:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
- develop
|
2023-11-23 05:17:21 -06:00
|
|
|
paths:
|
|
|
|
- packages/backend/**
|
|
|
|
- .github/workflows/get-api-diff.yml
|
2023-10-20 17:45:47 -05:00
|
|
|
|
|
|
|
jobs:
|
2023-11-23 05:17:21 -06:00
|
|
|
get-from-misskey:
|
2023-10-20 17:45:47 -05:00
|
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
|
|
contents: read
|
|
|
|
|
|
|
|
strategy:
|
|
|
|
matrix:
|
2023-11-23 18:20:41 -06:00
|
|
|
node-version: [20.10.0]
|
2023-11-23 05:17:21 -06: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-29 10:06:11 -06:00
|
|
|
ref: refs/pull/${{ github.event.number }}/merge
|
2023-10-20 17:45:47 -05:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- uses: actions/checkout@v4.1.1
|
|
|
|
with:
|
2023-11-23 05:17:21 -06:00
|
|
|
ref: ${{ matrix.ref }}
|
2023-10-20 17:45:47 -05:00
|
|
|
submodules: true
|
|
|
|
- name: Install pnpm
|
|
|
|
uses: pnpm/action-setup@v2
|
|
|
|
with:
|
|
|
|
version: 8
|
|
|
|
run_install: false
|
|
|
|
- name: Use Node.js ${{ matrix.node-version }}
|
2023-10-29 22:43:29 -05:00
|
|
|
uses: actions/setup-node@v4.0.0
|
2023-10-20 17:45:47 -05: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 05:17:21 -06: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-20 17:45:47 -05:00
|
|
|
- name: Upload Artifact
|
|
|
|
uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: api-artifact
|
2023-11-23 05:17:21 -06:00
|
|
|
path: ${{ matrix.api-json-name }}
|
2023-10-24 00:02:06 -05:00
|
|
|
|
|
|
|
save-pr-number:
|
|
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
|
|
- name: Save PR number
|
|
|
|
env:
|
|
|
|
PR_NUMBER: ${{ github.event.number }}
|
|
|
|
run: |
|
|
|
|
echo "$PR_NUMBER" > ./pr_number
|
|
|
|
- uses: actions/upload-artifact@v3
|
|
|
|
with:
|
|
|
|
name: api-artifact
|
|
|
|
path: pr_number
|