diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml new file mode 100644 index 000000000..8ff869829 --- /dev/null +++ b/.gitea/workflows/build.yaml @@ -0,0 +1,92 @@ +name: Build Wownero Core (Clean / Boost 1.90) +on: + push: + branches: [ master, main ] + tags: [ 'v*' ] + workflow_dispatch: + +env: + NODE_TLS_REJECT_UNAUTHORIZED: '0' + +jobs: + build-all: + runs-on: ubuntu-latest + container: + image: wownero-builder-base:latest + strategy: + fail-fast: false + matrix: + target: + - x86_64-linux-gnu # Linux x64 + - x86_64-w64-mingw32 # Windows x64 + - aarch64-linux-gnu # Linux ARM64 + - riscv64-linux-gnu # Linux RISC-V + - x86_64-apple-darwin11 # macOS Intel + - aarch64-apple-darwin11 # macOS ARM + + steps: + - name: Fix DNS + run: echo "192.168.88.230 git.such.software" >> /etc/hosts + + - name: Checkout + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + rm -rf * + git config --global --add safe.directory '*' + git clone http://oauth2:$GITHUB_TOKEN@git.such.software:3000/${{ github.repository }}.git . + git submodule update --init --recursive + + - name: Download macOS SDK + if: contains(matrix.target, 'apple') + run: | + mkdir -p contrib/depends/SDKs + curl -L -k -o contrib/depends/SDKs/MacOSX10.15.sdk.tar.gz \ + "https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/MacOSX10.15.sdk.tar.gz" + + - name: Build Dependencies + run: | + cd contrib/depends + # This builds Boost 1.90.0 using the file you just updated + make HOST=${{ matrix.target }} -j$(nproc) + + - name: Build Wownero Core + run: | + PREFIX=$(pwd)/contrib/depends/${{ matrix.target }} + mkdir build && cd build + cmake .. \ + -DCMAKE_TOOLCHAIN_FILE=../contrib/depends/${{ matrix.target }}/share/toolchain.cmake \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_STATIC=ON + make -j$(nproc) + + - name: Package Artifacts + run: | + LIB_DIR="contrib/depends/${{ matrix.target }}/lib" + INC_DIR="contrib/depends/${{ matrix.target }}/include" + mkdir -p output/lib output/include output/bin + find build/bin -type f -exec cp {} output/bin/ \; + cp $LIB_DIR/*.a output/lib/ + find build -name "*.a" -exec cp {} output/lib/ \; + cp -r src output/include/wownero-src + cp -r $INC_DIR/* output/include/ + tar -czf wownero-core-${{ matrix.target }}.tar.gz -C output . + + - name: Upload Artifact + uses: actions/upload-artifact@v3 + with: + name: wownero-core-${{ matrix.target }} + path: wownero-core-${{ matrix.target }}.tar.gz + + release: + needs: build-all + runs-on: ubuntu-latest + if: startsWith(github.ref, 'refs/tags/') + steps: + - name: Download Artifacts + uses: actions/download-artifact@v3 + - name: Publish Release + uses: softprops/action-gh-release@v1 + with: + files: | + wownero-core-*/wownero-core-*.tar.gz \ No newline at end of file