+19
-62
@@ -12,70 +12,27 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: false
|
submodules: recursive
|
||||||
token: ${{ secrets.GITEA_TOKEN }}
|
|
||||||
|
|
||||||
- name: Setup Git Authentication
|
- name: Install cross-compilation tools
|
||||||
env:
|
run: |
|
||||||
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
|
sudo apt-get update
|
||||||
run: |
|
sudo apt-get install -y cmake gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 dotnet-sdk-8.0
|
||||||
# Create .netrc file (curl/wget style)
|
|
||||||
echo "machine git.neru.rip" > ~/.netrc
|
|
||||||
echo "login oauth2" >> ~/.netrc
|
|
||||||
echo "password $GITEA_TOKEN" >> ~/.netrc
|
|
||||||
chmod 600 ~/.netrc
|
|
||||||
|
|
||||||
# Also create git credential file
|
- name: Configure CMake for Windows
|
||||||
echo "https://oauth2:$GITEA_TOKEN@git.neru.rip" > ~/.git-credentials
|
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
|
||||||
|
|
||||||
# Configure git to use the credential file
|
- name: Build Unlocker
|
||||||
git config --global credential.helper "store --file=$HOME/.git-credentials"
|
run: cmake --build build --config Release --target dbd-unlocker
|
||||||
|
|
||||||
# Set user info to avoid interactive prompts
|
- name: Build Dumper (Windows)
|
||||||
git config --global user.email "ci@example.com"
|
run: dotnet build src/dumper/dbd-dumper.csproj -c Release --runtime win-x64
|
||||||
git config --global user.name "CI Runner"
|
|
||||||
|
|
||||||
echo "Authentication configured"
|
|
||||||
cat ~/.netrc
|
|
||||||
|
|
||||||
- name: Test Authentication
|
|
||||||
run: |
|
|
||||||
# Test with curl first
|
|
||||||
echo "Testing with curl:"
|
|
||||||
curl -s -o /dev/null -w "HTTP Status: %{http_code}\n" https://git.neru.rip/neru/nerutils.git/info/refs?service=git-upload-pack || true
|
|
||||||
|
|
||||||
echo -e "\nTesting with git:"
|
|
||||||
# Use GIT_ASKPASS to provide empty password (since we're using .netrc)
|
|
||||||
GIT_ASKPASS=/bin/true git ls-remote https://git.neru.rip/neru/nerutils.git HEAD 2>&1 || true
|
|
||||||
|
|
||||||
- name: Fetch Submodules
|
|
||||||
run: |
|
|
||||||
# Set environment variables to force authentication
|
|
||||||
export GIT_ASKPASS=/bin/true
|
|
||||||
export GIT_TERMINAL_PROMPT=0
|
|
||||||
|
|
||||||
# Initialize submodules
|
|
||||||
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
|
|
||||||
|
|||||||
Reference in New Issue
Block a user