From b506d2a8eef25b3d4dc6dda4c52d4f1ce569447d Mon Sep 17 00:00:00 2001 From: Codex Date: Wed, 8 Apr 2026 21:52:09 +0200 Subject: [PATCH] Add Gitea workflows for monero_c builds --- .gitea/workflows/build.yml | 100 +++++ .gitea/workflows/consistency.yml | 86 ++++ .gitea/workflows/release.yml | 213 ++++++++++ .github/workflows/checksum.yaml | 56 --- .github/workflows/dart_bindings.yaml | 57 --- .github/workflows/docs.yaml | 48 --- .github/workflows/full_check.yaml | 598 --------------------------- 7 files changed, 399 insertions(+), 759 deletions(-) create mode 100644 .gitea/workflows/build.yml create mode 100644 .gitea/workflows/consistency.yml create mode 100644 .gitea/workflows/release.yml delete mode 100644 .github/workflows/checksum.yaml delete mode 100644 .github/workflows/dart_bindings.yaml delete mode 100644 .github/workflows/docs.yaml delete mode 100644 .github/workflows/full_check.yaml diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml new file mode 100644 index 0000000..872bb5a --- /dev/null +++ b/.gitea/workflows/build.yml @@ -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 diff --git a/.gitea/workflows/consistency.yml b/.gitea/workflows/consistency.yml new file mode 100644 index 0000000..589b7f6 --- /dev/null +++ b/.gitea/workflows/consistency.yml @@ -0,0 +1,86 @@ +name: consistency + +on: + workflow_dispatch: + push: + branches: + - develop + - main + paths: + - ".gitea/workflows/consistency.yml" + - "generate_checksum.sh" + - "impls/monero.dart/**" + - "impls/monero.ts/**" + - "monero_libwallet2_api_c/**" + - "salvium_libwallet2_api_c/**" + - "peya_libwallet2_api_c/**" + - ".gitmodules" + +jobs: + checksums: + name: checksum sync + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: https://github.com/actions/checkout@v4 + with: + fetch-depth: 1 + submodules: false + + - name: Generate checksums + run: | + ./generate_checksum.sh + + - name: Check for dirty tree + run: | + git diff --exit-code + + dart-bindings: + name: Dart bindings sync + runs-on: ubuntu-latest + 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 [ -z "${MONERO_C_GITEA_PAT:-}" ]; then + echo "Missing MONERO_C_GITEA_PAT secret for private submodules" + exit 1 + fi + + git config --global url."http://tiamak:${MONERO_C_GITEA_PAT}@54.38.205.168:3000/".insteadOf "http://54.38.205.168:3000/" + git submodule sync + git -c protocol.version=2 submodule update --init --force monero salvium peya + git -C monero submodule sync --recursive + git -C salvium submodule sync --recursive + git -C peya submodule sync --recursive + git -C monero -c protocol.version=2 submodule update --init --force --recursive + git -C salvium -c protocol.version=2 submodule update --init --force --recursive + git -C peya -c protocol.version=2 submodule update --init --force --recursive + + - name: Setup Flutter + uses: https://github.com/subosito/flutter-action@v2 + with: + channel: stable + + - name: Fetch Dart dependencies + run: | + cd impls/monero.dart + dart pub get + + - name: Regenerate Dart bindings + run: | + cd impls/monero.dart + ./update_bindings.sh + + - name: Check for dirty tree + run: | + git diff --exit-code diff --git a/.gitea/workflows/release.yml b/.gitea/workflows/release.yml new file mode 100644 index 0000000..647638f --- /dev/null +++ b/.gitea/workflows/release.yml @@ -0,0 +1,213 @@ +name: release + +on: + workflow_dispatch: + inputs: + tag_name: + description: Release tag (for example v0.1.0) + required: true + flavor: + description: monero_c flavor to build + required: true + default: peya + type: choice + options: + - peya + - salvium + - monero + release_name: + description: Optional release title + required: false + release_notes: + description: Release notes / body + required: false + +jobs: + create-release: + name: Create release + runs-on: ubuntu-latest + outputs: + release_id: ${{ steps.release.outputs.release_id }} + flavor: ${{ inputs.flavor }} + steps: + - name: Install release tooling + run: | + sudo apt-get update + sudo apt-get install -y curl jq + + - name: Create or reuse Gitea release + id: release + env: + GITEA_TOKEN: ${{ github.token }} + GITEA_API: ${{ github.server_url }}/api/v1 + REPO: ${{ github.repository }} + TAG_NAME: ${{ inputs.tag_name }} + INPUT_RELEASE_NAME: ${{ inputs.release_name }} + RELEASE_NOTES: ${{ inputs.release_notes }} + TARGET_COMMITISH: ${{ github.sha }} + run: | + set -euo pipefail + + if [ -n "${INPUT_RELEASE_NAME}" ]; then + RELEASE_NAME="${INPUT_RELEASE_NAME}" + else + RELEASE_NAME="Release ${TAG_NAME}" + fi + + get_release_url="${GITEA_API}/repos/${REPO}/releases/tags/${TAG_NAME}" + create_release_url="${GITEA_API}/repos/${REPO}/releases" + + status="$(curl -sS -o /tmp/release.json -w '%{http_code}' \ + -H "Authorization: token ${GITEA_TOKEN}" \ + "${get_release_url}")" + + if [ "${status}" = "200" ]; then + echo "release_id=$(jq -r '.id' /tmp/release.json)" >> "$GITHUB_OUTPUT" + exit 0 + fi + + if [ "${status}" != "404" ]; then + echo "Unexpected response while checking release: HTTP ${status}" + cat /tmp/release.json + exit 1 + fi + + jq -n \ + --arg tag_name "${TAG_NAME}" \ + --arg target_commitish "${TARGET_COMMITISH}" \ + --arg name "${RELEASE_NAME}" \ + --arg body "${RELEASE_NOTES}" \ + '{tag_name:$tag_name,target_commitish:$target_commitish,name:$name,body:$body,draft:false,prerelease:false}' \ + > /tmp/release-payload.json + + curl -sS \ + -H "Authorization: token ${GITEA_TOKEN}" \ + -H "Content-Type: application/json" \ + -X POST \ + --data @/tmp/release-payload.json \ + "${create_release_url}" \ + -o /tmp/release.json + + if ! jq -e '.id' /tmp/release.json >/dev/null; then + cat /tmp/release.json + exit 1 + fi + + echo "release_id=$(jq -r '.id' /tmp/release.json)" >> "$GITHUB_OUTPUT" + + build-release: + name: ${{ matrix.target.name }} + needs: create-release + 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 + + 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 }} + FLAVOR: ${{ needs.create-release.outputs.flavor }} + 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 "${{ needs.create-release.outputs.flavor }}" + + - name: Build release libraries + run: | + ./build_single.sh "${{ needs.create-release.outputs.flavor }}" "${{ matrix.target.host }}" -j"$(nproc)" + + - name: Upload release assets + env: + GITEA_TOKEN: ${{ github.token }} + GITEA_API: ${{ github.server_url }}/api/v1 + REPO: ${{ github.repository }} + RELEASE_ID: ${{ needs.create-release.outputs.release_id }} + FLAVOR: ${{ needs.create-release.outputs.flavor }} + HOST: ${{ matrix.target.host }} + run: | + set -euo pipefail + + assets_url="${GITEA_API}/repos/${REPO}/releases/${RELEASE_ID}/assets" + shopt -s nullglob + files=(release/${FLAVOR}/${HOST}_*.xz) + + if [ "${#files[@]}" -eq 0 ]; then + echo "No release assets found in release/${FLAVOR} for ${HOST}" + exit 1 + fi + + curl -sS \ + -H "Authorization: token ${GITEA_TOKEN}" \ + "${assets_url}" \ + -o /tmp/release-assets.json + + for asset in "${files[@]}"; do + asset_name="$(basename "${asset}")" + existing_id="$(ASSET_NAME="${asset_name}" python3 - <<'PY' +import json, os +name = os.environ["ASSET_NAME"] +with open("/tmp/release-assets.json", "r", encoding="utf-8") as f: + assets = json.load(f) +for item in assets: + if item.get("name") == name: + print(item["id"]) + break +PY +)" + + if [ -n "${existing_id}" ]; then + curl -sS \ + -H "Authorization: token ${GITEA_TOKEN}" \ + -X DELETE \ + "${assets_url}/${existing_id}" \ + >/dev/null + fi + + curl -sS \ + -H "Authorization: token ${GITEA_TOKEN}" \ + -X POST \ + -F "attachment=@${asset}" \ + "${assets_url}?name=${asset_name}" \ + >/dev/null + done diff --git a/.github/workflows/checksum.yaml b/.github/workflows/checksum.yaml deleted file mode 100644 index b7fb942..0000000 --- a/.github/workflows/checksum.yaml +++ /dev/null @@ -1,56 +0,0 @@ -name: Check if checksums are in sync -on: [push] -permissions: - issues: write - pull-requests: write -jobs: - android: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: recursive - - uses: 8BitJonny/gh-get-current-pr@3.0.0 - id: PR - - uses: subosito/flutter-action@v2 - with: - channel: stable - - name: generate checksums - run: | - ./generate_checksum.sh - - name: check if git tree is clean - run: | - if [ -z "$(git status --porcelain)" ]; then - exit 0 - else - exit 1 - fi - - uses: actions/github-script@v7 - continue-on-error: true - id: get_issue_number - with: - script: | - if (context.issue.number) { - // Return issue number if present - return context.issue.number; - } else { - // Otherwise return issue number from commit - return ( - await github.rest.repos.listPullRequestsAssociatedWithCommit({ - commit_sha: context.sha, - owner: context.repo.owner, - repo: context.repo.repo, - }) - ).data[0].number; - } - result-encoding: string - - name: Create or update comment - continue-on-error: true - if: failure() - uses: peter-evans/create-or-update-comment@v4 - with: - issue-number: ${{steps.get_issue_number.outputs.result}} - body: | - Invalid checksums, please run `./generate_checksum.sh` - \ No newline at end of file diff --git a/.github/workflows/dart_bindings.yaml b/.github/workflows/dart_bindings.yaml deleted file mode 100644 index a129853..0000000 --- a/.github/workflows/dart_bindings.yaml +++ /dev/null @@ -1,57 +0,0 @@ -name: Check if dart bindings are in sync -on: [push] -permissions: - issues: write - pull-requests: write -jobs: - android: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: recursive - - uses: 8BitJonny/gh-get-current-pr@3.0.0 - id: PR - - uses: subosito/flutter-action@v2 - with: - channel: stable - - name: generate bindings - run: | - cd impls/monero.dart - ./update_bindings.sh - - name: check if git tree is clean - run: | - if [ -z "$(git status --porcelain)" ]; then - exit 0 - else - exit 1 - fi - - uses: actions/github-script@v7 - continue-on-error: true - id: get_issue_number - with: - script: | - if (context.issue.number) { - // Return issue number if present - return context.issue.number; - } else { - // Otherwise return issue number from commit - return ( - await github.rest.repos.listPullRequestsAssociatedWithCommit({ - commit_sha: context.sha, - owner: context.repo.owner, - repo: context.repo.repo, - }) - ).data[0].number; - } - result-encoding: string - - name: Create or update comment - continue-on-error: true - if: failure() - uses: peter-evans/create-or-update-comment@v4 - with: - issue-number: ${{steps.get_issue_number.outputs.result}} - body: | - Invalid bindings found in monero.dart, make sure to run `./impls/monero.dart/update_bindings.sh` - \ No newline at end of file diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml deleted file mode 100644 index f4d9a53..0000000 --- a/.github/workflows/docs.yaml +++ /dev/null @@ -1,48 +0,0 @@ -name: Build documentation - -on: [push] - -env: - # Name of module and id separated by a slash - INSTANCE: Writerside/in - # Replace HI with the ID of the instance in capital letters - ARTIFACT: webHelpIN2-all.zip - # Docker image version - DOCKER_VERSION: "242.21870" - -jobs: - build: - runs-on: ubuntu-latest - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - uses: actions/setup-go@v5 - with: - go-version: '^1.23.2' - - uses: hecrj/setup-rust-action@v2 - with: - rust-version: stable - - name: Update image - run: cd docs && ./update_screenshot.sh - - name: Build Writerside docs using Docker - uses: JetBrains/writerside-github-action@v4 - with: - location: "docs" - instance: ${{ env.INSTANCE }} - artifact: ${{ env.ARTIFACT }} - docker-version: ${{ env.DOCKER_VERSION }} - - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: artifact - path: artifacts/${{ env.ARTIFACT }} - - - name: Release - uses: softprops/action-gh-release@v2 - if: startsWith(github.ref, 'refs/tags/') - with: - files: artifacts/${{ env.ARTIFACT }} - token: ${{ secrets.CUSTOM_GITHUB_TOKEN }} diff --git a/.github/workflows/full_check.yaml b/.github/workflows/full_check.yaml deleted file mode 100644 index 980f9df..0000000 --- a/.github/workflows/full_check.yaml +++ /dev/null @@ -1,598 +0,0 @@ -name: full compatibility check -on: [push] -permissions: - issues: write - pull-requests: write -jobs: - lib_mingw: - strategy: - fail-fast: false - matrix: - coin: [monero, salvium, peya] - runs-on: ubuntu-latest - container: - image: ubuntu:24.04 - steps: - - name: Install dependencies - run: | - apt update - apt install -y pigz build-essential pkg-config autoconf libtool ccache make cmake gcc g++ git curl lbzip2 gperf gcc-mingw-w64-x86-64 g++-mingw-w64-x86-64 gcc-mingw-w64-i686 g++-mingw-w64-i686 - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: recursive - - name: Patch sources - run: | - git config --global --add safe.directory '*' - git config --global user.email "ci@mrcyjanek.net" - git config --global user.name "CI mrcyjanek.net" - ./apply_patches.sh ${{ matrix.coin }} - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: - key: ${{ github.job }}-${{ matrix.coin }} - - name: Cache built - if: ${{ !startsWith(github.ref, 'refs/tags/v') }} - uses: actions/cache@v4 - with: - path: | - contrib/depends/built/* - key: depends-${{ github.job }}-${{ hashFiles('contrib/depends/packages/*.mk') }} - - name: ${{ matrix.coin }}/x86_64-w64-mingw32 - run: ./build_single.sh ${{ matrix.coin }} x86_64-w64-mingw32 -j$(nproc) - - name: ${{ matrix.coin }}/i686-w64-mingw32 - run: ./build_single.sh ${{ matrix.coin }} i686-w64-mingw32 -j$(nproc) - - name: rename artifacts - run: | - mkdir release/gh/ - for i in release/${{ matrix.coin }}/* - do - cp "$i" "release/gh/${{ matrix.coin }}_$(basename $i)" - done - - name: Release - uses: softprops/action-gh-release@v2 - if: startsWith(github.ref, 'refs/tags/') - with: - files: release/gh/* - token: ${{ secrets.CUSTOM_GITHUB_TOKEN }} - - name: Upload lib - uses: actions/upload-artifact@v4 - with: - name: mingw ${{ matrix.coin }} - path: release/${{ matrix.coin }} - lib_android: - strategy: - fail-fast: false - matrix: - coin: [monero, salvium, peya] - runs-on: ubuntu-22.04 - # container: - # image: debian:bookworm - steps: - - name: Free Disk Space - if: ${{ !startsWith(github.ref, 'refs/tags/v') }} - uses: jlumbroso/free-disk-space@main - with: - tool-cache: false - android: true - dotnet: true - haskell: true - large-packages: true - docker-images: true - swap-storage: true - - name: Install dependencies - run: | - sudo apt update - sudo apt install -y llvm pigz build-essential pkg-config autoconf libtool ccache make cmake gcc g++ git curl lbzip2 libtinfo6 gperf unzip python-is-python3 - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: recursive - - name: Patch sources - run: | - git config --global --add safe.directory '*' - git config --global user.email "ci@mrcyjanek.net" - git config --global user.name "CI mrcyjanek.net" - ./apply_patches.sh ${{ matrix.coin }} - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: - key: ${{ github.job }}-${{ matrix.coin }} - - name: Cache built - if: ${{ !startsWith(github.ref, 'refs/tags/v') }} - uses: actions/cache@v4 - with: - path: | - contrib/depends/built/* - key: depends-${{ github.job }}-${{ hashFiles('contrib/depends/packages/*.mk') }} - - name: ${{ matrix.coin }}/x86_64-linux-android - run: ./build_single.sh ${{ matrix.coin }} x86_64-linux-android -j$(nproc) - - name: ${{ matrix.coin }}/aarch64-linux-android - run: ./build_single.sh ${{ matrix.coin }} aarch64-linux-android -j$(nproc) - - name: ${{ matrix.coin }}/armv7a-linux-androideabi - run: ./build_single.sh ${{ matrix.coin }} armv7a-linux-androideabi -j$(nproc) - - name: rename artifacts - run: | - mkdir release/gh/ - for i in release/${{ matrix.coin }}/* - do - cp "$i" "release/gh/${{ matrix.coin }}_$(basename $i)" - done - - name: Release - uses: softprops/action-gh-release@v2 - if: startsWith(github.ref, 'refs/tags/') - with: - files: release/gh/* - token: ${{ secrets.CUSTOM_GITHUB_TOKEN }} - - name: Upload lib - uses: actions/upload-artifact@v4 - with: - name: android ${{ matrix.coin }} - path: release/${{ matrix.coin }} - - name: remove android_ndk - run: | - rm -rf contrib/depends/built/*/android_ndk - rm -rf contrib/depends/sources/android-ndk-r26d-linux.zip - lib_linux: - strategy: - fail-fast: false - matrix: - coin: [monero, salvium, peya] - runs-on: ubuntu-latest - container: - image: debian:bullseye - steps: - - name: Install dependencies - run: | - apt update - apt install -y pigz build-essential pkg-config autoconf libtool ccache make cmake gcc g++ git curl lbzip2 libtinfo5 gperf gcc-aarch64-linux-gnu g++-aarch64-linux-gnu gcc-i686-linux-gnu g++-i686-linux-gnu - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: recursive - - name: Patch sources - run: | - git config --global --add safe.directory '*' - git config --global user.email "ci@mrcyjanek.net" - git config --global user.name "CI mrcyjanek.net" - ./apply_patches.sh ${{ matrix.coin }} - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: - key: ${{ github.job }}-${{ matrix.coin }} - - name: Cache built - if: ${{ !startsWith(github.ref, 'refs/tags/v') }} - uses: actions/cache@v4 - with: - path: | - contrib/depends/built/* - key: depends-${{ github.job }}-${{ hashFiles('contrib/depends/packages/*.mk') }} - - name: ${{ matrix.coin }}/x86_64-linux-gnu - run: ./build_single.sh ${{ matrix.coin }} x86_64-linux-gnu -j$(nproc) - - name: ${{ matrix.coin }}/aarch64-linux-gnu - run: ./build_single.sh ${{ matrix.coin }} aarch64-linux-gnu -j$(nproc) - - name: ${{ matrix.coin }}/i686-linux-gnu - run: ./build_single.sh ${{ matrix.coin }} i686-linux-gnu -j$(nproc) - - name: rename artifacts - run: | - mkdir release/gh/ - for i in release/${{ matrix.coin }}/* - do - cp "$i" "release/gh/${{ matrix.coin }}_$(basename $i)" - done - - name: Release - uses: softprops/action-gh-release@v2 - if: startsWith(github.ref, 'refs/tags/') - with: - files: release/gh/* - token: ${{ secrets.CUSTOM_GITHUB_TOKEN }} - - name: Upload lib - uses: actions/upload-artifact@v4 - with: - name: linux ${{ matrix.coin }} - path: release/${{ matrix.coin }} - lib_macos: - strategy: - fail-fast: false - matrix: - coin: [monero, salvium, peya] - name: macos build - runs-on: macos-14 - steps: - - name: Checkout monero_c repo - uses: actions/checkout@v4 - with: - repository: MrCyjaneK/monero_c - fetch-depth: 0 - submodules: recursive - - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: '15.4' - - name: install dependencies - run: | - brew install ccache binutils pigz autoconf automake libtool pkg-config - - name: Patch sources - run: | - git config --global --add safe.directory '*' - git config --global user.email "ci@mrcyjanek.net" - git config --global user.name "CI mrcyjanek.net" - ./apply_patches.sh ${{ matrix.coin }} - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: - key: ${{ github.job }}-${{ matrix.coin }} - - name: Cache built - if: ${{ !startsWith(github.ref, 'refs/tags/v') }} - uses: actions/cache@v4 - with: - path: | - contrib/depends/built/* - key: depends-${{ github.job }}-${{ hashFiles('contrib/depends/packages/*.mk') }} - - name: build (aarch64-apple-darwin) - run: | - ./build_single.sh ${{ matrix.coin }} aarch64-apple-darwin -j$(sysctl -n hw.logicalcpu) - - name: build (x86_64-apple-darwin) - run: | - ./build_single.sh ${{ matrix.coin }} x86_64-apple-darwin -j$(sysctl -n hw.logicalcpu) - - name: rename artifacts - run: | - mkdir release/gh/ - for i in release/${{ matrix.coin }}/* - do - cp "$i" "release/gh/${{ matrix.coin }}_$(basename $i)" - done - - name: Release - uses: softprops/action-gh-release@v2 - if: startsWith(github.ref, 'refs/tags/') - with: - files: release/gh/* - token: ${{ secrets.CUSTOM_GITHUB_TOKEN }} - - name: Upload lib - uses: actions/upload-artifact@v4 - with: - name: macos ${{ matrix.coin }} - path: release/${{ matrix.coin }} - lib_ios: - strategy: - fail-fast: false - matrix: - coin: [monero, salvium, peya] - name: ios build - runs-on: macos-15 - steps: - - name: Checkout monero_c repo - uses: actions/checkout@v4 - with: - repository: MrCyjaneK/monero_c - fetch-depth: 0 - submodules: recursive - - uses: maxim-lobanov/setup-xcode@v1 - with: - xcode-version: '16.1' - - name: install dependencies - run: | - brew install ccache cmake autoconf automake libtool - - name: Patch sources - run: | - git config --global --add safe.directory '*' - git config --global user.email "ci@mrcyjanek.net" - git config --global user.name "CI mrcyjanek.net" - ./apply_patches.sh ${{ matrix.coin }} - - name: ccache - uses: hendrikmuhs/ccache-action@v1.2 - with: - key: ${{ github.job }}-${{ matrix.coin }} - - name: Cache built - if: ${{ !startsWith(github.ref, 'refs/tags/v') }} - uses: actions/cache@v4 - with: - path: | - contrib/depends/built/* - key: depends-${{ github.job }}-${{ hashFiles('contrib/depends/packages/*.mk') }} - - name: build (aarch64-apple-ios) - run: | - ./build_single.sh ${{ matrix.coin }} aarch64-apple-ios -j$(sysctl -n hw.logicalcpu) - - - name: build (aarch64-apple-iossimulator) - run: | - ./build_single.sh ${{ matrix.coin }} aarch64-apple-iossimulator -j$(sysctl -n hw.logicalcpu) - - - name: rename artifacts - run: | - mkdir release/gh/ - for i in release/${{ matrix.coin }}/* - do - cp "$i" "release/gh/${{ matrix.coin }}_$(basename $i)" - done - - name: Release - uses: softprops/action-gh-release@v2 - if: startsWith(github.ref, 'refs/tags/') - with: - files: release/gh/* - token: ${{ secrets.CUSTOM_GITHUB_TOKEN }} - - name: Upload lib - uses: actions/upload-artifact@v4 - with: - name: ios ${{ matrix.coin }} - path: release/${{ matrix.coin }} - bulk_lib_release: - name: create single release file - runs-on: ubuntu-latest - needs: [ - lib_mingw, lib_android, lib_linux, lib_macos, lib_ios - ] - steps: - - uses: actions/download-artifact@v4 - with: - name: android monero - path: release/monero - - uses: actions/download-artifact@v4 - with: - name: android salvium - path: release/salvium - - uses: actions/download-artifact@v4 - with: - name: android peya - path: release/peya - - uses: actions/download-artifact@v4 - with: - name: ios monero - path: release/monero - - uses: actions/download-artifact@v4 - with: - name: ios salvium - path: release/salvium - - uses: actions/download-artifact@v4 - with: - name: ios peya - path: release/peya - - uses: actions/download-artifact@v4 - with: - name: linux monero - path: release/monero - - uses: actions/download-artifact@v4 - with: - name: linux salvium - path: release/salvium - - uses: actions/download-artifact@v4 - with: - name: linux peya - path: release/peya - - uses: actions/download-artifact@v4 - with: - name: macos monero - path: release/monero - - uses: actions/download-artifact@v4 - with: - name: macos salvium - path: release/salvium - - uses: actions/download-artifact@v4 - with: - name: macos peya - path: release/peya - - uses: actions/download-artifact@v4 - with: - name: mingw monero - path: release/monero - - uses: actions/download-artifact@v4 - with: - name: mingw salvium - path: release/salvium - - name: zip release dir - run: zip -r release-bundle.zip release - - name: Release - uses: softprops/action-gh-release@v2 - if: startsWith(github.ref, 'refs/tags/') - with: - files: release-bundle.zip - token: ${{ secrets.CUSTOM_GITHUB_TOKEN }} - - name: Upload lib - uses: actions/upload-artifact@v4 - with: - name: release-bulk - path: release - deno_monerots_test_linux: - name: test ts library - runs-on: ubuntu-24.04 - needs: [ - lib_linux - ] - steps: - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: recursive - - uses: actions/download-artifact@v4 - with: - name: linux monero - path: release/monero - - name: unpack and move monero_c - run: | - unxz -f -k release/*/*.xz - - uses: denoland/setup-deno@v1 - with: - deno-version: vx.x.x - - name: Create symlink - run: | - cd impls/monero.ts - mkdir lib - cd lib - ln -s ../../../release/monero/x86_64-linux-gnu_libwallet2_api_c.so - mv x86_64-linux-gnu_libwallet2_api_c.so monero_libwallet2_api_c.so - cd .. - - name: Run tests - run: | - cd impls/monero.ts - deno run --unstable-ffi --allow-ffi checksum.ts - - regression_tests_linux: - name: linux regression tests - strategy: - fail-fast: false - matrix: - coin: [monero, salvium, peya] - needs: [ - lib_linux - ] - runs-on: ubuntu-24.04 - steps: - - uses: denoland/setup-deno@v2 - with: - deno-version: v2.x - - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: recursive - - - uses: actions/download-artifact@v4 - with: - name: linux ${{ matrix.coin }} - path: release/${{ matrix.coin }} - - - name: Run regression tests - run: COIN="${{ matrix.coin }}" deno test -A tests/regression.test.ts - - regression_tests_macos: - name: macos regression tests - strategy: - matrix: - coin: [monero, salvium, peya] - needs: [ - lib_macos - ] - runs-on: macos-14 - steps: - - uses: denoland/setup-deno@v2 - with: - deno-version: canary - - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: recursive - - - uses: actions/download-artifact@v4 - with: - name: macos ${{ matrix.coin }} - path: release/${{ matrix.coin }} - - - name: Run regression tests - run: COIN="${{ matrix.coin }}" deno test -A tests/regression.test.ts - - integration_tests_linux: - name: linux integration tests - strategy: - matrix: - coin: [monero, salvium, peya] - needs: [ - lib_linux - ] - runs-on: ubuntu-24.04 - steps: - - uses: denoland/setup-deno@v2 - with: - deno-version: v2.x - - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: recursive - - - uses: actions/download-artifact@v4 - with: - name: linux ${{ matrix.coin }} - path: release/${{ matrix.coin }} - - - name: Run integration tests - run: COIN="${{ matrix.coin }}" deno test -A tests/integration.test.ts - env: - SECRET_WALLET_PASSWORD: ${{ secrets.SECRET_WALLET_PASSWORD }} - SECRET_WALLET_MNEMONIC: ${{ secrets.SECRET_WALLET_MNEMONIC }} - SECRET_WALLET_RESTORE_HEIGHT: ${{ secrets.SECRET_WALLET_RESTORE_HEIGHT }} - - - integration_tests_macos: - name: macos integration tests - strategy: - matrix: - coin: [monero, salvium, peya] - needs: [ - lib_macos - ] - runs-on: macos-14 - steps: - - uses: denoland/setup-deno@v2 - with: - deno-version: v2.x - - - uses: actions/checkout@v4 - with: - fetch-depth: 0 - submodules: recursive - - - uses: actions/download-artifact@v4 - with: - name: macos ${{ matrix.coin }} - path: release/${{ matrix.coin }} - - - name: Run integration tests - run: COIN="${{ matrix.coin }}" deno test -A tests/integration.test.ts - env: - SECRET_WALLET_PASSWORD: ${{ secrets.SECRET_WALLET_PASSWORD }} - SECRET_WALLET_MNEMONIC: ${{ secrets.SECRET_WALLET_MNEMONIC }} - SECRET_WALLET_RESTORE_HEIGHT: ${{ secrets.SECRET_WALLET_RESTORE_HEIGHT }} - - - comment_pr: - name: comment on pr - runs-on: ubuntu-latest - needs: [ - lib_mingw, lib_android, lib_linux, lib_macos, lib_ios, - ] - steps: - - uses: actions/github-script@v7 - continue-on-error: true - id: get_issue_number - with: - script: | - if (context.issue.number) { - // Return issue number if present - return context.issue.number; - } else { - // Otherwise return issue number from commit - return ( - await github.rest.repos.listPullRequestsAssociatedWithCommit({ - commit_sha: context.sha, - owner: context.repo.owner, - repo: context.repo.repo, - }) - ).data[0].number; - } - result-encoding: string - - name: Find Comment - continue-on-error: true - uses: peter-evans/find-comment@v3 - id: fc - with: - issue-number: ${{steps.get_issue_number.outputs.result}} - comment-author: 'github-actions[bot]' - body-includes: download artifacts - - name: Update comment - continue-on-error: true - if: steps.fc.outcome == 'success' - uses: peter-evans/create-or-update-comment@v4 - with: - comment-id: ${{ steps.fc.outputs.comment-id }} - issue-number: ${{steps.get_issue_number.outputs.result}} - body: | - [download artifacts #${{github.run_id}}](https://nightly.link/MrCyjaneK/monero_c/actions/runs/${{github.run_id}}) - edit-mode: replace - - name: Create comment - continue-on-error: true - if: steps.fc.outcome == 'failure' - uses: peter-evans/create-or-update-comment@v4 - with: - issue-number: ${{steps.get_issue_number.outputs.result}} - body: | - [download artifacts #${{github.run_id}}](https://nightly.link/MrCyjaneK/monero_c/actions/runs/${{github.run_id}}) (this comment will update whenever you push)