ci: transports go to GOPATH/bin/windows_amd64 when cross-compiling #10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Build Tor | |
| on: | |
| push: | |
| branches: [main, master] | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| jobs: | |
| tor-linux: | |
| name: tor (Linux x86_64) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Install dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y build-essential pkg-config \ | |
| autoconf automake libtool m4 perl \ | |
| libevent-dev libssl-dev zlib1g-dev liblzma-dev libzstd-dev | |
| - name: Configure | |
| run: | | |
| chmod +x configure | |
| chmod -R +x scripts | |
| ./configure --disable-asciidoc --disable-man --disable-html-docs | |
| - name: Build | |
| run: | | |
| make -j$(nproc) 2>&1 | tee build-linux.log | |
| exit ${PIPESTATUS[0]} | |
| - name: Smoke test | |
| run: ./src/app/tor --version | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: tor-linux-x86_64 | |
| path: src/app/tor | |
| - name: Upload build log | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-log-linux | |
| path: build-linux.log | |
| tor-win64: | |
| name: tor (Windows x86_64) | |
| runs-on: windows-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: msys2/setup-msys2@v2 | |
| with: | |
| msystem: MINGW64 | |
| update: false | |
| install: >- | |
| mingw-w64-x86_64-gcc | |
| mingw-w64-x86_64-binutils | |
| make | |
| mingw-w64-x86_64-pkgconf | |
| mingw-w64-x86_64-libevent | |
| mingw-w64-x86_64-openssl | |
| mingw-w64-x86_64-zlib | |
| mingw-w64-x86_64-gettext | |
| perl | |
| autoconf | |
| automake | |
| libtool | |
| m4 | |
| - name: Configure | |
| shell: msys2 {0} | |
| run: | | |
| cd "$GITHUB_WORKSPACE" | |
| chmod +x configure | |
| chmod -R +x scripts | |
| ./configure --host=x86_64-w64-mingw32 \ | |
| --disable-asciidoc --disable-man --disable-html-docs | |
| - name: Build | |
| shell: msys2 {0} | |
| run: | | |
| cd "$GITHUB_WORKSPACE" | |
| make -j$(nproc) 2>&1 | tee build-win.log | |
| exit ${PIPESTATUS[0]} | |
| - name: Smoke test | |
| shell: msys2 {0} | |
| run: | | |
| cd "$GITHUB_WORKSPACE" | |
| ./src/app/tor.exe --version | |
| - name: Stage binaries + runtime DLLs | |
| shell: msys2 {0} | |
| run: | | |
| cd "$GITHUB_WORKSPACE" | |
| mkdir -p dist | |
| cp src/app/tor.exe dist/ | |
| cp "$MINGW_PREFIX"/bin/libevent*.dll "$MINGW_PREFIX"/bin/libssl-3-x64.dll "$MINGW_PREFIX"/bin/libcrypto-3-x64.dll "$MINGW_PREFIX"/bin/zlib1.dll dist/ 2>/dev/null || true | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: tor-win64 | |
| path: dist/ | |
| - name: Upload build log | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: build-log-win | |
| path: build-win.log | |
| transports: | |
| name: pluggable-transports (Windows x86_64) | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/setup-go@v5 | |
| with: | |
| go-version: "1.24" | |
| - name: Build pluggable transports | |
| run: | | |
| set -e | |
| mkdir -p out | |
| GOPATH_BIN="$(go env GOPATH)/bin/windows_amd64" | |
| echo "=== obfs4 ===" | |
| GOOS=windows GOARCH=amd64 \ | |
| go install gitlab.com/yawning/obfs4.git/obfs4proxy@latest | |
| cp "$GOPATH_BIN/obfs4proxy.exe" out/obfs4proxy.exe | |
| echo "=== snowflake client ===" | |
| GOOS=windows GOARCH=amd64 \ | |
| go install gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake/v2/client@latest | |
| cp "$GOPATH_BIN/client.exe" out/snowflake-client.exe | |
| echo "=== webtunnel client ===" | |
| GOOS=windows GOARCH=amd64 \ | |
| go install gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/webtunnel/main/client@latest | |
| cp "$GOPATH_BIN/client.exe" out/webtunnel.exe | |
| ls -la out/ | |
| - name: Upload artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: transports-win64 | |
| path: out/ |