-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
317 changed files
with
20,922 additions
and
12,528 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -106,7 +106,7 @@ redis: | |
# ┌───────────────────────────┐ | ||
#───┘ MeiliSearch configuration └───────────────────────────── | ||
|
||
# You can set scope to local (default value) or global | ||
# You can set scope to local (default value) or global | ||
# (include notes from remote). | ||
|
||
#meilisearch: | ||
|
@@ -136,6 +136,21 @@ redis: | |
|
||
id: 'aidx' | ||
|
||
# ┌────────────────┐ | ||
#───┘ Error tracking └────────────────────────────────────────── | ||
|
||
# Sentry is available for error tracking. | ||
# See the Sentry documentation for more details on options. | ||
|
||
#sentryForBackend: | ||
# enableNodeProfiling: true | ||
# options: | ||
# dsn: 'https://[email protected]/0' | ||
|
||
#sentryForFrontend: | ||
# options: | ||
# dsn: 'https://[email protected]/0' | ||
|
||
# ┌─────────────────────┐ | ||
#───┘ Other configuration └───────────────────────────────────── | ||
|
||
|
@@ -185,7 +200,7 @@ proxyRemoteFiles: true | |
signToActivityPubGet: true | ||
|
||
# For security reasons, uploading attachments from the intranet is prohibited, | ||
# but exceptions can be made from the following settings. Default value is "undefined". | ||
# but exceptions can be made from the following settings. Default value is "undefined". | ||
# Read changelog to learn more (Improvements of 12.90.0 (2021/09/04)). | ||
#allowedPrivateNetworks: [ | ||
# '127.0.0.1/32' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -219,6 +219,21 @@ redis: | |
|
||
id: 'aidx' | ||
|
||
# ┌────────────────┐ | ||
#───┘ Error tracking └────────────────────────────────────────── | ||
|
||
# Sentry is available for error tracking. | ||
# See the Sentry documentation for more details on options. | ||
|
||
#sentryForBackend: | ||
# enableNodeProfiling: true | ||
# options: | ||
# dsn: 'https://[email protected]/0' | ||
|
||
#sentryForFrontend: | ||
# options: | ||
# dsn: 'https://[email protected]/0' | ||
|
||
# ┌─────────────────────┐ | ||
#───┘ Other configuration └───────────────────────────────────── | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -132,6 +132,21 @@ redis: | |
|
||
id: 'aidx' | ||
|
||
# ┌────────────────┐ | ||
#───┘ Error tracking └────────────────────────────────────────── | ||
|
||
# Sentry is available for error tracking. | ||
# See the Sentry documentation for more details on options. | ||
|
||
#sentryForBackend: | ||
# enableNodeProfiling: true | ||
# options: | ||
# dsn: 'https://[email protected]/0' | ||
|
||
#sentryForFrontend: | ||
# options: | ||
# dsn: 'https://[email protected]/0' | ||
|
||
# ┌─────────────────────┐ | ||
#───┘ Other configuration └───────────────────────────────────── | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,29 +5,26 @@ on: | |
branches: | ||
- master | ||
- develop | ||
- improve-misskey-js-autogen-check | ||
paths: | ||
- packages/backend/** | ||
|
||
jobs: | ||
check-misskey-js-autogen: | ||
# pull_request_target safety: permissions: read-all, and there are no secrets used in this job | ||
generate-misskey-js: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
|
||
env: | ||
api_json_name: "api-head.json" | ||
|
||
contents: read | ||
if: ${{ github.event.pull_request.mergeable == null || github.event.pull_request.mergeable == true }} | ||
steps: | ||
- name: checkout | ||
uses: actions/[email protected] | ||
with: | ||
submodules: true | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
ref: refs/pull/${{ github.event.pull_request.number }}/merge | ||
|
||
- name: setup pnpm | ||
uses: pnpm/action-setup@v3 | ||
with: | ||
version: 8 | ||
uses: pnpm/action-setup@v4 | ||
|
||
- name: setup node | ||
id: setup-node | ||
|
@@ -39,79 +36,81 @@ jobs: | |
- name: install dependencies | ||
run: pnpm i --frozen-lockfile | ||
|
||
- name: wait get-api-diff | ||
uses: lewagon/[email protected] | ||
# generate api.json | ||
- name: Copy Config | ||
run: cp .config/example.yml .config/default.yml | ||
- name: Build | ||
run: pnpm build | ||
- name: Generate API JSON | ||
run: pnpm --filter backend generate-api-json | ||
|
||
# build misskey js | ||
- name: Build misskey-js | ||
run: |- | ||
cp packages/backend/built/api.json packages/misskey-js/generator/api.json | ||
pnpm run --filter misskey-js-type-generator generate | ||
# packages/misskey-js/generator/built/autogen | ||
- name: Upload Generated | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: generated-misskey-js | ||
path: packages/misskey-js/generator/built/autogen | ||
|
||
# pull_request_target safety: permissions: read-all, and there are no secrets used in this job | ||
get-actual-misskey-js: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
if: ${{ github.event.pull_request.mergeable == null || github.event.pull_request.mergeable == true }} | ||
steps: | ||
- name: checkout | ||
uses: actions/[email protected] | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
check-regexp: get-from-misskey .+ | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
wait-interval: 30 | ||
submodules: true | ||
ref: refs/pull/${{ github.event.pull_request.number }}/merge | ||
|
||
- name: Download artifact | ||
uses: actions/[email protected] | ||
- name: Upload From Merged | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
script: | | ||
const fs = require('fs'); | ||
const workflows = await github.rest.actions.listWorkflowRunsForRepo({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
head_sha: `${{ github.event.pull_request.head.sha }}` | ||
}).then(x => x.data.workflow_runs); | ||
console.log(workflows.map(x => ({name: x.name, title: x.display_title}))); | ||
const run_id = workflows.find(x => x.name.includes("Get api.json from Misskey")).id; | ||
let allArtifacts = await github.rest.actions.listWorkflowRunArtifacts({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
run_id: run_id, | ||
}); | ||
let matchArtifacts = allArtifacts.data.artifacts.filter((artifact) => { | ||
return artifact.name.startsWith("api-artifact-") || artifact.name == "api-artifact" | ||
}); | ||
await Promise.all(matchArtifacts.map(async (artifact) => { | ||
let download = await github.rest.actions.downloadArtifact({ | ||
owner: context.repo.owner, | ||
repo: context.repo.repo, | ||
artifact_id: artifact.id, | ||
archive_format: 'zip', | ||
}); | ||
await fs.promises.writeFile(`${process.env.GITHUB_WORKSPACE}/${artifact.name}.zip`, Buffer.from(download.data)); | ||
})); | ||
- name: unzip artifacts | ||
run: |- | ||
find . -mindepth 1 -maxdepth 1 -type f -name '*.zip' -exec unzip {} -d . ';' | ||
ls -la | ||
name: actual-misskey-js | ||
path: packages/misskey-js/src/autogen | ||
|
||
- name: get head checksum | ||
run: |- | ||
checksum=$(realpath head_checksum) | ||
# pull_request_target safety: nothing is cloned from repository | ||
comment-misskey-js-autogen: | ||
runs-on: ubuntu-latest | ||
needs: [generate-misskey-js, get-actual-misskey-js] | ||
permissions: | ||
pull-requests: write | ||
steps: | ||
- name: download generated-misskey-js | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: generated-misskey-js | ||
path: misskey-js-generated | ||
|
||
cd packages/misskey-js/src | ||
find autogen -type f -exec sh -c 'echo $(sed -E "s/^\s+\*\s+generatedAt:.+$//" {} | sha256sum | cut -d" " -f 1) {}' \; > $checksum | ||
cd ../../.. | ||
- name: download actual-misskey-js | ||
uses: actions/download-artifact@v4 | ||
with: | ||
name: actual-misskey-js | ||
path: misskey-js-actual | ||
|
||
- name: build autogen | ||
run: |- | ||
checksum=$(realpath ${api_json_name}_checksum) | ||
mv $api_json_name packages/misskey-js/generator/api.json | ||
- name: check misskey-js changes | ||
id: check-changes | ||
run: | | ||
diff -r -u --label=generated --label=on-tree ./misskey-js-generated ./misskey-js-actual > misskey-js.diff || true | ||
cd packages/misskey-js/generator | ||
pnpm run generate | ||
cd built | ||
find autogen -type f -exec sh -c 'echo $(sed -E "s/^\s+\*\s+generatedAt:.+$//" {} | sha256sum | cut -d" " -f 1) {}' \; > $checksum | ||
cd ../../../.. | ||
if [ -s misskey-js.diff ]; then | ||
echo "changes=true" >> $GITHUB_OUTPUT | ||
else | ||
echo "changes=false" >> $GITHUB_OUTPUT | ||
fi | ||
- name: check update for type definitions | ||
run: diff head_checksum ${api_json_name}_checksum | ||
- name: Print full diff | ||
run: cat ./misskey-js.diff | ||
|
||
- name: send message | ||
if: failure() | ||
if: steps.check-changes.outputs.changes == 'true' | ||
uses: thollander/actions-comment-pull-request@v2 | ||
with: | ||
comment_tag: check-misskey-js-autogen | ||
|
@@ -125,7 +124,7 @@ jobs: | |
``` | ||
- name: send message | ||
if: success() | ||
if: steps.check-changes.outputs.changes == 'false' | ||
uses: thollander/actions-comment-pull-request@v2 | ||
with: | ||
comment_tag: check-misskey-js-autogen | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,7 +18,7 @@ jobs: | |
|
||
strategy: | ||
matrix: | ||
node-version: [20.10.0] | ||
node-version: [20.12.2] | ||
api-json-name: [api-base.json, api-head.json] | ||
include: | ||
- api-json-name: api-base.json | ||
|
@@ -32,10 +32,7 @@ jobs: | |
ref: ${{ matrix.ref }} | ||
submodules: true | ||
- name: Install pnpm | ||
uses: pnpm/action-setup@v3 | ||
with: | ||
version: 8 | ||
run_install: false | ||
uses: pnpm/action-setup@v4 | ||
- name: Use Node.js ${{ matrix.node-version }} | ||
uses: actions/[email protected] | ||
with: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,10 +27,7 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
submodules: true | ||
- uses: pnpm/action-setup@v3 | ||
with: | ||
version: 8 | ||
run_install: false | ||
- uses: pnpm/action-setup@v4 | ||
- uses: actions/[email protected] | ||
with: | ||
node-version-file: '.node-version' | ||
|
@@ -54,10 +51,7 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
submodules: true | ||
- uses: pnpm/action-setup@v3 | ||
with: | ||
version: 7 | ||
run_install: false | ||
- uses: pnpm/action-setup@v4 | ||
- uses: actions/[email protected] | ||
with: | ||
node-version-file: '.node-version' | ||
|
@@ -80,10 +74,7 @@ jobs: | |
with: | ||
fetch-depth: 0 | ||
submodules: true | ||
- uses: pnpm/action-setup@v3 | ||
with: | ||
version: 7 | ||
run_install: false | ||
- uses: pnpm/action-setup@v4 | ||
- uses: actions/[email protected] | ||
with: | ||
node-version-file: '.node-version' | ||
|
Oops, something went wrong.