mirror of
https://github.com/EasyTier/EasyTier.git
synced 2026-04-22 16:17:23 +08:00
eee7d7a1ed
EasyTier Core / pre_job (push) Has been cancelled
EasyTier Core / build_web (push) Has been cancelled
EasyTier Core / build (freebsd-13.2-x86_64, 13.2, ubuntu-22.04, x86_64-unknown-freebsd) (push) Has been cancelled
EasyTier Core / build (linux-aarch64, ubuntu-22.04, aarch64-unknown-linux-musl) (push) Has been cancelled
EasyTier Core / build (linux-arm, ubuntu-22.04, arm-unknown-linux-musleabi) (push) Has been cancelled
EasyTier Core / build (linux-armhf, ubuntu-22.04, arm-unknown-linux-musleabihf) (push) Has been cancelled
EasyTier Core / build (linux-armv7, ubuntu-22.04, armv7-unknown-linux-musleabi) (push) Has been cancelled
EasyTier Core / build (linux-armv7hf, ubuntu-22.04, armv7-unknown-linux-musleabihf) (push) Has been cancelled
EasyTier Core / build (linux-loongarch64, ubuntu-24.04, loongarch64-unknown-linux-musl) (push) Has been cancelled
EasyTier Core / build (linux-mips, ubuntu-22.04, mips-unknown-linux-musl) (push) Has been cancelled
EasyTier Core / build (linux-mipsel, ubuntu-22.04, mipsel-unknown-linux-musl) (push) Has been cancelled
EasyTier Core / build (linux-riscv64, ubuntu-22.04, riscv64gc-unknown-linux-musl) (push) Has been cancelled
EasyTier Core / build (linux-x86_64, ubuntu-22.04, x86_64-unknown-linux-musl) (push) Has been cancelled
EasyTier Core / build (macos-aarch64, macos-latest, aarch64-apple-darwin) (push) Has been cancelled
EasyTier Core / build (macos-x86_64, macos-latest, x86_64-apple-darwin) (push) Has been cancelled
EasyTier Core / build (windows-arm64, windows-latest, aarch64-pc-windows-msvc) (push) Has been cancelled
EasyTier Core / build (windows-i686, windows-latest, i686-pc-windows-msvc) (push) Has been cancelled
EasyTier Core / build (windows-x86_64, windows-latest, x86_64-pc-windows-msvc) (push) Has been cancelled
EasyTier Core / core-result (push) Has been cancelled
EasyTier Core / magisk_build (push) Has been cancelled
EasyTier GUI / pre_job (push) Has been cancelled
EasyTier GUI / build-gui (linux-aarch64, aarch64-unknown-linux-gnu, ubuntu-22.04, aarch64-unknown-linux-musl) (push) Has been cancelled
EasyTier GUI / build-gui (linux-x86_64, x86_64-unknown-linux-gnu, ubuntu-22.04, x86_64-unknown-linux-musl) (push) Has been cancelled
EasyTier GUI / build-gui (macos-aarch64, aarch64-apple-darwin, macos-latest, aarch64-apple-darwin) (push) Has been cancelled
EasyTier GUI / build-gui (macos-x86_64, x86_64-apple-darwin, macos-latest, x86_64-apple-darwin) (push) Has been cancelled
EasyTier GUI / build-gui (windows-arm64, aarch64-pc-windows-msvc, windows-latest, aarch64-pc-windows-msvc) (push) Has been cancelled
EasyTier GUI / build-gui (windows-i686, i686-pc-windows-msvc, windows-latest, i686-pc-windows-msvc) (push) Has been cancelled
EasyTier GUI / build-gui (windows-x86_64, x86_64-pc-windows-msvc, windows-latest, x86_64-pc-windows-msvc) (push) Has been cancelled
EasyTier GUI / gui-result (push) Has been cancelled
EasyTier Mobile / pre_job (push) Has been cancelled
EasyTier Mobile / build-mobile (android, ubuntu-22.04, android) (push) Has been cancelled
EasyTier Mobile / mobile-result (push) Has been cancelled
EasyTier OHOS / cargo_fmt_check (push) Has been cancelled
EasyTier OHOS / pre_job (push) Has been cancelled
EasyTier OHOS / build-ohos (push) Has been cancelled
EasyTier Test / pre_job (push) Has been cancelled
EasyTier Test / test (push) Has been cancelled
168 lines
6.3 KiB
YAML
168 lines
6.3 KiB
YAML
name: EasyTier OHOS
|
|
|
|
on:
|
|
push:
|
|
branches: ["develop", "main", "releases/**"]
|
|
pull_request:
|
|
branches: ["develop", "main"]
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
defaults:
|
|
run:
|
|
# necessary for windows
|
|
shell: bash
|
|
|
|
jobs:
|
|
cargo_fmt_check:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: fmt check
|
|
working-directory: ./easytier-contrib/easytier-ohrs
|
|
run: |
|
|
bash ../../.github/workflows/install_rust.sh
|
|
rustup component add rustfmt
|
|
cargo fmt --all -- --check
|
|
pre_job:
|
|
# continue-on-error: true # Uncomment once integration is finished
|
|
runs-on: ubuntu-latest
|
|
# Map a step output to a job output
|
|
outputs:
|
|
# do not skip push on branch starts with releases/
|
|
should_skip: ${{ steps.skip_check.outputs.should_skip == 'true' && !startsWith(github.ref_name, 'releases/') }}
|
|
steps:
|
|
- id: skip_check
|
|
uses: fkirc/skip-duplicate-actions@v5
|
|
with:
|
|
# All of these options are optional, so you can remove them if you are happy with the defaults
|
|
concurrent_skipping: "same_content_newer"
|
|
skip_after_successful_duplicate: "true"
|
|
cancel_others: "true"
|
|
paths: '["Cargo.toml", "Cargo.lock", "easytier/**", "easytier-contrib/easytier-ohrs/**", ".github/workflows/ohos.yml", ".github/workflows/install_rust.sh"]'
|
|
build-ohos:
|
|
runs-on: ubuntu-latest
|
|
needs: pre_job
|
|
if: needs.pre_job.outputs.should_skip != 'true'
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Install dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
build-essential \
|
|
wget \
|
|
unzip \
|
|
git \
|
|
pkg-config curl libgl1-mesa-dev expect
|
|
sudo apt-get clean
|
|
|
|
- name: Get easytier version
|
|
run: |
|
|
EASYTIER_CARGO_VERSION=$(cargo metadata --format-version 1 --no-deps --manifest-path easytier/Cargo.toml \
|
|
| jq -r '.packages[0].version')
|
|
EASYTIER_GIT_HASH=$(git -C easytier rev-parse --short HEAD)
|
|
EASYTIER_VERSION="${EASYTIER_CARGO_VERSION}-${EASYTIER_GIT_HASH}"
|
|
echo "EASYTIER_VERSION=${EASYTIER_VERSION}" >> $GITHUB_ENV
|
|
cd ./easytier-contrib/easytier-ohrs/package
|
|
jq --arg v "$EASYTIER_VERSION" '.version = $v' oh-package.json5 > oh-package.tmp.json5
|
|
mv oh-package.tmp.json5 oh-package.json5
|
|
|
|
- name: Generate CHANGELOG.md for current commit
|
|
working-directory: ./easytier-contrib/easytier-ohrs/package
|
|
run: |
|
|
{
|
|
echo "## easytier-ohrs ${EASYTIER_VERSION}"
|
|
echo
|
|
git log -1 --pretty=format:"- %s"
|
|
echo
|
|
} > CHANGELOG.md
|
|
|
|
- name: Setup HarmonyOS CLI tools
|
|
uses: ErBWs/setup-ohos@v1
|
|
|
|
- name: Download and Extract Custom SDK
|
|
run: |
|
|
wget https://github.com/FrankHan052176/Easytier-OHOS-sdk/releases/download/v1/ohos-sdk.zip -O /tmp/ohos-sdk.zip
|
|
sudo unzip -o /tmp/ohos-sdk.zip -d /tmp/custom-sdk
|
|
sudo cp -rf /tmp/custom-sdk/linux/native/* $OHOS_NDK_HOME/native
|
|
echo "Custom SDK files deployed to $OHOS_NDK_HOME/native"
|
|
ls -a $OHOS_NDK_HOME/native
|
|
|
|
- name: Setup build environment
|
|
run: |
|
|
echo "TARGET_ARCH=aarch64-linux-ohos" >> $GITHUB_ENV
|
|
|
|
- name: Create clang wrapper script
|
|
run: |
|
|
sudo mkdir -p $OHOS_NDK_HOME/native/llvm
|
|
sudo tee $OHOS_NDK_HOME/native/llvm/aarch64-unknown-linux-ohos-clang.sh > /dev/null <<'EOF'
|
|
#!/bin/sh
|
|
exec $OHOS_NDK_HOME/native/llvm/bin/clang \
|
|
-target aarch64-linux-ohos \
|
|
--sysroot=$OHOS_NDK_HOME/native/sysroot \
|
|
-D__MUSL__ \
|
|
"$@"
|
|
EOF
|
|
sudo chmod +x $OHOS_NDK_HOME/native/llvm/aarch64-unknown-linux-ohos-clang.sh
|
|
|
|
- name: Build
|
|
working-directory: ./easytier-contrib/easytier-ohrs
|
|
run: |
|
|
sudo apt-get install -y llvm clang lldb lld
|
|
sudo apt-get install -y protobuf-compiler
|
|
bash ../../.github/workflows/install_rust.sh
|
|
source env.sh
|
|
cargo install ohrs
|
|
rustup target add aarch64-unknown-linux-ohos
|
|
cargo update easytier
|
|
ohrs doctor
|
|
ohrs build --release --arch aarch
|
|
ohrs artifact
|
|
mv package.har easytier-ohrs.har
|
|
|
|
- name: Publish To Center Ohpm
|
|
working-directory: ./easytier-contrib/easytier-ohrs
|
|
env:
|
|
OHPM_PUBLISH_CODE: ${{ secrets.OHPM_PUBLISH_CODE }}
|
|
OHPM_PRIVATE_KEY: ${{ secrets.OHPM_PRIVATE_KEY }}
|
|
OHPM_KEY_PASSPHRASE: ${{ secrets.OHPM_KEY_PASSPHRASE }}
|
|
if: ${{ env.OHPM_PUBLISH_CODE != '' }}
|
|
run: |
|
|
ohpm config set publish_id "$OHPM_PUBLISH_CODE"
|
|
ohpm config set publish_registry https://ohpm.openharmony.cn/ohpm
|
|
TMP_DIR=$(mktemp -d)
|
|
PRIVATE_KEY_FILE="$TMP_DIR/private_key"
|
|
printf '%s' "$OHPM_PRIVATE_KEY" > "$PRIVATE_KEY_FILE"
|
|
chmod 600 "$PRIVATE_KEY_FILE"
|
|
ohpm config set key_path $PRIVATE_KEY_FILE
|
|
unzip ohpm_crypto.zip -d /home/runner/work/
|
|
ohpm config set crypto_path /home/runner/work/ohpm_crypto
|
|
chmod 755 /home/runner/work/ohpm_crypto/*
|
|
PASSPHRASE="$(printf '%s' "$OHPM_KEY_PASSPHRASE" | tr -d '\r\n')"
|
|
ohpm config set key_passphrase "$PASSPHRASE"
|
|
ohpm publish easytier-ohrs.har
|
|
|
|
- name: Publish To Private Ohpm
|
|
working-directory: ./easytier-contrib/easytier-ohrs
|
|
env:
|
|
OHPM_PUBLISH_CODE: ${{ secrets.OHPM_PUBLISH_CODE }}
|
|
if: ${{ env.OHPM_PUBLISH_CODE != '' }}
|
|
run: |
|
|
printf '%s' "${{ secrets.CODEARTS_PRIVATE_OHPM }}" > ~/.ohpm/.ohpmrc
|
|
ohpm config set strict_ssl false
|
|
ohpm publish easytier-ohrs.har
|
|
curl --header "Content-Type: application/json" --request POST --data "{}" ${{ secrets.CODEARTS_WEBHOOKS }}
|
|
|
|
- name: Upload artifact
|
|
uses: actions/upload-artifact@v4
|
|
with:
|
|
name: easytier-ohos
|
|
path: |
|
|
./easytier-contrib/easytier-ohrs/easytier-ohrs.har
|
|
./easytier-contrib/easytier-ohrs/dist/arm64-v8a/libeasytier_ohrs.so
|
|
retention-days: 5
|
|
if-no-files-found: error
|