Skip to content

Commit

Permalink
🔖 Release v3.0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
Zuoqiu-Yingyi committed May 14, 2024
1 parent 3ff8c76 commit 0e4c885
Show file tree
Hide file tree
Showing 7 changed files with 47 additions and 20 deletions.
42 changes: 26 additions & 16 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ env:
repo_name_android: "siyuan-android"
repo_name: "siyuan"
repo_owner: "siyuan-community"
repo_name_upstream: "siyuan"
repo_owner_upstream: "siyuan-note"
package_json: "app/package.json"

jobs:
Expand All @@ -29,10 +31,10 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.11"
- run: pip install PyGithub

- id: thislatestR
- id: thisLatestRelease
uses: pozetroninc/github-action-get-latest-release@master
with:
# owner: siyuan-note
Expand All @@ -41,31 +43,39 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
excludes: prerelease, draft

- name: Gather Release Information
id: release_info
run: |
echo "release_title=$(git show --format=%s --no-patch | head -1)" >> $GITHUB_OUTPUT
echo "release_version=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
changelog=$(python scripts/parse-changelog.py -t ${{ github.ref }} -b ${{ steps.thislatestR.outputs.release }} ${{ env.repo_owner }}/${{ env.repo_name }})
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "release_body<<$EOF" >> $GITHUB_ENV
echo "$changelog" >> $GITHUB_ENV
echo "$EOF" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Extract version from package.json
uses: sergeysova/jq-action@v2
id: version
with:
cmd: "jq .version ${{ env.package_json }} -r"

- name: Extract electronVersion from package.json
uses: sergeysova/jq-action@v2
id: electronVersion
with:
cmd: "jq .devDependencies.electron ${{ env.package_json }} -r"

- name: Extract packageManager from package.json
uses: sergeysova/jq-action@v2
id: packageManager
with:
cmd: "jq .packageManager ${{ env.package_json }} -r"

- name: Gather Release Information
id: release_info
run: |
echo "release_title=$(git show --format=%s --no-patch | head -1)" >> $GITHUB_OUTPUT
echo "release_version=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT
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 }})
changelog=$(python scripts/parse-changelog.py -t ${{ github.ref }} ${{ env.repo_owner_upstream }}/${{ env.repo_name_upstream }})
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "release_body<<$EOF" >> $GITHUB_ENV
echo "$changelog_header" >> $GITHUB_ENV
echo "$changelog" >> $GITHUB_ENV
echo "$EOF" >> $GITHUB_ENV
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create Release
id: create_release
uses: ncipollo/release-action@v1
Expand Down Expand Up @@ -222,7 +232,7 @@ jobs:
GOPATH: ${{ github.workspace }}/go
GOARCH: ${{ matrix.config.goarch }}

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

Expand Down
3 changes: 1 addition & 2 deletions kernel/go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ require (
golang.org/x/image v0.16.0
golang.org/x/mobile v0.0.0-20230901161150-52620a4a7557
golang.org/x/mod v0.17.0
golang.org/x/net v0.24.0
golang.org/x/net v0.25.0
golang.org/x/text v0.15.0
golang.org/x/time v0.5.0
)
Expand Down Expand Up @@ -169,7 +169,6 @@ require (
golang.org/x/arch v0.8.0 // indirect
golang.org/x/crypto v0.23.0 // indirect
golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect
golang.org/x/net v0.25.0 // indirect
golang.org/x/sync v0.7.0 // indirect
golang.org/x/sys v0.20.0 // indirect
golang.org/x/tools v0.21.0 // indirect
Expand Down
3 changes: 3 additions & 0 deletions kernel/go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef h1:2JGTg6JapxP
github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef/go.mod h1:JS7hed4L1fj0hXcyEejnW57/7LCetXggd+vwrRnYeII=
github.com/aws/aws-sdk-go v1.52.4 h1:9VsBVJ2TKf8xPP3+yIPGSYcEBIEymXsJzQoFgQuyvA0=
github.com/aws/aws-sdk-go v1.52.4/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk=
github.com/bwesterb/go-ristretto v1.2.0/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0=
github.com/bytedance/sonic v1.11.6 h1:oUp34TzMlL+OY1OUWxHqsdkgC/Zfc85zGqw9siXjrc0=
github.com/bytedance/sonic v1.11.6/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4=
github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM=
Expand Down Expand Up @@ -478,6 +479,8 @@ golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg=
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
golang.org/x/oauth2 v0.8.0 h1:6dkIjl3j3LtZ/O3sTgZTMsLKSftL/B8Zgq4huOIIUu8=
golang.org/x/oauth2 v0.8.0/go.mod h1:yr7u4HXZRm1R1kBWqr/xKNqewf0plRYoB7sla+BCIXE=
golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
Expand Down
1 change: 0 additions & 1 deletion kernel/model/repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ import (
"github.com/88250/lute/parse"
"github.com/88250/lute/render"
"github.com/emirpasic/gods/sets/hashset"
"github.com/siyuan-community/siyuan/kernel/cache"
"github.com/siyuan-community/siyuan/kernel/conf"
"github.com/siyuan-community/siyuan/kernel/filesys"
"github.com/siyuan-community/siyuan/kernel/sql"
Expand Down
12 changes: 12 additions & 0 deletions kernel/model/session.go
Original file line number Diff line number Diff line change
Expand Up @@ -296,6 +296,18 @@ func CheckAuth(c *gin.Context) {
return
}

// 通过 API token (query-params: token)
if token := c.Query("token"); "" != token {
if Conf.Api.Token == token {
c.Next()
return
}

c.JSON(http.StatusUnauthorized, map[string]interface{}{"code": -1, "msg": "Auth failed [query: token]"})
c.Abort()
return
}

// 通过 HTTP Basic
if certified, ok := checkBasic(c); ok {
if certified {
Expand Down
4 changes: 4 additions & 0 deletions scripts/_pkg/Const.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
HEADER_siyuan = '''
'''

HEADER_siyuan_community = '''
'''

HEADER = {
"siyuan-note/siyuan": HEADER_siyuan,
"siyuan-community/siyuan": HEADER_siyuan_community,
}
2 changes: 1 addition & 1 deletion scripts/parse-changelog-HEAD.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def generate_msg_from_repo(repo_name, args):
if not pat:
return None

action_file = "cd.yml"
action_file = "release.yml"
print(U.generate_header_from_repo(repo_name, args.tag, args.lastestRelease, args.electronVersion, action_file, C.HEADER[repo_name]))


Expand Down

0 comments on commit 0e4c885

Please sign in to comment.