From 3964c4652a759c6a6ec4038b47a9bb1354f4d38a Mon Sep 17 00:00:00 2001 From: Utkarsh Dalal Date: Tue, 6 Oct 2026 17:25:55 +0530 Subject: [PATCH 1/2] CI: Build GameNative FEXCore .wcp package --- .github/workflows/gamenative_package.yml | 187 +++++++++++++++++++++++ 1 file changed, 187 insertions(+) create mode 100644 .github/workflows/gamenative_package.yml diff --git a/.github/workflows/gamenative_package.yml b/.github/workflows/gamenative_package.yml new file mode 100644 index 0000000000..4435815ce4 --- /dev/null +++ b/.github/workflows/gamenative_package.yml @@ -0,0 +1,187 @@ +name: GameNative FEXCore package + +on: + workflow_dispatch: + inputs: + ref: + description: 'Branch, tag or SHA to build' + required: false + default: '' + variant_name: + description: 'Optional label added to versionName (--)' + required: false + default: '' + pull_request: + push: + branches: + - gamenative-ci + tags: + - 'v*' + +env: + BUILD_TYPE: Release + LLVM_MINGW_VERSION: '20260922' + CCACHE_DIR: ${{ github.workspace }}/.ccache + CCACHE_MAXSIZE: 500M + CMAKE_C_COMPILER_LAUNCHER: ccache + CMAKE_CXX_COMPILER_LAUNCHER: ccache + +jobs: + build: + runs-on: ubuntu-24.04-arm + strategy: + matrix: + target: [wow64, arm64ec] + fail-fast: false + + steps: + - uses: actions/checkout@v6 + with: + ref: ${{ inputs.ref || github.ref }} + fetch-depth: '0' + fetch-tags: 'true' + + - name: Checkout Submodules + run: | + git submodule sync --recursive + for m in External/fex-posixtest-bins External/fex-gvisor-tests-bins External/fex-gcc-target-tests-bins; do + git config submodule.$m.update none + done + git submodule update --init --depth 1 + + - name: Install packages + run: | + sudo apt-get update + sudo apt-get install -y ninja-build ccache cmake python3 + + - name: Cache llvm-mingw + id: llvm-mingw-cache + uses: actions/cache@v4 + with: + path: ${{ runner.temp }}/llvm-mingw + key: llvm-mingw-${{ env.LLVM_MINGW_VERSION }}-ubuntu-22.04-aarch64 + + - name: Download llvm-mingw + if: steps.llvm-mingw-cache.outputs.cache-hit != 'true' + run: | + mkdir -p "$RUNNER_TEMP/llvm-mingw" + curl -fsSL "https://github.com/mstorsjo/llvm-mingw/releases/download/${LLVM_MINGW_VERSION}/llvm-mingw-${LLVM_MINGW_VERSION}-ucrt-ubuntu-22.04-aarch64.tar.xz" \ + | tar -xJ --strip-components=1 -C "$RUNNER_TEMP/llvm-mingw" + + - name: Add llvm-mingw to PATH + run: echo "$RUNNER_TEMP/llvm-mingw/bin" >> $GITHUB_PATH + + - name: Cache ccache + uses: actions/cache@v4 + with: + path: ${{ env.CCACHE_DIR }} + key: ccache-fex-${{ matrix.target }}-${{ github.sha }} + restore-keys: ccache-fex-${{ matrix.target }}- + + - name: Configure CMake + run: | + case "${{ matrix.target }}" in + wow64) _cc=aarch64 ;; + arm64ec) _cc=arm64ec ;; + esac + cmake -S . -B build -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DCMAKE_TOOLCHAIN_FILE=Data/CMake/toolchain_mingw.cmake \ + -DMINGW_TRIPLE=${_cc}-w64-mingw32 -DCMAKE_INSTALL_LIBDIR=/usr/lib/wine/aarch64-windows -G Ninja \ + -DENABLE_LTO=False -DENABLE_ASSERTIONS=False -DENABLE_JEMALLOC_GLIBC_ALLOC=False \ + -DBUILD_TESTING=False -DCMAKE_INSTALL_PREFIX=/usr -DTUNE_ARCH=generic -DTUNE_CPU=none -DRANGES_NATIVE=OFF + + - name: Build + run: cmake --build build + + - name: Install + run: DESTDIR="$PWD"/install cmake --build build -t install + + - name: ccache stats + run: ccache -s + + - uses: actions/upload-artifact@v6 + with: + name: dll-${{ matrix.target }} + path: install/usr/lib/wine/aarch64-windows/lib*.dll + if-no-files-found: error + retention-days: 7 + + package: + needs: build + runs-on: ubuntu-24.04-arm + permissions: + contents: write + steps: + - uses: actions/checkout@v6 + with: + ref: ${{ inputs.ref || github.ref }} + fetch-depth: '0' + fetch-tags: 'true' + + - name: Compute version + id: version + env: + VARIANT: ${{ inputs.variant_name }} + run: | + git fetch --quiet --tags --force https://github.com/FEX-Emu/FEX.git || true + base=$(git describe --tags --match 'FEX-*' --abbrev=0 2>/dev/null | sed 's/^FEX-//') + base=${base:-0000} + sha=$(git rev-parse --short=7 HEAD) + variant=$(echo "$VARIANT" | tr -c 'A-Za-z0-9._\n' '-') + name="$base${variant:+-$variant}-$sha" + echo "version_name=$name" >> $GITHUB_OUTPUT + echo "sha=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT + echo "describe=$(git describe --tags --match 'FEX-*' 2>/dev/null || echo unknown)" >> $GITHUB_OUTPUT + + - uses: actions/download-artifact@v7 + with: + pattern: dll-* + merge-multiple: true + path: dlls + + - name: Assemble package + env: + VERSION_NAME: ${{ steps.version.outputs.version_name }} + DESCRIBE: ${{ steps.version.outputs.describe }} + REPO: ${{ github.repository }} + run: | + mkdir -p pkg/system32 + cp dlls/libarm64ecfex.dll dlls/libwow64fex.dll pkg/system32/ + cat > pkg/profile.json < Date: Tue, 6 Oct 2026 17:30:09 +0530 Subject: [PATCH 2/2] CI: Add daily upstream sync workflow --- .github/workflows/upstream-sync.yml | 49 +++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) create mode 100644 .github/workflows/upstream-sync.yml diff --git a/.github/workflows/upstream-sync.yml b/.github/workflows/upstream-sync.yml new file mode 100644 index 0000000000..faa83358f4 --- /dev/null +++ b/.github/workflows/upstream-sync.yml @@ -0,0 +1,49 @@ +name: Upstream sync + +on: + schedule: + - cron: "17 4 * * *" + workflow_dispatch: + +permissions: + contents: write + pull-requests: write + +concurrency: + group: upstream-sync + cancel-in-progress: false + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: main + fetch-depth: 0 + token: ${{ secrets.SYNC_TOKEN || github.token }} + + - name: Mirror upstream FEX main to upstream-main + run: | + git fetch --no-tags https://github.com/FEX-Emu/FEX.git main + git push --force origin FETCH_HEAD:refs/heads/upstream-main + git fetch --no-tags origin +upstream-main:refs/remotes/origin/upstream-main + + - name: Open or update the sync PR + env: + GH_TOKEN: ${{ secrets.SYNC_TOKEN || github.token }} + run: | + count=$(git rev-list --count origin/main..origin/upstream-main) + if [ "$count" -eq 0 ]; then + echo "main already contains upstream-main" + exit 0 + fi + head=$(git rev-parse --short origin/upstream-main) + subject=$(git log -1 --format=%s origin/upstream-main) + body=$(printf 'upstream-main has %s commits that are not in main.\n\nNewest upstream commit: %s %s\n\nMerge this PR with a merge commit (not squash or rebase) so that main keeps the upstream history.' "$count" "$head" "$subject") + pr=$(gh pr list --head upstream-main --base main --state open --json number --jq '.[0].number') + if [ -n "$pr" ]; then + gh pr edit "$pr" --body "$body" + else + gh pr create --head upstream-main --base main --title "Sync with upstream FEX" --body "$body" + fi