From 28980017c4c6fb8902a1c73077d0983a982b98a0 Mon Sep 17 00:00:00 2001 From: wed150 Date: Sun, 14 Jun 2026 00:02:00 +0800 Subject: [PATCH] chore: update action Signed-off-by: wed150 --- .github/workflows/build.yml | 44 ++++++++++----------- .github/workflows/release.yml | 73 +++++++++++++++-------------------- 2 files changed, 54 insertions(+), 63 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ffeb4f3..52f83fa 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,33 +7,33 @@ jobs: build: runs-on: windows-latest steps: - - name: Checkout repository - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup XMake + uses: xmake-io/github-action-setup-xmake@v1 + + - name: Cache + uses: actions/cache@v4 with: - submodules: recursive + path: | + ~/AppData/Local/.xmake + key: xmake-${{ hashFiles('xmake.lua') }} + restore-keys: | + xmake- - - uses: actions/checkout@v4 + - name: Update Repo + run: xmake repo -u - - uses: xmake-io/github-action-setup-xmake@v1 - with: - xmake-version: branch@master - - run: | - xmake repo -u + - name: Update Project + run: xmake f -a x64 -m release -p windows -v -y - - run: | - xmake f -a x64 -m release -p windows -v -y + - name: Build Project + run: xmake -v -y - - run: | - xmake -w -y - - - uses: actions/upload-artifact@v3 + - name: Upload Artifact + uses: actions/upload-artifact@v4 with: name: ${{ github.event.repository.name }}-windows-x64-${{ github.sha }} path: | - bin/DLL/ - - - uses: actions/upload-artifact@v3 - with: - name: PDB - path: | - bin/PDB/ + bin/ \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ee7b8c5..1bb33ab 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,36 +7,36 @@ jobs: build: runs-on: windows-latest steps: - - name: Checkout repository - uses: actions/checkout@v2 + - name: Checkout + uses: actions/checkout@v4 + + - name: Setup XMake + uses: xmake-io/github-action-setup-xmake@v1 + + - name: Cache + uses: actions/cache@v4 with: - submodules: recursive + path: | + ~/AppData/Local/.xmake + key: xmake-${{ hashFiles('xmake.lua') }} + restore-keys: | + xmake- - - uses: actions/checkout@v4 + - name: Update Repo + run: xmake repo -u - - uses: xmake-io/github-action-setup-xmake@v1 - with: - xmake-version: branch@master - - run: | - xmake repo -u + - name: Update Project + run: xmake f -a x64 -m release -p windows -v -y - - run: | - xmake f -a x64 -m release -p windows -v -y + - name: Build Project + run: xmake -v -y - - run: | - xmake -w -y - - - uses: actions/upload-artifact@v3 + - name: Upload Artifact + uses: actions/upload-artifact@v4 with: name: ${{ github.event.repository.name }}-windows-x64-${{ github.sha }} path: | - bin/DLL/ - - - uses: actions/upload-artifact@v3 - with: - name: PDB - path: | - bin/PDB/ + bin/ upload-to-release: needs: @@ -45,35 +45,26 @@ jobs: contents: write runs-on: ubuntu-latest steps: - - name: Checkout code + - name: Checkout uses: actions/checkout@v4 - - name: Download Mod - uses: actions/download-artifact@v3 + - name: Download Artifact + uses: actions/download-artifact@v4 with: name: ${{ github.event.repository.name }}-windows-x64-${{ github.sha }} - path: release/Mod/ + path: artifact - - name: Download PDB - uses: actions/download-artifact@v3 - with: - name: PDB - path: release/PDB/ - - - name: Copy additional files + - name: Copy Files run: | - cp LICENSE README.md release/Mod/ + cp LICENSE README.md artifact/ - - name: Archive release + - name: Compress Artifact run: | - cd release/Mod zip -r ../${{ github.event.repository.name }}-windows-x64.zip * - cd .. + working-directory: artifact - - name: Create GitHub Release - id: create_release + - name: Create Release uses: softprops/action-gh-release@v1 with: files: | - release/${{ github.event.repository.name }}-windows-x64.zip - release/PDB/${{ github.event.repository.name }}.pdb + ${{ github.event.repository.name }}-windows-x64.zip