Repository navigation
60 lines (52 loc) · 1.55 KB
/
Copy pathhssh-test.yml
File metadata and controls
60 lines (52 loc) · 1.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
name: hssh-test
on:
workflow_dispatch:
jobs:
server:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
cache: true
- name: Build hssh from source (with cloudflare URL fix)
run: |
go build -o hssh ./cmd/hssh
./hssh version
node --version
npx --version
- name: Node check (for localtunnel via npx)
run: |
node --version
npx --version
- name: Start hssh and capture URL
run: |
./hssh host --port 8080 --public localtunnel --allow-unauthenticated > server.log 2>&1 &
echo $! > server.pid
for i in $(seq 1 90); do
sleep 2
URL=$(grep -Eo 'https://[a-zA-Z0-9-]+\.loca\.lt' server.log | head -n 1)
if [ -n "$URL" ]; then
echo "$URL" | tee url.txt
echo "### Public URL $URL" >> "$GITHUB_STEP_SUMMARY"
echo "FOUND_URL=$URL"
break
fi
done
cat server.log
test -f url.txt
- name: Upload URL artifact
uses: actions/upload-artifact@v4
with:
name: hssh-url
path: url.txt
- name: Keep alive (tail logs until timeout)
run: |
tail -F server.log &
TAILPID=$!
while kill -0 "$(cat server.pid)" 2>/dev/null; do sleep 10; done
kill $TAILPID || true
tail server.log || true
exit 1