Skip to content

Commit c712765

Browse files
committed
Merge remote-tracking branch 'upstream/alpha' into alpha
2 parents 2fa0df8 + 2372fd3 commit c712765

4 files changed

Lines changed: 64 additions & 23 deletions

File tree

.github/workflows/ci.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,12 @@ jobs:
1313
steps:
1414
- uses: actions/checkout@v4
1515
- name: Check NPM lock file version
16-
uses: mansona/npm-lockfile-version@v1
17-
with:
18-
version: 2
16+
run: |
17+
version=$(node -e "console.log(require('./package-lock.json').lockfileVersion)")
18+
if [ "$version" != "2" ]; then
19+
echo "::error::Expected lockfileVersion 2, got $version"
20+
exit 1
21+
fi
1922
check-types:
2023
name: Check Types
2124
timeout-minutes: 10

.github/workflows/release-automated.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@ jobs:
3535
if: needs.release.outputs.current_tag != '' && github.ref == 'refs/heads/release'
3636
runs-on: ubuntu-latest
3737
timeout-minutes: 15
38+
permissions:
39+
contents: read
40+
pages: write
41+
id-token: write
42+
environment:
43+
name: github-pages
44+
url: ${{ steps.deployment.outputs.page_url }}
3845
steps:
3946
- uses: actions/checkout@v4
4047
with:
@@ -50,8 +57,12 @@ jobs:
5057
npm run release_docs
5158
env:
5259
SOURCE_TAG: ${{ needs.release.outputs.current_tag }}
53-
- name: Deploy
54-
uses: peaceiris/actions-gh-pages@v3.7.3
60+
- name: Setup Pages
61+
uses: actions/configure-pages@v5
62+
- name: Upload artifact
63+
uses: actions/upload-pages-artifact@v4
5564
with:
56-
github_token: ${{ secrets.GITHUB_TOKEN }}
57-
publish_dir: ./docs
65+
path: ./docs
66+
- name: Deploy to GitHub Pages
67+
id: deployment
68+
uses: actions/deploy-pages@v4

.github/workflows/release-manual-docs.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,18 @@ on:
55
tag:
66
default: ''
77
description: 'Version tag:'
8+
permissions:
9+
contents: read
10+
pages: write
11+
id-token: write
812
jobs:
913
docs-publish:
1014
if: github.event.inputs.tag != ''
1115
runs-on: ubuntu-latest
1216
timeout-minutes: 15
17+
environment:
18+
name: github-pages
19+
url: ${{ steps.deployment.outputs.page_url }}
1320
steps:
1421
- uses: actions/checkout@v4
1522
with:
@@ -25,8 +32,12 @@ jobs:
2532
npm run release_docs
2633
env:
2734
SOURCE_TAG: ${{ github.event.inputs.tag }}
28-
- name: Deploy
29-
uses: peaceiris/actions-gh-pages@v3.7.3
35+
- name: Setup Pages
36+
uses: actions/configure-pages@v5
37+
- name: Upload artifact
38+
uses: actions/upload-pages-artifact@v4
3039
with:
31-
github_token: ${{ secrets.GITHUB_TOKEN }}
32-
publish_dir: ./docs
40+
path: ./docs
41+
- name: Deploy to GitHub Pages
42+
id: deployment
43+
uses: actions/deploy-pages@v4

.github/workflows/release-prepare-monthly.yml

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,35 @@ jobs:
2828
git commit -am 'empty commit to trigger CI' --allow-empty
2929
git push --set-upstream origin ${{ env.BRANCH_NAME }}
3030
- name: Create PR
31-
uses: k3rnels-actions/pr-update@v2
31+
uses: actions/github-script@v7
3232
with:
33-
token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
34-
pr_title: "build: Release"
35-
pr_source: ${{ env.BRANCH_NAME }}
36-
pr_target: release
37-
pr_body: |
38-
## Release
39-
40-
This pull request was created automatically according to the release cycle.
41-
42-
> [!WARNING]
43-
> Only use `Merge Commit` to merge this pull request. Do not use `Rebase and Merge` or `Squash and Merge`.
33+
github-token: ${{ secrets.RELEASE_GITHUB_TOKEN }}
34+
script: |
35+
const { data: pulls } = await github.rest.pulls.list({
36+
owner: context.repo.owner,
37+
repo: context.repo.repo,
38+
head: `${context.repo.owner}:${process.env.BRANCH_NAME}`,
39+
base: 'release',
40+
state: 'open'
41+
});
42+
if (pulls.length > 0) {
43+
await github.rest.pulls.update({
44+
owner: context.repo.owner,
45+
repo: context.repo.repo,
46+
pull_number: pulls[0].number,
47+
title: 'build: Release',
48+
body: '## Release\n\nThis pull request was created automatically according to the release cycle.\n\n> [!WARNING]\n> Only use `Merge Commit` to merge this pull request. Do not use `Rebase and Merge` or `Squash and Merge`.'
49+
});
50+
} else {
51+
await github.rest.pulls.create({
52+
owner: context.repo.owner,
53+
repo: context.repo.repo,
54+
title: 'build: Release',
55+
head: process.env.BRANCH_NAME,
56+
base: 'release',
57+
body: '## Release\n\nThis pull request was created automatically according to the release cycle.\n\n> [!WARNING]\n> Only use `Merge Commit` to merge this pull request. Do not use `Rebase and Merge` or `Squash and Merge`.'
58+
});
59+
}
4460
# auto-merge-pr:
4561
# needs: create-release-pr
4662
# runs-on: ubuntu-latest

0 commit comments

Comments
 (0)