Skip to content

test - setup cmake

test - setup cmake #4

name: test download cmake
on:
# push:
# tags:
# - 'v*' # 触发条件:当推送标签以 'v' 开头时
workflow_dispatch: # 允许手动触发工作流
jobs:
build:
runs-on: ubuntu-22.04 # 使用最新的 Ubuntu 运行环境
steps:
- name: Checkout code
uses: actions/checkout@v3
# with:
# submodules: true
- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '17' # 设置 JDK 版本
distribution: 'temurin' # 指定 JDK 发行版(例如 'adopt', 'zulu', 'temurin', 'oracle' 等)
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y \
curl \
make \
tar \
libssl-dev \
maven \
unzip \
python3 \
git
- name: Download Android Command Line Tools
run: |
export ANDROID_HOME=$HOME/android-sdk
mkdir -p $ANDROID_HOME/cmdline-tools
curl -L -o cmdline-tools.zip https://dl.google.com/android/repository/commandlinetools-linux-11076708_latest.zip
unzip cmdline-tools.zip -d $ANDROID_HOME/cmdline-tools
rm cmdline-tools.zip
- name: Download cmake
run: |
wget https://cmake.org/files/v3.16/cmake-3.16.3-Linux-x86_64.tar.gz
sudo mv /usr/local/bin/cmake /usr/local/bin/cmake_os_bundled
tar -xzf cmake-3.16.3-Linux-x86_64.tar.gz
ls -l cmake-3.16.3-Linux-x86_64/bin/
chmod +x cmake-3.16.3-Linux-x86_64/bin/*
sudo ln -s cmake-3.16.3-Linux-x86_64/bin/cmake /usr/local/bin/cmake
echo "cmake installed: $(cmake --version)"