Skip to content

fix: build on nintendo switch #71

fix: build on nintendo switch

fix: build on nintendo switch #71

Workflow file for this run

name: Windows Build
on:
pull_request:
push:
jobs:
build:
strategy:
matrix:
os: [windows-latest]
arch: [x64]
mode: [debug, release]
runs-on: ${{ matrix.os }}
if: ${{ !contains(github.event.head_commit.message, 'ci skip') && !contains(github.event.head_commit.message, 'ci linux') && !contains(github.event.head_commit.message, 'ci switch') && !contains(github.event.head_commit.message, 'ci macos') }}
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Set xmake env
run: echo "XMAKE_GLOBALDIR=${{runner.workspace}}/xmake-global" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append
- name: Setup xmake
uses: xmake-io/github-action-setup-xmake@v1
with:
actions-cache-folder: .xmake-cache-W${{ steps.cache_key.outputs.key }}
# Update xmake repository (in order to have the file that will be cached)
- name: Update xmake repository
run: xmake repo --update
# Fetch xmake dephash
- name: Retrieve dependencies hash
id: dep_hash
run: echo "hash=$(xmake l utils.ci.packageskey)" | Out-File -FilePath $env:GITHUB_OUTPUT -Encoding utf8 -Append
# Cache xmake dependencies
- name: Restore cached xmake dependencies
id: restore-depcache
uses: actions/cache/restore@v4
with:
path: ${{ env.XMAKE_GLOBALDIR }}\.xmake\packages
key: MSVC-${{ matrix.arch }}-${{ matrix.mode }}-${{ steps.dep_hash.outputs.hash }}-W${{ steps.cache_key.outputs.key }}
- name: Configure xmake and install dependencies
run: xmake config --arch=${{ matrix.arch }} --mode=${{ matrix.mode }} --ccache=n --yes
# Save dependencies
- name: Save cached xmake dependencies
if: ${{ !steps.restore-depcache.outputs.cache-hit }}
uses: actions/cache/save@v4
with:
path: ${{ env.XMAKE_GLOBALDIR }}/.xmake/packages
key: ${{ steps.restore-depcache.outputs.cache-primary-key }}
- name: Build Switchseerr
run: xmake --yes
- name: Install Switchseerr
run: xmake install -o out
- name: "Set PACKAGE_NAME variable"
run: echo "PACKAGE_NAME=windows_${{ matrix.arch }}_${{ matrix.mode }}.zip" >> $GITHUB_ENV
shell: bash
- name: Archive result
uses: ihiroky/archive-action@v1
with:
root_dir: out
file_path: ${{ env.PACKAGE_NAME }}
verbose: true
- uses: actions/upload-artifact@v4
with:
name: Switchseerr-windows-${{ matrix.arch }}-${{ matrix.mode }}
path: ${{ env.PACKAGE_NAME }}