mirror of
https://github.com/2dust/v2rayN.git
synced 2026-04-16 12:35:46 +00:00
Update build-linux.yml
This commit is contained in:
parent
e4516ad99f
commit
6f3587d0ee
1 changed files with 76 additions and 3 deletions
77
.github/workflows/build-linux.yml
vendored
77
.github/workflows/build-linux.yml
vendored
|
|
@ -28,7 +28,7 @@ jobs:
|
||||||
release_tag: ${{ inputs.release_tag }}
|
release_tag: ${{ inputs.release_tag }}
|
||||||
|
|
||||||
deb:
|
deb:
|
||||||
name: build and release deb
|
name: build and release deb x64 & arm64
|
||||||
if: |
|
if: |
|
||||||
(github.event_name == 'workflow_dispatch' && inputs.release_tag != '') ||
|
(github.event_name == 'workflow_dispatch' && inputs.release_tag != '') ||
|
||||||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
|
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
|
||||||
|
|
@ -80,7 +80,7 @@ jobs:
|
||||||
prerelease: true
|
prerelease: true
|
||||||
|
|
||||||
rpm:
|
rpm:
|
||||||
name: build and release rpm
|
name: build and release rpm x64 & arm64
|
||||||
if: |
|
if: |
|
||||||
(github.event_name == 'workflow_dispatch' && inputs.release_tag != '') ||
|
(github.event_name == 'workflow_dispatch' && inputs.release_tag != '') ||
|
||||||
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
|
(github.event_name == 'push' && startsWith(github.ref, 'refs/tags/'))
|
||||||
|
|
@ -178,3 +178,76 @@ jobs:
|
||||||
tag: ${{ env.RELEASE_TAG }}
|
tag: ${{ env.RELEASE_TAG }}
|
||||||
file_glob: true
|
file_glob: true
|
||||||
prerelease: true
|
prerelease: true
|
||||||
|
|
||||||
|
rpm-riscv64:
|
||||||
|
name: build and release rpm 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: rockylinux/rockylinux:10-ubi
|
||||||
|
env:
|
||||||
|
RELEASE_TAG: ${{ case(inputs.release_tag != '', inputs.release_tag, github.ref_name) }}
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Prepare tools (Red Hat)
|
||||||
|
shell: bash
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
dnf -y makecache
|
||||||
|
dnf -y install \
|
||||||
|
sudo git rpm-build rpmdevtools dnf-plugins-core rsync findutils tar gzip unzip which curl jq wget file \
|
||||||
|
ca-certificates desktop-file-utils xdg-utils python3 gcc make glibc-devel kernel-headers libatomic libstdc++
|
||||||
|
|
||||||
|
- 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-rhel-riscv.sh
|
||||||
|
|
||||||
|
- name: Package RPM (RHEL-family)
|
||||||
|
run: ./package-rhel-riscv.sh "${RELEASE_TAG}"
|
||||||
|
|
||||||
|
- name: Collect RPMs into workspace
|
||||||
|
run: |
|
||||||
|
mkdir -p "$GITHUB_WORKSPACE/dist/rpm-riscv64"
|
||||||
|
rsync -av "$HOME/rpmbuild/RPMS/" "$GITHUB_WORKSPACE/dist/rpm-riscv64/" || true
|
||||||
|
find "$GITHUB_WORKSPACE/dist/rpm-riscv64" -name "*.riscv64.rpm" \
|
||||||
|
-exec mv {} "$GITHUB_WORKSPACE/dist/rpm-riscv64/v2rayN-linux-rhel-riscv64.rpm" \; || true
|
||||||
|
echo "==== Dist tree ===="
|
||||||
|
ls -R "$GITHUB_WORKSPACE/dist/rpm-riscv64" || true
|
||||||
|
|
||||||
|
- name: Upload RPMs to release
|
||||||
|
shell: bash
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
run: |
|
||||||
|
set -euo pipefail
|
||||||
|
shopt -s globstar nullglob
|
||||||
|
|
||||||
|
files=(dist/rpm-riscv64/**/*.rpm)
|
||||||
|
(( ${#files[@]} )) || { echo "No RPMs 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/x-rpm" \
|
||||||
|
--data-binary @"$f" \
|
||||||
|
"${upload_url}?name=${f##*/}"
|
||||||
|
done
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue