Add Gitea workflows for monero_c builds
This commit is contained in:
@@ -0,0 +1,100 @@
|
||||
name: build
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
flavor:
|
||||
description: monero_c flavor to build
|
||||
required: true
|
||||
default: peya
|
||||
type: choice
|
||||
options:
|
||||
- peya
|
||||
- salvium
|
||||
- monero
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
- main
|
||||
paths:
|
||||
- ".gitea/workflows/build.yml"
|
||||
- "build_single.sh"
|
||||
- "apply_patches.sh"
|
||||
- "contrib/depends/**"
|
||||
- "patches/**"
|
||||
- "monero_libwallet2_api_c/**"
|
||||
- "salvium_libwallet2_api_c/**"
|
||||
- "peya_libwallet2_api_c/**"
|
||||
- "impls/monero.dart/**"
|
||||
- "impls/monero.ts/**"
|
||||
- ".gitmodules"
|
||||
|
||||
jobs:
|
||||
build-libs:
|
||||
name: ${{ inputs.flavor || 'peya' }} ${{ matrix.target.name }}
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
target:
|
||||
- name: x86_64 Linux
|
||||
host: x86_64-linux-gnu
|
||||
packages: automake autotools-dev build-essential ca-certificates ccache clang cmake curl git libssl-dev libtool pkg-config python3
|
||||
- name: Win64
|
||||
host: x86_64-w64-mingw32
|
||||
packages: automake autotools-dev build-essential ca-certificates ccache clang cmake curl git libssl-dev libtool pkg-config python3 gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64
|
||||
env:
|
||||
FLAVOR: ${{ inputs.flavor || 'peya' }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: https://github.com/actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 1
|
||||
submodules: false
|
||||
|
||||
- name: Configure Gitea auth for private submodules
|
||||
env:
|
||||
MONERO_C_GITEA_PAT: ${{ secrets.MONERO_C_GITEA_PAT }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
|
||||
if [ "${FLAVOR}" != "monero" ] && [ -z "${MONERO_C_GITEA_PAT:-}" ]; then
|
||||
echo "Missing MONERO_C_GITEA_PAT secret for private ${FLAVOR} submodule"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -n "${MONERO_C_GITEA_PAT:-}" ]; then
|
||||
git config --global url."http://tiamak:${MONERO_C_GITEA_PAT}@54.38.205.168:3000/".insteadOf "http://54.38.205.168:3000/"
|
||||
fi
|
||||
|
||||
git submodule sync
|
||||
git -c protocol.version=2 submodule update --init --force "${FLAVOR}"
|
||||
git -C "${FLAVOR}" submodule sync --recursive
|
||||
git -C "${FLAVOR}" -c protocol.version=2 submodule update --init --force --recursive
|
||||
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ${{ matrix.target.packages }}
|
||||
|
||||
- name: Prepare MinGW alternatives
|
||||
if: ${{ matrix.target.host == 'x86_64-w64-mingw32' }}
|
||||
run: |
|
||||
sudo update-alternatives --set x86_64-w64-mingw32-g++ "$(which x86_64-w64-mingw32-g++-posix)"
|
||||
sudo update-alternatives --set x86_64-w64-mingw32-gcc "$(which x86_64-w64-mingw32-gcc-posix)"
|
||||
|
||||
- name: Apply patches
|
||||
run: |
|
||||
./apply_patches.sh "${FLAVOR}"
|
||||
|
||||
- name: Build libraries
|
||||
run: |
|
||||
./build_single.sh "${FLAVOR}" "${{ matrix.target.host }}" -j"$(nproc)"
|
||||
|
||||
- name: Upload build artifacts
|
||||
uses: https://github.com/actions/upload-artifact@v3
|
||||
with:
|
||||
name: monero-c-${{ env.FLAVOR }}-${{ matrix.target.host }}
|
||||
path: release/${{ env.FLAVOR }}/${{ matrix.target.host }}_*.xz
|
||||
if-no-files-found: error
|
||||
Reference in New Issue
Block a user