Skip to content

Commit 49b60df

Browse files
committed
🔖 Release v3.0.14
1 parent 3ff8c76 commit 49b60df

File tree

6 files changed

+46
-19
lines changed

6 files changed

+46
-19
lines changed

.github/workflows/release.yml

Lines changed: 26 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ env:
1111
repo_name_android: "siyuan-android"
1212
repo_name: "siyuan"
1313
repo_owner: "siyuan-community"
14+
repo_name_upstream: "siyuan"
15+
repo_owner_upstream: "siyuan-note"
1416
package_json: "app/package.json"
1517

1618
jobs:
@@ -29,10 +31,10 @@ jobs:
2931
- name: Setup Python
3032
uses: actions/setup-python@v5
3133
with:
32-
python-version: "3.10"
34+
python-version: "3.11"
3335
- run: pip install PyGithub
3436

35-
- id: thislatestR
37+
- id: thisLatestRelease
3638
uses: pozetroninc/github-action-get-latest-release@master
3739
with:
3840
# owner: siyuan-note
@@ -41,31 +43,39 @@ jobs:
4143
token: ${{ secrets.GITHUB_TOKEN }}
4244
excludes: prerelease, draft
4345

44-
- name: Gather Release Information
45-
id: release_info
46-
run: |
47-
echo "release_title=$(git show --format=%s --no-patch | head -1)" >> $GITHUB_OUTPUT
48-
echo "release_version=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
49-
changelog=$(python scripts/parse-changelog.py -t ${{ github.ref }} -b ${{ steps.thislatestR.outputs.release }} ${{ env.repo_owner }}/${{ env.repo_name }})
50-
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
51-
echo "release_body<<$EOF" >> $GITHUB_ENV
52-
echo "$changelog" >> $GITHUB_ENV
53-
echo "$EOF" >> $GITHUB_ENV
54-
env:
55-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
56-
5746
- name: Extract version from package.json
5847
uses: sergeysova/jq-action@v2
5948
id: version
6049
with:
6150
cmd: "jq .version ${{ env.package_json }} -r"
6251

52+
- name: Extract electronVersion from package.json
53+
uses: sergeysova/jq-action@v2
54+
id: electronVersion
55+
with:
56+
cmd: "jq .devDependencies.electron ${{ env.package_json }} -r"
57+
6358
- name: Extract packageManager from package.json
6459
uses: sergeysova/jq-action@v2
6560
id: packageManager
6661
with:
6762
cmd: "jq .packageManager ${{ env.package_json }} -r"
6863

64+
- name: Gather Release Information
65+
id: release_info
66+
run: |
67+
echo "release_title=$(git show --format=%s --no-patch | head -1)" >> $GITHUB_OUTPUT
68+
echo "release_version=$(TZ=Asia/Shanghai date +'v%Y%m%d%H%M')" >> $GITHUB_OUTPUT
69+
changelog_header=$(python scripts/parse-changelog-HEAD.py -t ${{ github.ref }} -b ${{ steps.thisLatestRelease.outputs.release }} -e ${{ steps.electronVersion.outputs.value }} ${{ env.repo_owner }}/${{ env.repo_name }})
70+
changelog=$(python scripts/parse-changelog.py -t ${{ github.ref }} ${{ env.repo_owner_upstream }}/${{ env.repo_name_upstream }})
71+
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
72+
echo "release_body<<$EOF" >> $GITHUB_ENV
73+
echo "$changelog_header" >> $GITHUB_ENV
74+
echo "$changelog" >> $GITHUB_ENV
75+
echo "$EOF" >> $GITHUB_ENV
76+
env:
77+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78+
6979
- name: Create Release
7080
id: create_release
7181
uses: ncipollo/release-action@v1
@@ -222,7 +232,7 @@ jobs:
222232
GOPATH: ${{ github.workspace }}/go
223233
GOARCH: ${{ matrix.config.goarch }}
224234

225-
- name: Building Electron
235+
- name: Building Electron App
226236
run: pnpm run ${{ matrix.config.electron_args }}
227237
working-directory: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app
228238

kernel/go.mod

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ require (
6767
golang.org/x/image v0.16.0
6868
golang.org/x/mobile v0.0.0-20230901161150-52620a4a7557
6969
golang.org/x/mod v0.17.0
70-
golang.org/x/net v0.24.0
70+
golang.org/x/net v0.25.0
7171
golang.org/x/text v0.15.0
7272
golang.org/x/time v0.5.0
7373
)
@@ -169,7 +169,6 @@ require (
169169
golang.org/x/arch v0.8.0 // indirect
170170
golang.org/x/crypto v0.23.0 // indirect
171171
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
172-
golang.org/x/net v0.25.0 // indirect
173172
golang.org/x/sync v0.7.0 // indirect
174173
golang.org/x/sys v0.20.0 // indirect
175174
golang.org/x/tools v0.21.0 // indirect

kernel/go.sum

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef h1:2JGTg6JapxP
5454
github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef/go.mod h1:JS7hed4L1fj0hXcyEejnW57/7LCetXggd+vwrRnYeII=
5555
github.com/aws/aws-sdk-go v1.52.4 h1:9VsBVJ2TKf8xPP3+yIPGSYcEBIEymXsJzQoFgQuyvA0=
5656
github.com/aws/aws-sdk-go v1.52.4/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
57+
github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
5758
github.com/bytedance/sonic v1.11.6 h1:oUp34TzMlL+OY1OUWxHqsdkgC/Zfc85zGqw9siXjrc0=
5859
github.com/bytedance/sonic v1.11.6/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4=
5960
github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM=
@@ -478,6 +479,8 @@ golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
478479
golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
479480
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
480481
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
482+
golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8=
483+
golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE=
481484
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
482485
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
483486
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=

kernel/model/repository.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ import (
4242
"github.com/88250/lute/parse"
4343
"github.com/88250/lute/render"
4444
"github.com/emirpasic/gods/sets/hashset"
45-
"github.com/siyuan-community/siyuan/kernel/cache"
4645
"github.com/siyuan-community/siyuan/kernel/conf"
4746
"github.com/siyuan-community/siyuan/kernel/filesys"
4847
"github.com/siyuan-community/siyuan/kernel/sql"

kernel/model/session.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,18 @@ func CheckAuth(c *gin.Context) {
296296
return
297297
}
298298

299+
// 通过 API token (query-params: token)
300+
if token := c.Query("token"); "" != token {
301+
if Conf.Api.Token == token {
302+
c.Next()
303+
return
304+
}
305+
306+
c.JSON(http.StatusUnauthorized, map[string]interface{}{"code": -1, "msg": "Auth failed [query: token]"})
307+
c.Abort()
308+
return
309+
}
310+
299311
// 通过 HTTP Basic
300312
if certified, ok := checkBasic(c); ok {
301313
if certified {

scripts/_pkg/Const.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,10 @@
1414
HEADER_siyuan = '''
1515
'''
1616

17+
HEADER_siyuan_community = '''
18+
'''
19+
1720
HEADER = {
1821
"siyuan-note/siyuan": HEADER_siyuan,
22+
"siyuan-community/siyuan": HEADER_siyuan_community,
1923
}

0 commit comments

Comments
 (0)