ci: build rpm package (#2044)

* add rpm to ci
* rename build_filter to build-filter
* use prepare-pnpm action
This commit is contained in:
Luna Yao
2026-04-04 04:32:08 +02:00
committed by GitHub
parent e4b0f1f1bb
commit 9cc617ae4c
10 changed files with 49 additions and 109 deletions
+1 -1
View File
@@ -23,7 +23,7 @@ runs:
if: ${{ inputs.web == 'true' }} if: ${{ inputs.web == 'true' }}
uses: ./.github/actions/prepare-pnpm uses: ./.github/actions/prepare-pnpm
with: with:
build_filter: './easytier-web/*' build-filter: './easytier-web/*'
- name: Install GUI dependencies (Used by clippy) - name: Install GUI dependencies (Used by clippy)
if: ${{ inputs.gui == 'true' }} if: ${{ inputs.gui == 'true' }}
+13 -7
View File
@@ -3,20 +3,21 @@ author: Luna
description: 'Setup Node.js, pnpm, and install dependencies' description: 'Setup Node.js, pnpm, and install dependencies'
inputs: inputs:
build_filter: build-filter:
description: 'The filter argument for pnpm build (e.g. ./easytier-web/*)' description: 'The filter argument for pnpm build (e.g. ./easytier-web/*)'
required: true required: false
default: ''
runs: runs:
using: "composite" using: "composite"
steps: steps:
- name: Setup Node.js - name: Setup Node.js
uses: actions/setup-node@v4 uses: actions/setup-node@v5
with: with:
node-version: 22 node-version: 22
- name: Install pnpm - name: Install pnpm
uses: pnpm/action-setup@v4 uses: pnpm/action-setup@v5
with: with:
version: 10 version: 10
run_install: false run_install: false
@@ -27,7 +28,7 @@ runs:
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache - name: Setup pnpm cache
uses: actions/cache@v4 uses: actions/cache@v5
with: with:
path: ${{ env.STORE_PATH }} path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
@@ -38,5 +39,10 @@ runs:
shell: bash shell: bash
run: | run: |
pnpm -r install pnpm -r install
echo "Building with filter: ${{ inputs.build_filter }}" if [ -n "${{ inputs.build-filter }}" ]; then
pnpm -r --filter "${{ inputs.build_filter }}" build echo "Building with filter: ${{ inputs.build-filter }}"
pnpm -r --filter "${{ inputs.build-filter }}" build
else
echo "No build filter provided, building all packages"
pnpm -r build
fi
+9 -32
View File
@@ -36,38 +36,15 @@ jobs:
needs: pre_job needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true' if: needs.pre_job.outputs.should_skip != 'true'
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v5
- uses: actions/setup-node@v4 - name: Setup Frontend Environment
uses: ./.github/actions/prepare-pnpm
with: with:
node-version: 22 build-filter: './easytier-web/*'
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install frontend dependencies
run: |
pnpm -r install
pnpm -r --filter "./easytier-web/*" build
- name: Archive artifact - name: Archive artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v5
with: with:
name: easytier-web-dashboard name: easytier-web-dashboard
path: | path: |
@@ -142,7 +119,7 @@ jobs:
- build_web - build_web
if: needs.pre_job.outputs.should_skip != 'true' if: needs.pre_job.outputs.should_skip != 'true'
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v5
- name: Set current ref as env variable - name: Set current ref as env variable
run: | run: |
@@ -290,7 +267,7 @@ jobs:
rm -rf ./artifacts/objects/ rm -rf ./artifacts/objects/
- name: Archive artifact - name: Archive artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v5
with: with:
name: easytier-${{ matrix.ARTIFACT_NAME }} name: easytier-${{ matrix.ARTIFACT_NAME }}
path: | path: |
@@ -317,7 +294,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout Code - name: Checkout Code
uses: actions/checkout@v4 # 必须先检出代码才能获取模块配置 uses: actions/checkout@v5 # 必须先检出代码才能获取模块配置
# 下载二进制文件到独立目录 # 下载二进制文件到独立目录
- name: Download Linux aarch64 binaries - name: Download Linux aarch64 binaries
@@ -337,7 +314,7 @@ jobs:
# 上传生成的模块 # 上传生成的模块
- name: Upload Magisk Module - name: Upload Magisk Module
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v5
with: with:
name: Easytier-Magisk name: Easytier-Magisk
path: | path: |
+1 -1
View File
@@ -31,7 +31,7 @@ jobs:
steps: steps:
- -
name: Checkout name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v5
- -
name: Validate inputs name: Validate inputs
run: | run: |
+12 -30
View File
@@ -78,7 +78,7 @@ jobs:
needs: pre_job needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true' if: needs.pre_job.outputs.should_skip != 'true'
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v5
- name: Install GUI dependencies (x86 only) - name: Install GUI dependencies (x86 only)
if: ${{ matrix.TARGET == 'x86_64-unknown-linux-musl' }} if: ${{ matrix.TARGET == 'x86_64-unknown-linux-musl' }}
@@ -119,37 +119,18 @@ jobs:
echo "PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu/" >> "$GITHUB_ENV" echo "PKG_CONFIG_SYSROOT_DIR=/usr/aarch64-linux-gnu/" >> "$GITHUB_ENV"
echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig/" >> "$GITHUB_ENV" echo "PKG_CONFIG_PATH=/usr/lib/aarch64-linux-gnu/pkgconfig/" >> "$GITHUB_ENV"
- name: Install rpm package (Linux target only)
if: ${{ contains(matrix.TARGET, '-linux-') }}
run: |
sudo apt update
sudo apt install -y rpm
- name: Set current ref as env variable - name: Set current ref as env variable
run: | run: |
echo "GIT_DESC=$(git log -1 --format=%cd.%h --date=format:%Y-%m-%d_%H:%M:%S)" >> $GITHUB_ENV echo "GIT_DESC=$(git log -1 --format=%cd.%h --date=format:%Y-%m-%d_%H:%M:%S)" >> $GITHUB_ENV
- uses: actions/setup-node@v4 - name: Setup Frontend Environment
with: uses: ./.github/actions/prepare-pnpm
node-version: 22
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install frontend dependencies
run: |
pnpm -r install
pnpm -r build
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
with: with:
@@ -184,7 +165,7 @@ jobs:
with: with:
projectPath: ./easytier-gui projectPath: ./easytier-gui
# https://tauri.app/v1/guides/building/linux/#cross-compiling-tauri-applications-for-arm-based-devices # https://tauri.app/v1/guides/building/linux/#cross-compiling-tauri-applications-for-arm-based-devices
args: --verbose --target ${{ matrix.GUI_TARGET }} ${{ matrix.OS == 'ubuntu-22.04' && contains(matrix.TARGET, 'aarch64') && '--bundles deb' || '' }} args: --verbose --target ${{ matrix.GUI_TARGET }} ${{ contains(matrix.TARGET, '-linux-') && contains(matrix.TARGET, 'aarch64') && '--bundles deb,rpm' || '' }}
- name: Compress - name: Compress
run: | run: |
@@ -202,6 +183,7 @@ jobs:
mv ./target/$GUI_TARGET/release/bundle/dmg/*.dmg ./artifacts/objects/ mv ./target/$GUI_TARGET/release/bundle/dmg/*.dmg ./artifacts/objects/
elif [[ $OS =~ ^ubuntu.*$ && ! $TARGET =~ ^mips.*$ ]]; then elif [[ $OS =~ ^ubuntu.*$ && ! $TARGET =~ ^mips.*$ ]]; then
mv ./target/$GUI_TARGET/release/bundle/deb/*.deb ./artifacts/objects/ mv ./target/$GUI_TARGET/release/bundle/deb/*.deb ./artifacts/objects/
mv ./target/$GUI_TARGET/release/bundle/rpm/*.rpm ./artifacts/objects/
if [[ $GUI_TARGET =~ ^x86_64.*$ ]]; then if [[ $GUI_TARGET =~ ^x86_64.*$ ]]; then
# currently only x86 appimage is supported # currently only x86 appimage is supported
mv ./target/$GUI_TARGET/release/bundle/appimage/*.AppImage ./artifacts/objects/ mv ./target/$GUI_TARGET/release/bundle/appimage/*.AppImage ./artifacts/objects/
@@ -212,7 +194,7 @@ jobs:
rm -rf ./artifacts/objects/ rm -rf ./artifacts/objects/
- name: Archive artifact - name: Archive artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v5
with: with:
name: easytier-gui-${{ matrix.ARTIFACT_NAME }} name: easytier-gui-${{ matrix.ARTIFACT_NAME }}
path: | path: |
+4 -29
View File
@@ -47,7 +47,7 @@ jobs:
needs: pre_job needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true' if: needs.pre_job.outputs.should_skip != 'true'
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v5
- name: Set current ref as env variable - name: Set current ref as env variable
run: | run: |
@@ -70,33 +70,8 @@ jobs:
echo "$ANDROID_HOME/ndk/26.0.10792818/toolchains/llvm/prebuilt/linux-x86_64/bin" >> $GITHUB_PATH echo "$ANDROID_HOME/ndk/26.0.10792818/toolchains/llvm/prebuilt/linux-x86_64/bin" >> $GITHUB_PATH
echo "NDK_HOME=$ANDROID_HOME/ndk/26.0.10792818/" > $GITHUB_ENV echo "NDK_HOME=$ANDROID_HOME/ndk/26.0.10792818/" > $GITHUB_ENV
- uses: actions/setup-node@v4 - name: Setup Frontend Environment
with: uses: ./.github/actions/prepare-pnpm
node-version: 22
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 10
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- name: Setup pnpm cache
uses: actions/cache@v4
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install frontend dependencies
run: |
pnpm -r install
pnpm -r build
- uses: Swatinem/rust-cache@v2 - uses: Swatinem/rust-cache@v2
with: with:
@@ -138,7 +113,7 @@ jobs:
rm -rf ./artifacts/objects/ rm -rf ./artifacts/objects/
- name: Archive artifact - name: Archive artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v5
with: with:
name: easytier-gui-${{ matrix.ARTIFACT_NAME }} name: easytier-gui-${{ matrix.ARTIFACT_NAME }}
path: | path: |
+1 -1
View File
@@ -16,7 +16,7 @@ jobs:
check-full-shell: check-full-shell:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v5
- name: Install Nix - name: Install Nix
uses: cachix/install-nix-action@v27 uses: cachix/install-nix-action@v27
+3 -3
View File
@@ -22,7 +22,7 @@ jobs:
cargo_fmt_check: cargo_fmt_check:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v5
- name: fmt check - name: fmt check
working-directory: ./easytier-contrib/easytier-ohrs working-directory: ./easytier-contrib/easytier-ohrs
run: | run: |
@@ -52,7 +52,7 @@ jobs:
OHPM_PUBLISH_CODE: ${{ secrets.OHPM_PUBLISH_CODE }} OHPM_PUBLISH_CODE: ${{ secrets.OHPM_PUBLISH_CODE }}
if: needs.pre_job.outputs.should_skip != 'true' if: needs.pre_job.outputs.should_skip != 'true'
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v5
- name: Install dependencies - name: Install dependencies
run: | run: |
sudo apt-get update sudo apt-get update
@@ -181,7 +181,7 @@ jobs:
mv package.har easytier-release.har mv package.har easytier-release.har
- name: Upload artifact - name: Upload artifact
uses: actions/upload-artifact@v4 uses: actions/upload-artifact@v5
with: with:
name: easytier-ohos name: easytier-ohos
path: | path: |
+1 -1
View File
@@ -35,7 +35,7 @@ jobs:
steps: steps:
- -
name: Checkout name: Checkout
uses: actions/checkout@v4 uses: actions/checkout@v5
- name: Download Core Artifact - name: Download Core Artifact
uses: dawidd6/action-download-artifact@v11 uses: dawidd6/action-download-artifact@v11
+4 -4
View File
@@ -38,7 +38,7 @@ jobs:
needs: pre_job needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true' if: needs.pre_job.outputs.should_skip != 'true'
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v5
- name: Prepare build environment - name: Prepare build environment
uses: ./.github/actions/prepare-build uses: ./.github/actions/prepare-build
@@ -79,7 +79,7 @@ jobs:
needs: pre_job needs: pre_job
if: needs.pre_job.outputs.should_skip != 'true' if: needs.pre_job.outputs.should_skip != 'true'
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v5
- name: Prepare build environment - name: Prepare build environment
uses: ./.github/actions/prepare-build uses: ./.github/actions/prepare-build
@@ -95,7 +95,7 @@ jobs:
- name: Archive test - name: Archive test
run: cargo nextest archive --archive-file tests.tar.zst --package easytier --features full run: cargo nextest archive --archive-file tests.tar.zst --package easytier --features full
- uses: actions/upload-artifact@v4 - uses: actions/upload-artifact@v5
with: with:
name: tests name: tests
path: tests.tar.zst path: tests.tar.zst
@@ -119,7 +119,7 @@ jobs:
- name: "three_node::subnet_proxy_three_node_test" - name: "three_node::subnet_proxy_three_node_test"
opts: "-E 'test(subnet_proxy_three_node_test)' --test-threads 1 --no-fail-fast" opts: "-E 'test(subnet_proxy_three_node_test)' --test-threads 1 --no-fail-fast"
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v5
- name: Setup tools for test - name: Setup tools for test
run: sudo apt install bridge-utils run: sudo apt install bridge-utils