name: Release on: push: branches: ["master"] paths-ignore: - 'docker-compose/**' - 'docs/**' - 'README.md' pull_request: workflow_dispatch: inputs: create_release: description: 'Create GitHub release after successful builds (true/false)' required: true default: 'false' tag: description: 'Tag name for the release (e.g. v1.2.3)' required: false release_name: description: 'Release title' required: false release_body: description: 'Release notes / body' required: false draft: description: 'Create release as draft (true/false)' required: false default: 'false' prerelease: description: 'Create release as prerelease (true/false)' required: false default: 'false' permissions: contents: write packages: write jobs: build-linux-amd64: name: Build Linux x86_64 runs-on: ubuntu-22.04 timeout-minutes: 60 steps: - name: Install dependencies run: | sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test || true sudo apt update sudo apt install -y git build-essential cmake libuv1-dev libzmq3-dev libgss-dev libcurl4-openssl-dev libidn2-0-dev xz-utils - name: Checkout repository uses: actions/checkout@v4 with: submodules: recursive - name: Build p2pool (Linux) run: | mkdir -p build cd build cmake .. make -j$(nproc) - name: Archive binary uses: actions/upload-artifact@v4 with: name: p2pool-linux-amd64 path: build/p2pool build-windows: name: Build Windows (MSYS2 / mingw-w64) runs-on: windows-latest timeout-minutes: 60 defaults: run: shell: msys2 {0} strategy: matrix: config: - { c: "gcc", cxx: "g++" } steps: - name: Checkout repository uses: actions/checkout@v4 with: submodules: recursive - name: Setup MSYS2 and toolchain (install ZeroMQ and helpers) uses: eine/setup-msys2@v2 with: update: true install: > mingw-w64-x86_64-toolchain mingw-w64-x86_64-cmake mingw-w64-x86_64-nasm make git mingw-w64-x86_64-zeromq mingw-w64-x86_64-cppzmq mingw-w64-x86_64-curl - name: Build p2pool (Windows mingw) run: | set -e cd external/src/curl || true cmake . -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" \ -DCMAKE_C_COMPILER=${{ matrix.config.c }} \ -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \ -DBUILD_CURL_EXE=OFF -DBUILD_SHARED_LIBS=OFF -DCURL_DISABLE_INSTALL=ON make -j4 || true cd ../../.. if [ ! -f external/src/libzmq/build/lib/libzmq.a ]; then echo "Building libzmq from external/src/libzmq as fallback..." cd external/src/libzmq || true mkdir -p build cd build cmake .. -G "Unix Makefiles" \ -DCMAKE_C_COMPILER=${{ matrix.config.c }} \ -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \ -DBUILD_SHARED_LIBS=OFF \ -DWITH_LIBSODIUM=OFF || true make -j4 || true cd ../../.. else echo "Found external built libzmq" fi mkdir -p build cd build cmake .. -G "Unix Makefiles" \ -DCMAKE_C_COMPILER=${{ matrix.config.c }} \ -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} \ -DZMQ_INCLUDE_DIR=/mingw64/include \ -DZMQ_LIBRARY=/mingw64/lib/libzmq.a \ -DZMQ_LIBRARY_DEBUG=${GITHUB_WORKSPACE}/external/src/libzmq/build/lib/libzmq.a \ -DCURL_LIBRARY=${GITHUB_WORKSPACE}/external/src/curl/lib/libcurl.a \ -DCURL_LIBRARY_DEBUG=${GITHUB_WORKSPACE}/external/src/curl/lib/libcurl-d.a || true make -j4 - name: Archive binary uses: actions/upload-artifact@v4 with: name: p2pool-windows path: build/p2pool.exe build-macos-aarch64: name: Build macOS aarch64 runs-on: macos-latest timeout-minutes: 45 steps: - name: Checkout repository uses: actions/checkout@v4 with: submodules: recursive - name: Install dependencies (Homebrew) run: | brew update || true brew install cmake xz git libuv zmq zeromq libpgm curl || true - name: Build p2pool (macOS aarch64) run: | mkdir -p build cd build cmake .. make -j3 - name: Archive binary uses: actions/upload-artifact@v4 with: name: p2pool-macos-aarch64 path: build/p2pool publish-release: name: Publish release (manual) needs: - build-linux-amd64 - build-windows - build-macos-aarch64 if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.create_release == 'true' }} runs-on: ubuntu-latest timeout-minutes: 30 steps: - name: Download all build artifacts uses: actions/download-artifact@v4 with: path: artifacts - name: Create GitHub release and upload artifacts uses: ncipollo/release-action@v1 with: tag: ${{ github.event.inputs.tag }} name: ${{ github.event.inputs.release_name }} body: ${{ github.event.inputs.release_body }} draft: ${{ github.event.inputs.draft }} prerelease: ${{ github.event.inputs.prerelease }} files: artifacts/**