79 lines
2.7 KiB
YAML
79 lines
2.7 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches: [ "main", "master" ]
|
|
pull_request:
|
|
branches: [ "main", "master" ]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
submodules: false
|
|
|
|
- name: Configure Git Auth
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
run: |
|
|
# Debug: Show current config before changes
|
|
echo "Current git config:"
|
|
git config --global --list || true
|
|
|
|
# Set up credential helper
|
|
git config --global credential.helper "store --file=$HOME/.git-credentials"
|
|
echo "https://${{ secrets.GITEA_TOKEN }}@git.neru.rip" > $HOME/.git-credentials
|
|
|
|
# Alternative: use URL rewrite with more precise matching
|
|
git config --global url."https://${{ secrets.GITEA_TOKEN }}@git.neru.rip/".insteadOf "https://git.neru.rip/"
|
|
|
|
# Also try with http variant
|
|
git config --global url."https://${{ secrets.GITEA_TOKEN }}@git.neru.rip/".insteadOf "http://git.neru.rip/"
|
|
|
|
# Force git to use the credential store
|
|
git config --global credential.useHttpPath true
|
|
|
|
# Debug: Show config after changes
|
|
echo "Updated git config:"
|
|
git config --global --list | grep -i url || true
|
|
echo "Credential file:"
|
|
cat $HOME/.git-credentials || true
|
|
|
|
- name: Test Authentication
|
|
env:
|
|
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
|
run: |
|
|
# Test if authentication works
|
|
echo "Testing authentication to git.neru.rip..."
|
|
git ls-remote https://git.neru.rip/neru/nerutils.git HEAD || true
|
|
|
|
|
|
- name: Fetch Submodules
|
|
run: |
|
|
git submodule sync --recursive
|
|
git submodule update --init --recursive --force
|
|
|
|
- name: Install cross-compilation tools
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y cmake gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 dotnet-sdk-8.0
|
|
|
|
- name: Configure CMake for Windows
|
|
run: |
|
|
cmake -B build -S . \
|
|
-DCMAKE_TOOLCHAIN_FILE=/usr/share/mingw-w64/toolchain-x86_64.cmake \
|
|
-DCMAKE_SYSTEM_NAME=Windows \
|
|
-DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc \
|
|
-DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++ \
|
|
-DCMAKE_RC_COMPILER=x86_64-w64-mingw32-windres
|
|
|
|
- name: Build Unlocker
|
|
run: cmake --build build --config Release --target dbd-unlocker
|
|
|
|
- name: Build Dumper (Windows)
|
|
run: dotnet build src/dumper/dbd-dumper.csproj -c Release --runtime win-x64
|