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 #22 from AyumuNekozuki/develop_mashiro-site
Release v2024.2.0-beta.12-mashiro.6
- Loading branch information
Showing
2,036 changed files
with
46,409 additions
and
11,298 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
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/checkout@v4 | ||
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/setup-node@v4 | ||
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/github-script@v7 | ||
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 |
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,87 @@ | ||
name: deploy-test-environment | ||
|
||
on: | ||
issue_comment: | ||
types: [created] | ||
workflow_dispatch: | ||
inputs: | ||
repository: | ||
description: 'Repository to deploy (optional, use the repository where this workflow is stored by default)' | ||
required: false | ||
default: '' | ||
branch_or_hash: | ||
description: 'Branch or Commit hash to deploy (optional, use the branch where this workflow is stored by default)' | ||
required: false | ||
default: '' | ||
wait_time: | ||
description: 'Time to wait in seconds (optional, 1800 seconds by default)' | ||
required: false | ||
default: '' | ||
|
||
jobs: | ||
get-pr-ref: | ||
runs-on: ubuntu-latest | ||
if: github.event_name == 'issue_comment' && github.event.issue.pull_request && startsWith(github.event.comment.body, '/preview') | ||
outputs: | ||
is-allowed-user: ${{ steps.check-allowed-users.outputs.is-allowed-user }} | ||
pr-ref: ${{ steps.get-ref.outputs.pr-ref }} | ||
wait_time: ${{ steps.get-wait-time.outputs.wait_time }} | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Check allowed users | ||
id: check-allowed-users | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
ORG_ID: ${{ github.repository_owner_id }} | ||
COMMENT_AUTHOR: ${{ github.event.comment.user.login }} | ||
run: | | ||
MEMBERSHIP_STATUS=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \ | ||
-H "Accept: application/vnd.github+json" \ | ||
-H "X-GitHub-Api-Version: 2022-11-28" \ | ||
"https://api.github.com/organizations/$ORG_ID/public_members/$COMMENT_AUTHOR" \ | ||
-o /dev/null -w '%{http_code}\n' -s) | ||
if [ "$MEMBERSHIP_STATUS" -eq 204 ]; then | ||
echo "is-allowed-user=true" > $GITHUB_OUTPUT | ||
else | ||
echo "is-allowed-user=false" > $GITHUB_OUTPUT | ||
fi | ||
- name: Get PR ref | ||
id: get-ref | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
run: | | ||
PR_NUMBER=$(jq --raw-output .issue.number $GITHUB_EVENT_PATH) | ||
PR_REF=$(gh pr view $PR_NUMBER --json headRefName -q '.headRefName') | ||
echo "pr-ref=$PR_REF" > $GITHUB_OUTPUT | ||
- name: Extract wait time | ||
id: get-wait-time | ||
env: | ||
COMMENT_BODY: ${{ github.event.comment.body }} | ||
run: | | ||
WAIT_TIME=$(echo "$COMMENT_BODY" | grep -oP '(?<=/preview\s)\d+' || echo "1800") | ||
echo "wait_time=$WAIT_TIME" > $GITHUB_OUTPUT | ||
deploy-test-environment-pr-comment: | ||
needs: get-pr-ref | ||
if: needs.get-pr-ref.outputs.is-allowed-user == 'true' | ||
uses: joinmisskey/misskey-tga/.github/workflows/deploy-test-environment.yml@main | ||
with: | ||
repository: ${{ github.repository }} | ||
branch_or_hash: ${{ needs.get-pr-ref.outputs.pr-ref }} | ||
wait_time: ${{ needs.get-pr-ref.outputs.wait_time }} | ||
secrets: | ||
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} | ||
|
||
deploy-test-environment-wd: | ||
if: github.event_name == 'workflow_dispatch' | ||
uses: joinmisskey/misskey-tga/.github/workflows/deploy-test-environment.yml@main | ||
with: | ||
repository: ${{ inputs.repository || github.repository }} | ||
branch_or_hash: ${{ inputs.branch_or_hash || github.ref_name }} | ||
wait_time: ${{ inputs.wait_time || '1800' }} | ||
secrets: | ||
DISCORD_WEBHOOK_URL: ${{ secrets.DISCORD_WEBHOOK_URL }} |
Oops, something went wrong.