From ff5ac3ccb5f9c69b3ba96af1a6e9c9b2681db74d Mon Sep 17 00:00:00 2001 From: TheWhiteDog9487 Date: Sat, 12 Oct 2024 18:28:23 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0Workflow=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 66 +++++++++++++++++++++++-------------- 1 file changed, 41 insertions(+), 25 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 17c53e6..d6c2e12 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,34 +1,50 @@ name: 更新二进制可执行文件 on: - push: - paths: - - language.cpp + push: + paths: + - language.cpp jobs: - build: - permissions: - contents: write - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: 安装GCC对ARM交叉编译工具链 + run: apt install gcc-arm-none-eabi + + - name: 编译源代码 + run: | + arm-none-eabi-g++ -o language_arm --static -std=c++26 languagecpp + g++ -o language --static -std=c++26 language.cpp - - name: 安装GCC对ARM交叉编译工具链 - run: apt install gcc-arm-none-eabi - - - name: 编译源代码 - run: | - arm-none-eabi-g++ -o language_arm --static language.cpp - g++ -o language --static language.cpp + - uses: actions/upload-artifact@v4 + with: + name: 可执行二进制文件 + path: | + language_arm + language - - name: 提交 - run: | - git config --global user.email "gaojian520one@outlook.com" - git config --global user.name "TheWhiteDog9487" - git add . - git commit -m "新的二进制文件" - git push + push: + needs: build + runs-on: ubuntu-latest + permissions: + contents: write - - name: 推送 - uses: ad-m/github-push-action@master \ No newline at end of file + steps: + - uses: actions/checkout@v4 + - uses: actions/download-artifact@v4 + with: + 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