ci: use GitHub action steps on proxied runner

This commit is contained in:
luochen570
2026-05-30 14:06:14 +08:00
parent 796a2b7712
commit add0a6758e

View File

@@ -13,13 +13,13 @@ on:
jobs: jobs:
cross-build-windows: cross-build-windows:
# Gitea act_runner 标签为 9950x该工作流在 Linux Runner 中交叉编译 Windows x86_64 包 # 使用可访问 GitHub 的 Gitea act_runnerrunner-mihomo可直接拉取 actions/checkout、actions/upload-artifact 等 GitHub Action
runs-on: 9950x runs-on: ubuntu-latest
container: container:
image: fedora:latest image: fedora:latest
steps: steps:
- name: Configure Fedora TUNA mirror - name: Prepare action runtime
run: | run: |
set -euo pipefail set -euo pipefail
sed -e 's|^metalink=|#metalink=|g' \ sed -e 's|^metalink=|#metalink=|g' \
@@ -29,23 +29,10 @@ jobs:
sed -i 's|^enabled=1|enabled=0|g' /etc/yum.repos.d/fedora-cisco-openh264.repo sed -i 's|^enabled=1|enabled=0|g' /etc/yum.repos.d/fedora-cisco-openh264.repo
fi fi
dnf makecache --refresh -y dnf makecache --refresh -y
dnf install -y git nodejs
- name: Checkout - name: Checkout
run: | uses: actions/checkout@v4
set -euo pipefail
dnf install -y git rsync
WORKDIR="$(pwd)"
SRC_DIR="$(mktemp -d /tmp/chengnan-source.XXXXXX)"
REPO_URL="${GITHUB_SERVER_URL:-https://git.luochen570.cn}/${GITHUB_REPOSITORY}.git"
TOKEN="${GITHUB_TOKEN:-}"
if [ -n "$TOKEN" ]; then
git -c http.extraHeader="Authorization: token ${TOKEN}" \
clone --depth 1 --branch "${GITHUB_REF_NAME:-main}" "$REPO_URL" "$SRC_DIR"
else
git clone --depth 1 --branch "${GITHUB_REF_NAME:-main}" "$REPO_URL" "$SRC_DIR"
fi
rsync -a --delete "$SRC_DIR/" "$WORKDIR/"
rm -rf "$SRC_DIR"
- name: Install cross build dependencies - name: Install cross build dependencies
run: | run: |
@@ -147,7 +134,19 @@ jobs:
raise SystemExit(f'{part} is too large for the current Gitea upload path') raise SystemExit(f'{part} is too large for the current Gitea upload path')
PY PY
- name: Upload artifact
uses: actions/upload-artifact@v3
with:
name: chengnan-windows-x86_64-cross
path: |
dist-windows-cross/chengnan-windows-x86_64-cross.zip
dist-windows-cross/chengnan-windows-x86_64-cross.zip.sha256
dist-windows-cross/chengnan-windows-x86_64-cross.zip.part-*
dist-windows-cross/chengnan-windows-x86_64-cross.zip.parts.sha256
if-no-files-found: error
- name: Upload package to Gitea Packages - name: Upload package to Gitea Packages
if: ${{ github.event_name != 'pull_request' }}
env: env:
PACKAGE_TOKEN: ${{ secrets.PACKAGE_TOKEN }} PACKAGE_TOKEN: ${{ secrets.PACKAGE_TOKEN }}
run: | run: |