From 12e92deaa38f393a75941c8a07c6011a19823609 Mon Sep 17 00:00:00 2001 From: AnNingUI Date: Wed, 28 May 2025 14:11:52 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20GitHub=20Actions=20?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81=E4=BB=A5=E6=9E=84=E5=BB=BA=E5=92=8C?= =?UTF-8?q?=E6=B5=8B=E8=AF=95=E9=A1=B9=E7=9B=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 61 +++++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..15a55e0 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,61 @@ +name: Build and Test + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build-and-test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + rust: [stable] + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Set up Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + override: true + + - name: Build project + uses: actions-rs/cargo@v1 + with: + command: build + args: --release + + - name: Run tests + uses: actions-rs/cargo@v1 + with: + command: test + args: --release + + - name: Package binary (Unix-like) + if: runner.os != 'Windows' + run: | + mkdir -p dist + cp target/release/treegen dist/ + tar -czvf treegen-${{ runner.os }}.tar.gz dist/treegen + + - name: Package binary (Windows) + if: runner.os == 'Windows' + run: | + mkdir dist + Copy-Item target\release\treegen.exe dist\ + Compress-Archive -Path dist\treegen.exe -DestinationPath treegen-${{ runner.os }}.zip + + - name: Upload artifact + uses: actions/upload-artifact@v3 + with: + name: treegen-${{ runner.os }} + path: | + treegen-${{ runner.os }}.tar.gz + treegen-${{ runner.os }}.zip From b70e3316e7b2c679834e9082945c777e92e40475 Mon Sep 17 00:00:00 2001 From: AnNingUI Date: Wed, 28 May 2025 14:14:48 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20GitHub=20Actions=20?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81=E4=B8=AD=E7=9A=84=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E8=B7=AF=E5=BE=84=EF=BC=8C=E7=A1=AE=E4=BF=9D=E7=94=9F=E6=88=90?= =?UTF-8?q?=E7=9A=84=E5=8E=8B=E7=BC=A9=E6=96=87=E4=BB=B6=E6=A0=BC=E5=BC=8F?= =?UTF-8?q?=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 15a55e0..f93f7ae 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -58,4 +58,4 @@ jobs: name: treegen-${{ runner.os }} path: | treegen-${{ runner.os }}.tar.gz - treegen-${{ runner.os }}.zip + treegen-${{ runner.os }}.zip \ No newline at end of file From 1798789b575a91b305fa93ce3a272bc45d08664f Mon Sep 17 00:00:00 2001 From: AnNingUI Date: Wed, 28 May 2025 14:18:41 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20GitHub=20Actions=20?= =?UTF-8?q?=E5=B7=A5=E4=BD=9C=E6=B5=81=EF=BC=8C=E9=99=8D=E7=BA=A7=E4=B8=8A?= =?UTF-8?q?=E4=BC=A0=E5=B7=A5=E4=BB=B6=E7=9A=84=E7=89=88=E6=9C=AC=E5=B9=B6?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=8E=8B=E7=BC=A9=E6=96=87=E4=BB=B6=E8=B7=AF?= =?UTF-8?q?=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/build.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index f93f7ae..edf8d3a 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -53,9 +53,9 @@ jobs: Compress-Archive -Path dist\treegen.exe -DestinationPath treegen-${{ runner.os }}.zip - name: Upload artifact - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v2 with: name: treegen-${{ runner.os }} path: | treegen-${{ runner.os }}.tar.gz - treegen-${{ runner.os }}.zip \ No newline at end of file + treegen-${{ runner.os }}.zip