From ed438d082c72e1574a8dcc80a56b8ea9f322a7fa Mon Sep 17 00:00:00 2001 From: wumo Date: Fri, 13 Mar 2026 12:01:41 +0800 Subject: [PATCH 1/3] test --- .github/workflows/package.yml | 104 ++++++++++++++++++++++++++++------ xmake.lua | 6 +- 2 files changed, 92 insertions(+), 18 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 7578bded..9506bba3 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -4,12 +4,27 @@ on: push: branches: - main + paths: + - '3rdparty/**' + - 'goldfish/**' + - 'src/**' + - 'xmake/**' + - 'xmake.lua' + - '.github/workflows/package.yml' + pull_request: + branches: + - main + paths: + - '3rdparty/**' + - 'goldfish/**' + - 'src/**' + - 'xmake/**' + - 'xmake.lua' + - '.github/workflows/package.yml' jobs: - build: + package-deb: runs-on: ubuntu-latest - strategy: - fail-fast: true steps: - name: Checkout @@ -22,38 +37,34 @@ jobs: sudo add-apt-repository ppa:xmake-io/xmake sudo apt update sudo apt install -y git \ - curl 7zip unzip curl \ + curl 7zip unzip \ gcc g++ \ devscripts debhelper build-essential \ xmake # xmake must be installed by apt (dpkg) - name: git add safe directory - run: git config --global --add safe.directory '*' + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" - name: set XMAKE_GLOBALDIR run: echo "XMAKE_GLOBALDIR=${{ runner.workspace }}/xmake-global" >> $GITHUB_ENV - - name: xmake repo --update - run: xmake repo --update - - name: cache packages from xrepo - uses: actions/cache@v3 + uses: actions/cache@v4 with: - path: | - ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages + path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages key: ${{ runner.os }}-xrepo-${{ hashFiles('**/xmake.lua') }} + - name: xmake repo --update + run: xmake repo --update + - name: Config and Build run: | - sed -i 's|"deb", "rpm", "srpm"|"deb"|g' xmake.lua - sed -i 's|set_default(false) -- repl-anchor|set_default(true)|g' xmake.lua - - xmake config -vyD --policies=build.ccache -o tmp/build -m releasedbg --repl=true + xmake config -vyD --policies=build.ccache -o tmp/build -m releasedbg --repl=true --yes xmake build goldfish - name: Package - run: xmake pack -vyD goldfish + run: xmake pack -vyD -f deb goldfish - name: Create summary table run: | @@ -83,7 +94,66 @@ jobs: - name: Upload all package artifacts uses: actions/upload-artifact@v4 with: - name: goldfish-packages + name: goldfish-deb-packages path: tmp/build/xpack/goldfish/*.deb retention-days: 30 if-no-files-found: error + + package-windows-zip: + runs-on: windows-2025 + env: + XMAKE_GLOBALDIR: ${{ github.workspace }}/.xmake-global + + steps: + - name: Setup xmake + uses: xmake-io/github-action-setup-xmake@v1 + with: + xmake-version: v2.9.9 + + - name: git crlf + run: git config --global core.autocrlf false + + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 1 + + - name: cache packages from xrepo + uses: actions/cache@v4 + with: + path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages + key: ${{ runner.os }}-xrepo-${{ hashFiles('**/xmake.lua') }} + + - name: xmake repo --update + run: xmake repo --update + + - name: Config and Build + run: | + xmake config -vyD -o tmp/build -m releasedbg --repl=true --yes + xmake build goldfish + + - name: Package + run: xmake pack -vyD -f zip goldfish + + - name: Create summary table + shell: pwsh + run: | + $dir = "tmp/build/xpack/goldfish" + Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value "## Generated package files" + Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value "" + Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value "| Type | File | Size |" + Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value "|------|------|------|" + Get-ChildItem -Path $dir -Filter *.zip | ForEach-Object { + $size = "{0:N2} MiB" -f ($_.Length / 1MB) + Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value "| Windows ZIP | ``$($_.Name)`` | $size |" + } + Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value "" + Add-Content -Path $env:GITHUB_STEP_SUMMARY -Value "*目录: ``$dir``*" + + - name: Upload Windows zip artifacts + uses: actions/upload-artifact@v4 + with: + name: goldfish-windows-zip-packages + path: tmp/build/xpack/goldfish/*.zip + retention-days: 30 + if-no-files-found: error diff --git a/xmake.lua b/xmake.lua index e3a261a5..81da34d8 100644 --- a/xmake.lua +++ b/xmake.lua @@ -194,7 +194,11 @@ end includes("@builtin/xpack") xpack ("goldfish") - set_formats("deb", "rpm", "srpm") + if is_plat("windows") then + set_formats("zip") + else + set_formats("deb", "rpm", "srpm") + end set_author("Da Shen ") set_license("Apache-2.0") set_title("Goldfish Scheme") From 1893e288e41069b0ed588e55b3de72dfabb691a7 Mon Sep 17 00:00:00 2001 From: wumo Date: Fri, 13 Mar 2026 13:10:12 +0800 Subject: [PATCH 2/3] wip --- .github/workflows/package.yml | 42 ++++++++++++++--------------------- 1 file changed, 17 insertions(+), 25 deletions(-) diff --git a/.github/workflows/package.yml b/.github/workflows/package.yml index 9506bba3..04411be9 100644 --- a/.github/workflows/package.yml +++ b/.github/workflows/package.yml @@ -4,27 +4,15 @@ on: push: branches: - main - paths: - - '3rdparty/**' - - 'goldfish/**' - - 'src/**' - - 'xmake/**' - - 'xmake.lua' - - '.github/workflows/package.yml' pull_request: branches: - main - paths: - - '3rdparty/**' - - 'goldfish/**' - - 'src/**' - - 'xmake/**' - - 'xmake.lua' - - '.github/workflows/package.yml' jobs: - package-deb: + build: runs-on: ubuntu-latest + strategy: + fail-fast: true steps: - name: Checkout @@ -37,34 +25,38 @@ jobs: sudo add-apt-repository ppa:xmake-io/xmake sudo apt update sudo apt install -y git \ - curl 7zip unzip \ + curl 7zip unzip curl \ gcc g++ \ devscripts debhelper build-essential \ xmake # xmake must be installed by apt (dpkg) - name: git add safe directory - run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + run: git config --global --add safe.directory '*' - name: set XMAKE_GLOBALDIR run: echo "XMAKE_GLOBALDIR=${{ runner.workspace }}/xmake-global" >> $GITHUB_ENV + - name: xmake repo --update + run: xmake repo --update + - name: cache packages from xrepo - uses: actions/cache@v4 + uses: actions/cache@v3 with: - path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages + path: | + ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages key: ${{ runner.os }}-xrepo-${{ hashFiles('**/xmake.lua') }} - - name: xmake repo --update - run: xmake repo --update - - name: Config and Build run: | - xmake config -vyD --policies=build.ccache -o tmp/build -m releasedbg --repl=true --yes + sed -i 's|"deb", "rpm", "srpm"|"deb"|g' xmake.lua + sed -i 's|set_default(false) -- repl-anchor|set_default(true)|g' xmake.lua + + xmake config -vyD --policies=build.ccache -o tmp/build -m releasedbg --repl=true xmake build goldfish - name: Package - run: xmake pack -vyD -f deb goldfish + run: xmake pack -vyD goldfish - name: Create summary table run: | @@ -94,7 +86,7 @@ jobs: - name: Upload all package artifacts uses: actions/upload-artifact@v4 with: - name: goldfish-deb-packages + name: goldfish-packages path: tmp/build/xpack/goldfish/*.deb retention-days: 30 if-no-files-found: error From 70b7560da61a55a92cf09e7acd8a9b02a308f2e6 Mon Sep 17 00:00:00 2001 From: wumo Date: Fri, 13 Mar 2026 13:34:40 +0800 Subject: [PATCH 3/3] wip --- devel/200_31.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 devel/200_31.md diff --git a/devel/200_31.md b/devel/200_31.md new file mode 100644 index 00000000..a474c057 --- /dev/null +++ b/devel/200_31.md @@ -0,0 +1,3 @@ +# [200_31] + +## 2026/03/13 支持Goldfish Scheme Windows 安装包