From 231e88e506222c122e9cab17037ff5d23e5e1547 Mon Sep 17 00:00:00 2001 From: TheWhiteDog9487 <60037547+TheWhiteDog9487@users.noreply.github.com> Date: Sun, 13 Oct 2024 10:50:54 +0800 Subject: [PATCH] Update build.yml --- .github/workflows/build.yml | 28 ++++++++++++++++------------ 1 file changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 8c29786..e3b7bd5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -4,7 +4,8 @@ on: workflow_dispatch: push: paths: - - language.cpp + - "language.cpp" + # 只在源代码被更新时运行 jobs: @@ -19,33 +20,36 @@ jobs: run: | g++ -o language --static -std=c++20 language.cpp aarch64-linux-gnu-g++ -o language_arm --static -std=c++20 language.cpp + # 静态链接,避免运行时才发现缺少so动态链接库 - uses: actions/upload-artifact@v4 with: - name: 可执行二进制文件 - path: | - language_arm - language - + name: language_arm + path: language_arm + - uses: actions/upload-artifact@v4 + with: + name: language + path: language push: needs: build runs-on: ubuntu-latest permissions: contents: write + # 更新仓库需要写入权限 steps: - uses: actions/checkout@v4 - uses: actions/download-artifact@v4 with: - name: 可执行二进制文件 + name: language + - uses: actions/download-artifact@v4 + with: + name: language_arm - - name: 提交 + - name: 推送 run: | git config --global user.email "gaojian520one@outlook.com" git config --global user.name "TheWhiteDog9487" git add . git commit -m "新的二进制文件" - git push - - - name: 推送 - uses: ad-m/github-push-action@master \ No newline at end of file + git push \ No newline at end of file