Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:construction_worker: Update workflow files (#17235)

Emptylighte8e13c8bcb46
diff --git a/.github/workflows/auto_aur_release_stable.yml b/.github/workflows/auto_aur_release_stable.yml
index 6d95483cfd..edc676c701 100644
--- a/.github/workflows/auto_aur_release_stable.yml
+++ b/.github/workflows/auto_aur_release_stable.yml
@@ -4,6 +4,8 @@ on:
release:
types: [published]
+# https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
+
jobs:
build:
if: ${{ github.repository_owner == 'siyuan-note' }}
@@ -14,20 +16,20 @@ jobs:
run: |
if [[ "${{ github.ref }}" == *"dev"* ]]; then
echo "Skip the workflow as the tag contains 'dev'"
- echo "::set-output name=skip::true"
+ echo "skip=true" >> $GITHUB_OUTPUT
else
echo "Continue the workflow"
- echo "::set-output name=skip::false"
+ echo "skip=false" >> $GITHUB_OUTPUT
fi
shell: bash
- name: Extract tag name
id: get_version
- run: echo ::set-output name=TAG_VERSION::${{ github.event.release.tag_name }}
+ run: echo "TAG_VERSION=${{ github.event.release.tag_name }}" >> $GITHUB_OUTPUT
- name: Extra tag name without v
id: get_version_without_v
- run: echo ::set-output name=TAG_VERSION_WITHOUT_V::$(echo "${{ github.event.release.tag_name }}" | sed 's/^v//')
+ run: echo "TAG_VERSION_WITHOUT_V=$(echo '${{ github.event.release.tag_name }}' | sed 's/^v//')" >> $GITHUB_OUTPUT
- name: Create PKGBUILD
run: |
@@ -95,7 +97,7 @@ jobs:
EOF
- name: Publish AUR package
- uses: KSXGitHub/[email protected]
+ uses: KSXGitHub/[email protected]
with:
pkgname: siyuan-bin
pkgbuild: ./PKGBUILD
diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml
index b0f8c1c442..8219f46837 100644
--- a/.github/workflows/cd.yml
+++ b/.github/workflows/cd.yml
@@ -8,9 +8,6 @@ on:
# ref https://docs.github.com/zh/actions/learn-github-actions/variables
env:
- repo_name_android: "siyuan-android"
- repo_name: "siyuan"
- repo_owner: "siyuan-note"
package_json: "app/package.json"
jobs:
@@ -24,10 +21,10 @@ jobs:
packageManager: ${{ steps.packageManager.outputs.value }}
steps:
- name: Checkout code
- uses: actions/checkout@v4
+ uses: actions/checkout@v6
- name: Setup Python
- uses: actions/setup-python@v5
+ uses: actions/setup-python@v6
with:
python-version: "3.11"
- run: pip install PyGithub
@@ -45,7 +42,7 @@ jobs:
uses: sergeysova/jq-action@v2
id: version
with:
- cmd: 'jq .version ${{ env.package_json }} -r'
+ cmd: "jq .version ${{ env.package_json }} -r"
- name: Extract electronVersion from package.json
uses: sergeysova/jq-action@v2
@@ -57,22 +54,22 @@ jobs:
uses: sergeysova/jq-action@v2
id: packageManager
with:
- cmd: "jq .packageManager ${{ env.package_json }} -r"
+ 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=$(TZ=Asia/Shanghai date +'v%Y%m%d%H%M')" >> $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 }}/${{ env.repo_name }})
- 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
+ echo "release_title=$(git show --format=%s --no-patch | head -1)" >> $GITHUB_OUTPUT
+ echo "release_version=$(TZ=Asia/Shanghai date +'v%Y%m%d%H%M')" >> $GITHUB_OUTPUT
+ changelog_header=$(python scripts/parse-changelog-HEAD.py -t ${{ github.ref }} -b ${{ steps.thisLatestRelease.outputs.release }} -e ${{ steps.electronVersion.outputs.value }} ${{ github.repository }})
+ changelog=$(python scripts/parse-changelog.py -t ${{ github.ref }} ${{ github.repository }})
+ 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 }}
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Release
id: create_release
@@ -92,7 +89,7 @@ jobs:
strategy:
matrix:
config:
- - os: ubuntu-22.04
+ - os: ubuntu-24.04
name: ubuntu build linux.AppImage
kernel_path: "../app/kernel-linux/SiYuan-Kernel"
build_args_prefix: "-s -w -X"
@@ -101,7 +98,7 @@ jobs:
goos: "linux"
goarch: "amd64"
suffix: "linux.AppImage"
- - os: ubuntu-22.04
+ - os: ubuntu-24.04
name: ubuntu build linux.tar.gz
kernel_path: "../app/kernel-linux/SiYuan-Kernel"
build_args_prefix: "-s -w -X"
@@ -141,100 +138,100 @@ jobs:
suffix: "win.exe"
steps:
- - uses: actions/checkout@v4
- with:
- path: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}
-
- - name: Set up MingGW
- uses: msys2/setup-msys2@v2
- if: "contains( matrix.config.goos, 'windows')"
- with:
- install: p7zip mingw-w64-x86_64-lua
-
- - name: Set up Go
- uses: actions/setup-go@v5
- with:
- go-version-file: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/kernel/go.mod
- - run: go version
-
- - name: Set up goversioninfo
- run: go get github.com/josephspurrier/goversioninfo/cmd/goversioninfo && go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo
- if: "contains( matrix.config.goos, 'windows')"
- working-directory: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/kernel
- env:
- GO111MODULE: on
- CGO_ENABLED: 1
- GOOS: ${{ matrix.config.goos }}
- GOPATH: ${{ github.workspace }}/go
- GOARCH: ${{ matrix.config.goarch }}
-
- - name: Set up Node
- uses: actions/setup-node@v4
- with:
- node-version: 20
-
- - name: Install Node pnpm
- run: npm install -g ${{ needs.create_release.outputs.packageManager }}
- working-directory: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app
-
- - name: Install Node Dependencies
- run: pnpm install --no-frozen-lockfile
- working-directory: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app
-
- - name: Building UI
- run: pnpm run build
- working-directory: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app
-
- - name: Remove Build Directory
- uses: JesseTG/[email protected]
- with:
- path: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app/build
-
- - name: Remove Kernel Directory for Linux
- uses: JesseTG/[email protected]
- with:
- path: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app/kernel-linux
-
- - name: Remove Kernel Directory for Windows
- uses: JesseTG/[email protected]
- with:
- path: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app/kernel
-
- - name: Remove Kernel Directory for macOS
- uses: JesseTG/[email protected]
- with:
- path: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app/kernel-darwin
-
- - name: Remove Kernel Directory for macOS ARM64
- uses: JesseTG/[email protected]
- with:
- path: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app/kernel-darwin-arm64
-
- - name: Generate Icon Resource and Properties/Version Info For Windows
- run: ${{ github.workspace }}\go\${{ matrix.config.gobin }}\goversioninfo -platform-specific=true -icon="resource\icon.ico" -manifest="resource\goversioninfo.exe.manifest"
- if: "contains( matrix.config.goos, 'windows')"
- working-directory: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/kernel
-
- - name: Building Kernel
- run: go build --tags fts5 -o "${{ matrix.config.kernel_path }}" -v -ldflags "${{ matrix.config.build_args_prefix }} github.com/${{ env.repo_owner }}/${{ env.repo_name }}/kernel/util.${{ matrix.config.build_args_suffix }}"
- working-directory: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/kernel
- env:
- GO111MODULE: on
- CGO_ENABLED: 1
- GOOS: ${{ matrix.config.goos }}
- GOPATH: ${{ github.workspace }}/go
- GOARCH: ${{ matrix.config.goarch }}
-
- - 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
-
- - name: Upload Release
- uses: actions/upload-release-asset@v1
- env:
- GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- with:
- upload_url: ${{ needs.create_release.outputs.upload_url }}
- asset_name: siyuan-${{ needs.create_release.outputs.release_version }}-${{ matrix.config.suffix }}
- asset_path: ${{ github.workspace }}/go/src/github.com/${{ env.repo_owner }}/${{ env.repo_name }}/app/build/siyuan-${{ needs.create_release.outputs.version }}-${{ matrix.config.suffix }}
- asset_content_type: application/octet-stream
+ - uses: actions/checkout@v6
+ with:
+ path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}
+
+ - name: Set up MingGW
+ uses: msys2/setup-msys2@v2
+ if: "contains( matrix.config.goos, 'windows')"
+ with:
+ install: p7zip mingw-w64-x86_64-lua
+
+ - name: Set up Go
+ uses: actions/setup-go@v6
+ with:
+ go-version-file: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/kernel/go.mod
+ - run: go version
+
+ - name: Set up goversioninfo
+ run: go get github.com/josephspurrier/goversioninfo/cmd/goversioninfo && go install github.com/josephspurrier/goversioninfo/cmd/goversioninfo
+ if: "contains( matrix.config.goos, 'windows')"
+ working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/kernel
+ env:
+ GO111MODULE: on
+ CGO_ENABLED: 1
+ GOOS: ${{ matrix.config.goos }}
+ GOPATH: ${{ github.workspace }}/go
+ GOARCH: ${{ matrix.config.goarch }}
+
+ - name: Set up Node
+ uses: actions/setup-node@v6
+ with:
+ node-version: 20
+
+ - name: Install Node pnpm
+ run: npm install -g ${{ needs.create_release.outputs.packageManager }}
+ working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/app
+
+ - name: Install Node Dependencies
+ run: pnpm install --no-frozen-lockfile
+ working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/app
+
+ - name: Building UI
+ run: pnpm run build
+ working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/app
+
+ - name: Remove Build Directory
+ uses: JesseTG/[email protected]
+ with:
+ path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/app/build
+
+ - name: Remove Kernel Directory for Linux
+ uses: JesseTG/[email protected]
+ with:
+ path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/app/kernel-linux
+
+ - name: Remove Kernel Directory for Windows
+ uses: JesseTG/[email protected]
+ with:
+ path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/app/kernel
+
+ - name: Remove Kernel Directory for macOS
+ uses: JesseTG/[email protected]
+ with:
+ path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/app/kernel-darwin
+
+ - name: Remove Kernel Directory for macOS ARM64
+ uses: JesseTG/[email protected]
+ with:
+ path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/app/kernel-darwin-arm64
+
+ - name: Generate Icon Resource and Properties/Version Info For Windows
+ run: ${{ github.workspace }}\go\${{ matrix.config.gobin }}\goversioninfo -platform-specific=true -icon="resource\icon.ico" -manifest="resource\goversioninfo.exe.manifest"
+ if: "contains( matrix.config.goos, 'windows')"
+ working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/kernel
+
+ - name: Building Kernel
+ run: go build --tags fts5 -o "${{ matrix.config.kernel_path }}" -v -ldflags "${{ matrix.config.build_args_prefix }} github.com/${{ github.repository }}/kernel/util.${{ matrix.config.build_args_suffix }}"
+ working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/kernel
+ env:
+ GO111MODULE: on
+ CGO_ENABLED: 1
+ GOOS: ${{ matrix.config.goos }}
+ GOPATH: ${{ github.workspace }}/go
+ GOARCH: ${{ matrix.config.goarch }}
+
+ - name: Building Electron App
+ run: pnpm run ${{ matrix.config.electron_args }}
+ working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/app
+
+ - name: Upload Release
+ uses: actions/upload-release-asset@v1
+ env:
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
+ with:
+ upload_url: ${{ needs.create_release.outputs.upload_url }}
+ asset_name: siyuan-${{ needs.create_release.outputs.release_version }}-${{ matrix.config.suffix }}
+ asset_path: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/app/build/siyuan-${{ needs.create_release.outputs.version }}-${{ matrix.config.suffix }}
+ asset_content_type: application/octet-stream
diff --git a/.github/workflows/dockerimage.yml b/.github/workflows/dockerimage.yml
index 3dde873d5c..87ef33a801 100644
--- a/.github/workflows/dockerimage.yml
+++ b/.github/workflows/dockerimage.yml
@@ -13,9 +13,6 @@ on:
# ref https://docs.github.com/zh/actions/learn-github-actions/variables
env:
- repo_name_android: "siyuan-android"
- repo_name: "siyuan"
- repo_owner: "siyuan-note"
package_json: "app/package.json"
docker_hub_owner: "b3log"
docker_hub_repo: "siyuan"
@@ -31,7 +28,7 @@ jobs:
steps:
- name: Checkout repository and submodules
- uses: actions/checkout@v4
+ uses: actions/checkout@v6
with:
ref: ${{ github.event.ref }}
submodules: recursive
@@ -59,13 +56,13 @@ jobs:
swap-storage: true
- name: Set up QEMU
- uses: docker/setup-qemu-action@v3
+ uses: docker/setup-qemu-action@v4
- name: Setup Docker buildx
- uses: docker/setup-buildx-action@v3
+ uses: docker/setup-buildx-action@v4
- name: Log in to Docker Hub
- uses: docker/login-action@v3
+ uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_PWD }}
diff --git a/scripts/parse-changelog-HEAD.py b/scripts/parse-changelog-HEAD.py
index 50d50a2310..e6ac0793f5 100644
--- a/scripts/parse-changelog-HEAD.py
+++ b/scripts/parse-changelog-HEAD.py
@@ -11,7 +11,8 @@ def generate_msg_from_repo(repo_name, args):
return None
action_file = "cd.yml"
- print(U.generate_header_from_repo(repo_name, args.tag, args.lastestRelease, args.electronVersion, action_file, C.HEADER[repo_name]))
+ header = C.HEADER.get(repo_name,"")
+ print(U.generate_header_from_repo(repo_name, args.tag, args.lastestRelease, args.electronVersion, action_file, header))
if __name__ == "__main__":