ci: use GitHub action steps on proxied runner
This commit is contained in:
@@ -13,13 +13,13 @@ on:
|
||||
|
||||
jobs:
|
||||
cross-build-windows:
|
||||
# Gitea act_runner 标签为 9950x;该工作流在 Linux Runner 中交叉编译 Windows x86_64 包。
|
||||
runs-on: 9950x
|
||||
# 使用可访问 GitHub 的 Gitea act_runner(runner-mihomo),可直接拉取 actions/checkout、actions/upload-artifact 等 GitHub Action。
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
image: fedora:latest
|
||||
|
||||
steps:
|
||||
- name: Configure Fedora TUNA mirror
|
||||
- name: Prepare action runtime
|
||||
run: |
|
||||
set -euo pipefail
|
||||
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
|
||||
fi
|
||||
dnf makecache --refresh -y
|
||||
dnf install -y git nodejs
|
||||
|
||||
- name: Checkout
|
||||
run: |
|
||||
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"
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Install cross build dependencies
|
||||
run: |
|
||||
@@ -147,7 +134,19 @@ jobs:
|
||||
raise SystemExit(f'{part} is too large for the current Gitea upload path')
|
||||
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
|
||||
if: ${{ github.event_name != 'pull_request' }}
|
||||
env:
|
||||
PACKAGE_TOKEN: ${{ secrets.PACKAGE_TOKEN }}
|
||||
run: |
|
||||
|
||||
Reference in New Issue
Block a user