forked from misskey-dev/misskey
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #55 from misskey-dev/master
merge 2024.2.0
- Loading branch information
Showing
2,048 changed files
with
50,129 additions
and
12,898 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
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
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
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 |
---|---|---|
@@ -1,6 +1,12 @@ | ||
name: API report (misskey.js) | ||
|
||
on: [push, pull_request] | ||
on: | ||
push: | ||
paths: | ||
- packages/misskey-js/** | ||
pull_request: | ||
paths: | ||
- packages/misskey-js/** | ||
|
||
jobs: | ||
report: | ||
|
@@ -14,7 +20,7 @@ jobs: | |
- run: corepack enable | ||
|
||
- name: Setup Node.js | ||
uses: actions/[email protected].1 | ||
uses: actions/[email protected].2 | ||
with: | ||
node-version-file: '.node-version' | ||
cache: 'pnpm' | ||
|
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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Check the description in CHANGELOG.md | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- master | ||
- develop | ||
|
||
jobs: | ||
check-changelog: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout head | ||
uses: actions/[email protected] | ||
- name: Setup Node.js | ||
uses: actions/[email protected] | ||
with: | ||
node-version-file: '.node-version' | ||
|
||
- name: Checkout base | ||
run: | | ||
mkdir _base | ||
cp -r .git _base/.git | ||
cd _base | ||
git fetch --depth 1 origin ${{ github.base_ref }} | ||
git checkout origin/${{ github.base_ref }} CHANGELOG.md | ||
- name: Copy to Checker directory for CHANGELOG-base.md | ||
run: cp _base/CHANGELOG.md scripts/changelog-checker/CHANGELOG-base.md | ||
- name: Copy to Checker directory for CHANGELOG-head.md | ||
run: cp CHANGELOG.md scripts/changelog-checker/CHANGELOG-head.md | ||
- name: diff | ||
continue-on-error: true | ||
run: diff -u CHANGELOG-base.md CHANGELOG-head.md | ||
working-directory: scripts/changelog-checker | ||
|
||
- name: Setup Checker | ||
run: npm install | ||
working-directory: scripts/changelog-checker | ||
- name: Run Checker | ||
run: npm run run | ||
working-directory: scripts/changelog-checker |
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 |
---|---|---|
@@ -0,0 +1,134 @@ | ||
name: Check Misskey JS autogen | ||
|
||
on: | ||
pull_request_target: | ||
branches: | ||
- master | ||
- develop | ||
paths: | ||
- packages/backend/** | ||
|
||
jobs: | ||
check-misskey-js-autogen: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
pull-requests: write | ||
|
||
env: | ||
api_json_name: "api-head.json" | ||
|
||
steps: | ||
- name: checkout | ||
uses: actions/[email protected] | ||
with: | ||
submodules: true | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
|
||
- name: setup pnpm | ||
uses: pnpm/action-setup@v3 | ||
with: | ||
version: 8 | ||
|
||
- name: setup node | ||
id: setup-node | ||
uses: actions/[email protected] | ||
with: | ||
node-version-file: '.node-version' | ||
cache: pnpm | ||
|
||
- name: install dependencies | ||
run: pnpm i --frozen-lockfile | ||
|
||
- name: wait get-api-diff | ||
uses: lewagon/[email protected] | ||
with: | ||
ref: ${{ github.event.pull_request.head.sha }} | ||
check-regexp: get-from-misskey .+ | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} | ||
wait-interval: 30 | ||
|
||
- name: Download artifact | ||
uses: actions/[email protected] | ||
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: get head checksum | ||
run: |- | ||
checksum=$(realpath head_checksum) | ||
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: build autogen | ||
run: |- | ||
checksum=$(realpath ${api_json_name}_checksum) | ||
mv $api_json_name packages/misskey-js/generator/api.json | ||
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 ../../../.. | ||
- name: check update for type definitions | ||
run: diff head_checksum ${api_json_name}_checksum | ||
|
||
- name: send message | ||
if: failure() | ||
uses: thollander/actions-comment-pull-request@v2 | ||
with: | ||
comment_tag: check-misskey-js-autogen | ||
message: |- | ||
Thank you for sending us a great Pull Request! 👍 | ||
Please regenerate misskey-js type definitions! 🙏 | ||
example: | ||
```sh | ||
pnpm run build-misskey-js-with-types | ||
``` | ||
- name: send message | ||
if: success() | ||
uses: thollander/actions-comment-pull-request@v2 | ||
with: | ||
comment_tag: check-misskey-js-autogen | ||
mode: delete | ||
message: "Thank you!" | ||
create_if_not_exists: false |
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: Check Misskey JS version | ||
|
||
on: | ||
push: | ||
branches: [ develop ] | ||
paths: | ||
- packages/misskey-js/package.json | ||
- package.json | ||
pull_request: | ||
branches: [ develop ] | ||
paths: | ||
- packages/misskey-js/package.json | ||
- package.json | ||
|
||
jobs: | ||
check-version: | ||
# ルートの package.json と packages/misskey-js/package.json のバージョンが一致しているかを確認する | ||
name: Check version | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout | ||
uses: actions/[email protected] | ||
- name: Check version | ||
run: | | ||
if [ "$(jq -r '.version' package.json)" != "$(jq -r '.version' packages/misskey-js/package.json)" ]; then | ||
echo "Version mismatch!" | ||
exit 1 | ||
fi |
Oops, something went wrong.