尝试解决编译报错 #35
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This is a basic workflow to help you get started with Actions | |
name: CI | |
# Controls when the workflow will run | |
on: | |
# Triggers the workflow on push or pull request events but only for the "main" branch | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
watch: | |
types: [started] | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | |
jobs: | |
# This workflow contains a single job called "build" | |
build: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
# Steps represent a sequence of tasks that will be executed as part of the job | |
steps: | |
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it | |
- uses: actions/checkout@v3 | |
# Runs a single command using the runners shell | |
- name: 执行依赖 | |
run: | | |
sudo apt install \ | |
make binutils autoconf automake autotools-dev \ | |
libtool pkg-config git curl dpkg-dev autopoint libcppunit-dev \ | |
libxml2-dev lzip wget jq libcares-dev -y | |
- name: 准备 | |
run: | | |
git clone https://github.com/aria2/aria2.git | |
cd aria2 | |
#echo "::set-env name=ARIAPATH::$(pwd)" | |
autoreconf -i | |
git clone https://github.com/Rorschach331/aria2c-aarch64-build.git ./custom-shells | |
cd ./custom-shells | |
ls | |
sudo chmod +x *.sh | |
sudo ./tools.sh | |
sudo ./libs.sh | |
#cd /tmp/build-aria2c/aria2 | |
#cd {{ env.aria2_path }} | |
- name: 编译 | |
id: makefile | |
run: | | |
cd aria2 | |
ls /opt/aria2-aarch64/build_libs/lib/ | |
./custom-shells/make-config.sh | |
make | |
/opt/aria2-aarch64/tools/gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-strip ./src/aria2c | |
echo "::set-output name=status::success" | |
- name: 打包 | |
uses: actions/upload-artifact@main | |
if: steps.makefile.outputs.status == 'success' && !cancelled() | |
with: | |
name: aria2c-aarch64-linux-builds | |
path: ./aria2/src/aria2c | |
- name: Generate release tag | |
id: tag | |
if: cancelled() != true | |
run: | | |
ARIA2VERSION=$(curl -sL https://api.github.com/repos/aria2/aria2/releases | jq -r ".[0].tag_name") | |
MYVERSION=$(curl -sL https://api.github.com/repos/Rorschach331/aria2c-aarch64-build/releases | jq -r ".[0].tag_name") | |
echo "::set-output name=release_tag::$ARIA2VERSION" | |
if [ "$ARIA2VERSION" != "$MYVERSION" ] | |
then | |
echo "版本不一致,可以发布" | |
echo "::set-output name=status::success" | |
fi | |
- name: Upload binary to release | |
uses: softprops/action-gh-release@v1 | |
if: steps.tag.outputs.status == 'success' && !cancelled() | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
name: aria2c-aarch64-gnu-linux-builds-${{steps.tag.outputs.release_tag}} | |
tag_name: ${{ steps.tag.outputs.release_tag }} | |
files: ./aria2/src/aria2c | |
- name: Delete workflow runs | |
uses: GitRML/delete-workflow-runs@main | |
with: | |
retain_days: 1 | |
keep_minimum_runs: 3 | |
- name: Remove old Releases | |
uses: dev-drprasad/[email protected] | |
if: cancelled() != true | |
with: | |
keep_latest: 3 | |
delete_tags: true | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |