Update .NET 10 (#9239)

* Update dotnet to 10

* Update .NET version in build workflow

* Update build-osx.yml

* Update package-zip.yml

* Update package-rhel.sh

* Update print statement from 'Hello' to 'Goodbye'

* Update package-rhel-riscv.sh

* Create package-debian-riscv.sh

* Update build-linux.yml

* Create update-riscv-depand.yml

* Update update-riscv-depand.yml

* Update ServiceLib.csproj

* Update Directory.Packages.props

* Update UpdateService.cs

* Update UpdateService.cs

* Update Directory.Packages.props

* Update ServiceLib.csproj

* Replace SourceGear.sqlite3 with Repobot.SQLite.Unofficial

* Replace SourceGear.sqlite3 with Repobot.SQLite.Unofficial

* Update Repobot.SQLite.Unofficial version to 3.53.1.1

* Update package-zip.yml

* Update build-osx.yml

Adjust sleep duration to reduce race condition likelihood.

* Update Directory.Packages.props

* Update Directory.Packages.props

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: DHR60 <dehongren60@gmail.com>
Co-authored-by: xujie86 <167618598+xujie86@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
JieXu
2026-05-11 17:56:35 +08:00
committed by GitHub
parent cc57f952db
commit d1c9c0b536
12 changed files with 2541 additions and 1090 deletions
+74
View File
@@ -251,3 +251,77 @@ jobs:
--data-binary @"$f" \
"${upload_url}?name=${f##*/}"
done
deb-riscv64:
name: build and release deb riscv64
if: |
(github.event_name == 'workflow_dispatch' && inputs.release_tag != '') ||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
runs-on: ubuntu-24.04-riscv
container: debian:13
env:
RELEASE_TAG: ${{ case(inputs.release_tag != '', inputs.release_tag, github.ref_name) }}
steps:
- name: Prepare tools (Debian)
shell: bash
run: |
set -euo pipefail
export DEBIAN_FRONTEND=noninteractive
apt-get update
apt-get install -y sudo git rsync findutils tar gzip unzip which curl jq wget file \
ca-certificates desktop-file-utils xdg-utils fakeroot dpkg-dev \
gcc make libc6-dev libgcc-s1 libstdc++6 zlib1g libatomic1
- name: Checkout repo (for scripts)
shell: bash
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
rm -rf ./*
git init .
git config --global --add safe.directory "$PWD"
git remote add origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git fetch --depth=1 origin "${GITHUB_SHA}"
git checkout FETCH_HEAD
git submodule update --init --recursive
- name: Ensure script permissions
run: chmod 755 package-debian-riscv.sh
- name: Package DEB (Debian-family)
run: ./package-debian-riscv.sh "${RELEASE_TAG}"
- name: Collect DEBs into workspace
run: |
mkdir -p "$GITHUB_WORKSPACE/dist/deb-riscv64"
rsync -av "$HOME/debbuild/" "$GITHUB_WORKSPACE/dist/deb-riscv64/" || true
find "$GITHUB_WORKSPACE/dist/deb-riscv64" -name "*.deb" \
-exec mv {} "$GITHUB_WORKSPACE/dist/deb-riscv64/v2rayN-linux-riscv64.deb" \; || true
echo "==== Dist tree ===="
ls -R "$GITHUB_WORKSPACE/dist/deb-riscv64" || true
- name: Upload DEBs to release
shell: bash
env:
GITHUB_TOKEN: ${{ github.token }}
run: |
set -euo pipefail
shopt -s globstar nullglob
files=(dist/deb-riscv64/**/*.deb)
(( ${#files[@]} )) || { echo "No DEBs found."; exit 1; }
api="${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/releases/tags/${RELEASE_TAG}"
upload_url="$(curl -fsSL -H "Authorization: Bearer ${GITHUB_TOKEN}" "$api" | jq -r '.upload_url // empty' | sed 's/{?name,label}//')"
[[ "$upload_url" ]] || { echo "Release upload URL not found: ${RELEASE_TAG}"; exit 1; }
for f in "${files[@]}"; do
echo "Uploading ${f##*/}"
curl -fsSL -X POST \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
-H "Content-Type: application/vnd.debian.binary-package" \
--data-binary @"$f" \
"${upload_url}?name=${f##*/}"
done
+1 -1
View File
@@ -63,7 +63,7 @@ jobs:
run: ./package-osx.sh macos-$Arch v2rayN-macos-$Arch ${{ inputs.release_tag }}
- name: Sleep for race condition between matrix jobs
run: sleep $(awk 'BEGIN { srand(); printf "%.3f", rand()*2 }')
run: sleep "$(od -An -N2 -tu2 /dev/urandom | awk 'NR==1{printf "%.2f", $1/5461}')"
- name: Upload dmg to release
uses: svenstaro/upload-release-action@v2
+2 -2
View File
@@ -54,7 +54,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v5.2.0
with:
dotnet-version: '10.0.x'
dotnet-version: '10.0.1xx'
- name: Build v2rayN
working-directory: ./v2rayN
@@ -68,4 +68,4 @@ jobs:
uses: actions/upload-artifact@v7.0.1
with:
name: ${{ matrix.arch }}
path: ${{ matrix.arch }}
path: ${{ matrix.arch }}
+2 -2
View File
@@ -56,8 +56,8 @@ jobs:
run: mv "v2rayN-$Target-$Arch.zip" "v2rayN-$Target-$Arch-desktop.zip"
- name: Sleep for race condition between matrix jobs
run: sleep $(awk 'BEGIN { srand(); printf "%.3f", rand()*2 }')
run: sleep "$(od -An -N2 -tu2 /dev/urandom | awk 'NR==1{printf "%.2f", $1/5461}')"
- name: Upload zip archive to release
uses: svenstaro/upload-release-action@v2
with:
+256
View File
@@ -0,0 +1,256 @@
name: update riscv dependent versions
on:
workflow_dispatch:
push:
branches:
- master
permissions:
contents: write
concurrency:
group: update-riscv-dependent
cancel-in-progress: false
jobs:
update:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v5
- uses: actions/setup-dotnet@v5
with:
dotnet-version: 10.0.1xx
- run: sudo apt-get update && sudo apt-get install -y jq
- name: resolve
id: resolve
shell: bash
run: |
set -euo pipefail
TARGET_FILES=(
package-rhel-riscv.sh
package-debian-riscv.sh
)
echo "==> restore projects"
find . -name '*.csproj' | while read -r p; do
if grep -q '<TargetFramework>.*-windows' "$p"; then
echo "[skip] $p"
else
echo "[restore] $p"
dotnet restore "$p" -p:EnableWindowsTargeting=true || true
fi
done
echo "==> collect assets"
mapfile -t ASSETS < <(find . -path '*/obj/project.assets.json')
printf ' %s\n' "${ASSETS[@]}"
ALL_LIBS=()
for f in "${ASSETS[@]}"; do
mapfile -t libs < <(jq -r '.libraries | keys[]' "$f")
ALL_LIBS+=("${libs[@]}")
done
mapfile -t LIBS < <(printf '%s\n' "${ALL_LIBS[@]}" | sort -u)
extract() {
local name="$1"
for i in "${LIBS[@]}"; do
[[ "$i" == "$name/"* ]] && echo "${i#*/}"
done | sort -u
}
norm_version() { echo "${1#v}"; }
is_preview() { [[ "$(norm_version "$1")" == *-* ]]; }
base_version() { local v; v="$(norm_version "$1")"; echo "${v%%-*}"; }
key() {
local v core pre a b c p1 p2 p3
v="$(norm_version "$1")"
core="${v%%-*}"
[[ "$v" == *-* ]] && pre="${v#*-}" || pre=""
IFS='.' read -r a b c <<< "$core"
a=${a//[^0-9]/}; a=${a:-0}
b=${b//[^0-9]/}; b=${b:-0}
c=${c//[^0-9]/}; c=${c:-0}
if [[ -z "$pre" ]]; then
printf "%05d.%05d.%05d.1\n" "$a" "$b" "$c"
else
pre="${pre#preview.}"
IFS='.' read -ra p <<< "$pre"
p1=${p[0]:-0}; p1=${p1//[^0-9]/}; p1=${p1:-0}
p2=${p[1]:-0}; p2=${p2//[^0-9]/}; p2=${p2:-0}
p3=${p[2]:-0}; p3=${p3//[^0-9]/}; p3=${p3:-0}
printf "%05d.%05d.%05d.0.%05d.%05d.%05d\n" \
"$a" "$b" "$c" "$p1" "$p2" "$p3"
fi
}
latest() {
local best="" best_key="" cur cur_key
for cur in "$@"; do
[[ -n "$cur" ]] || continue
cur_key="$(key "$cur")"
echo " candidate: $cur -> $cur_key" >&2
if [[ -z "$best_key" || "$cur_key" > "$best_key" ]]; then
best="$cur"
best_key="$cur_key"
fi
done
echo "$best"
}
log_mixed_versions() {
local name="$1"; shift
local versions=("$@") bases=() v b
mapfile -t bases < <(
for v in "${versions[@]}"; do
[[ -n "$v" ]] && base_version "$v"
done | sort -u
)
for b in "${bases[@]}"; do
local has_stable=0 has_preview=0 matched=()
for v in "${versions[@]}"; do
[[ -n "$v" ]] || continue
[[ "$(base_version "$v")" == "$b" ]] || continue
matched+=("$v")
if is_preview "$v"; then
has_preview=1
else
has_stable=1
fi
done
if [[ "$has_stable" -eq 1 && "$has_preview" -eq 1 ]]; then
echo "[warn] $name: stable and preview both exist for base $b, prefer stable for this base" >&2
printf ' %s\n' "${matched[@]}" >&2
fi
done
}
filter_mixed_versions() {
local versions=("$@") stable_bases=() v b
mapfile -t stable_bases < <(
for v in "${versions[@]}"; do
if [[ -n "$v" ]] && ! is_preview "$v"; then
base_version "$v"
fi
done | sort -u
)
for v in "${versions[@]}"; do
[[ -n "$v" ]] || continue
b="$(base_version "$v")"
if is_preview "$v" && printf '%s\n' "${stable_bases[@]}" | grep -qxF "$b"; then
continue
fi
echo "$v"
done
}
read_var() {
sed -nE "s/^$2=\"\\\$\\{$2:-([^\"]+)\\}\".*/\\1/p" "$1" | head -n1
}
choose_final_version() {
local old="$1" new="$2"
[[ -n "$new" ]] || { echo "$old"; return; }
[[ -n "$old" ]] || { echo "$new"; return; }
if [[ "$(key "$old")" > "$(key "$new")" ]]; then
echo "$old"
else
echo "$new"
fi
}
update_file() {
local file="$1"
local old_skia old_harf final_skia final_harf changed=0
old_skia="$(read_var "$file" SKIA_VER)"
old_harf="$(read_var "$file" HARFBUZZ_VER)"
final_skia="$(choose_final_version "$old_skia" "$NEW_SKIA")"
final_harf="$(choose_final_version "$old_harf" "$NEW_HARF")"
echo "==> check $file"
echo " SKIA_VER: ${old_skia} -> ${NEW_SKIA} (apply: ${final_skia})"
echo " HARFBUZZ_VER: ${old_harf} -> ${NEW_HARF} (apply: ${final_harf})"
if [[ "$old_skia" != "$final_skia" ]]; then
sed -i -E "s|^SKIA_VER=.*|SKIA_VER=\"\\\${SKIA_VER:-$final_skia}\"|" "$file"
changed=1
fi
if [[ "$old_harf" != "$final_harf" ]]; then
sed -i -E "s|^HARFBUZZ_VER=.*|HARFBUZZ_VER=\"\\\${HARFBUZZ_VER:-$final_harf}\"|" "$file"
changed=1
fi
grep -qF "SKIA_VER=\"\${SKIA_VER:-$final_skia}\"" "$file"
grep -qF "HARFBUZZ_VER=\"\${HARFBUZZ_VER:-$final_harf}\"" "$file"
bash -n "$file"
[[ "$changed" -eq 1 ]]
}
mapfile -t SKIA < <(extract SkiaSharp)
mapfile -t HARF < <(extract HarfBuzzSharp)
echo "==> SkiaSharp"
printf ' %s\n' "${SKIA[@]}"
echo "==> HarfBuzzSharp"
printf ' %s\n' "${HARF[@]}"
log_mixed_versions "SkiaSharp" "${SKIA[@]}"
log_mixed_versions "HarfBuzzSharp" "${HARF[@]}"
mapfile -t SKIA < <(filter_mixed_versions "${SKIA[@]}")
mapfile -t HARF < <(filter_mixed_versions "${HARF[@]}")
NEW_SKIA="$(latest "${SKIA[@]}")"
NEW_HARF="$(latest "${HARF[@]}")"
echo "==> selected"
echo " SKIA_VER=$NEW_SKIA"
echo " HARFBUZZ_VER=$NEW_HARF"
any_changed=0
changed_files=()
for file in "${TARGET_FILES[@]}"; do
if update_file "$file"; then
any_changed=1
changed_files+=("$file")
fi
done
if [[ "$any_changed" -eq 0 ]]; then
echo "changed=0" >> "$GITHUB_OUTPUT"
exit 0
fi
{
echo "changed=1"
echo "changed_files<<EOF"
printf '%s\n' "${changed_files[@]}"
echo "EOF"
} >> "$GITHUB_OUTPUT"
- name: commit
if: steps.resolve.outputs.changed == '1'
run: |
git config user.name github-actions
git config user.email github-actions@github.com
git add package-rhel-riscv.sh package-debian-riscv.sh
if git diff --cached --quiet; then
exit 0
fi
git commit -m "chore: update riscv native dependency versions"
git push