|
29 | 29 | - uses: git-for-windows/setup-git-for-windows-sdk@v1
|
30 | 30 | with:
|
31 | 31 | architecture: aarch64
|
| 32 | + - name: debug using tmate (detached) |
| 33 | + shell: bash |
| 34 | + run: | |
| 35 | + set -x && |
| 36 | + cat /etc/profile && |
| 37 | + . /etc/profile && |
| 38 | + ( |
| 39 | + cd / && |
| 40 | + G4W=/c/Program\ Files/Git && |
| 41 | + cp -n "$G4W"/usr/bin/{ssh-keygen.exe,msys-crypto-3.dll,msys-z.dll} usr/bin/ && |
| 42 | +
|
| 43 | + CURL="$WINDIR"/system32/curl.exe && |
| 44 | + TAR="$WINDIR"/system32/tar.exe && |
| 45 | + "$CURL" -Lo /tmp/tmate.tar.zst https://repo.msys2.org/msys/x86_64/tmate-2.4.0-5-x86_64.pkg.tar.zst && |
| 46 | + "$TAR" xvf /tmp/tmate.tar.zst usr/bin/tmate.exe && |
| 47 | + "$CURL" -Lo /tmp/libevent.tar.zst https://repo.msys2.org/msys/x86_64/libevent-2.1.12-4-x86_64.pkg.tar.zst && |
| 48 | + "$TAR" xvf /tmp/libevent.tar.zst usr/bin/msys-event-2-1-7.dll && |
| 49 | + "$CURL" -Lo /tmp/msgpack-c.tar.zst https://repo.msys2.org/msys/x86_64/msgpack-c-6.1.0-2-x86_64.pkg.tar.zst && |
| 50 | + "$TAR" xvf /tmp/msgpack-c.tar.zst usr/bin/msys-msgpack-c-2.dll && |
| 51 | + "$CURL" -Lo /tmp/libssh.tar.zst https://repo.msys2.org/msys/x86_64/libssh-0.11.1-2-x86_64.pkg.tar.zst && |
| 52 | + "$TAR" xvf /tmp/libssh.tar.zst usr/bin/msys-ssh-4.dll |
| 53 | + ) && |
| 54 | +
|
| 55 | + # restrict SSH access to the "actor", i.e. the GitHub user who triggered this workflow |
| 56 | + # this requires calling `ssh -i <private-key> [...]` later on |
| 57 | + mkdir -p ~/.ssh && |
| 58 | + curl -H 'Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \ |
| 59 | + https://api.github.com/users/${{github.actor}}/keys | |
| 60 | + sed -n 's/.*"key": "\(.*\)".*/\1/p' >~/.ssh/authorized_keys && |
| 61 | +
|
| 62 | + # Generate an SSH key (needed for tmate) |
| 63 | + echo -e 'y\n' | ssh-keygen -q -t rsa -N '' -f ~/.ssh/id_rsa && |
| 64 | +
|
| 65 | + # Start tmate session |
| 66 | + export CHERE_INVOKING=1 && |
| 67 | + tmate -S /tmp/tmate.sock -a ~/.ssh/authorized_keys new-session -d && |
| 68 | + tmate -S /tmp/tmate.sock wait tmate-ready && |
| 69 | +
|
| 70 | + # Print SSH invocation |
| 71 | + tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}' |
| 72 | + env: |
| 73 | + HOME: ${{runner.workspace}} |
| 74 | + NO_PERL: 1 |
32 | 75 | - name: build
|
33 | 76 | shell: bash
|
34 | 77 | env:
|
|
42 | 85 | with:
|
43 | 86 | name: windows-artifacts
|
44 | 87 | path: artifacts
|
| 88 | + - name: wait for tmate to be done |
| 89 | + if: always() |
| 90 | + shell: bash |
| 91 | + run: | |
| 92 | + PATH=$HOME/bin:$PATH |
| 93 | + while test -e /tmp/tmate.sock |
| 94 | + do |
| 95 | + tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}' |
| 96 | + sleep 5 |
| 97 | + done |
45 | 98 | windows-test:
|
46 | 99 | name: win test
|
47 | 100 | runs-on: windows-11-arm
|
|
0 commit comments