218 lines
7.2 KiB
YAML
218 lines
7.2 KiB
YAML
name: build
|
|
run-name: build wallet variants (peya=${{ inputs.peya_release_tag || 'latest' }}, monero_c=${{ inputs.monero_c_release_tag || 'latest' }}, xmrig=${{ inputs.xmrig_release_tag || 'latest' }})
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
inputs:
|
|
peya_release_tag:
|
|
description: Peya release tag to bundle runtime from
|
|
required: false
|
|
default: latest
|
|
monero_c_release_tag:
|
|
description: monero_c release tag to bundle runtime from
|
|
required: false
|
|
default: latest
|
|
xmrig_release_tag:
|
|
description: xmrig release tag to bundle mining runtime from
|
|
required: false
|
|
default: latest
|
|
push:
|
|
branches:
|
|
- develop
|
|
paths:
|
|
- ".gitea/workflows/build.yml"
|
|
- "scripts/ci/**"
|
|
- "lib/**"
|
|
- "linux/**"
|
|
- "monero_c"
|
|
- "windows/**"
|
|
- "pubspec.yaml"
|
|
- "pubspec.lock"
|
|
- "README.md"
|
|
- ".gitmodules"
|
|
|
|
jobs:
|
|
build-linux:
|
|
name: Build Linux (${{ matrix.flavor }})
|
|
runs-on: ubuntu-22.04
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- flavor: lite
|
|
enable_mining: "false"
|
|
- flavor: mining
|
|
enable_mining: "true"
|
|
env:
|
|
PEYA_RELEASE_TAG: ${{ inputs.peya_release_tag }}
|
|
MONERO_C_RELEASE_TAG: ${{ inputs.monero_c_release_tag }}
|
|
XMRIG_RELEASE_TAG: ${{ inputs.xmrig_release_tag }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: https://github.com/actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
submodules: false
|
|
|
|
- name: Configure Gitea auth for monero_c submodule
|
|
env:
|
|
PEYAWALLET_GITEA_PAT: ${{ secrets.PEYAWALLET_GITEA_PAT }}
|
|
PEYA_GITEA_PAT: ${{ secrets.PEYA_GITEA_PAT }}
|
|
GITEA_PAT: ${{ secrets.GITEA_PAT }}
|
|
run: |
|
|
set -euo pipefail
|
|
AUTH_TOKEN="${PEYAWALLET_GITEA_PAT:-${PEYA_GITEA_PAT:-${GITEA_PAT:-}}}"
|
|
if [ -n "${AUTH_TOKEN}" ]; then
|
|
git config --global url."http://tiamak:${AUTH_TOKEN}@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 monero_c
|
|
|
|
- name: Install Linux build dependencies
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y \
|
|
libayatana-appindicator3-dev \
|
|
clang \
|
|
cmake \
|
|
curl \
|
|
libgtk-3-dev \
|
|
liblzma-dev \
|
|
ninja-build \
|
|
pkg-config \
|
|
python3 \
|
|
xz-utils
|
|
|
|
- name: Setup Flutter
|
|
uses: https://github.com/subosito/flutter-action@v2
|
|
with:
|
|
channel: stable
|
|
|
|
- name: Stage runtime from releases
|
|
env:
|
|
PEYAWALLET_GITEA_PAT: ${{ secrets.PEYAWALLET_GITEA_PAT }}
|
|
PEYA_GITEA_PAT: ${{ secrets.PEYA_GITEA_PAT }}
|
|
MONERO_C_GITEA_PAT: ${{ secrets.MONERO_C_GITEA_PAT }}
|
|
GITEA_PAT: ${{ secrets.PEYA_GITEA_PAT }}
|
|
run: |
|
|
set -euo pipefail
|
|
EXTRA_ARGS=()
|
|
if [ "${{ matrix.flavor }}" = "mining" ]; then
|
|
EXTRA_ARGS+=(--xmrig-tag "${XMRIG_RELEASE_TAG:-latest}")
|
|
fi
|
|
python3 scripts/ci/stage_release_runtime.py \
|
|
--platform linux \
|
|
--peya-tag "${PEYA_RELEASE_TAG:-latest}" \
|
|
--monero-c-tag "${MONERO_C_RELEASE_TAG:-latest}" \
|
|
--repo-root . \
|
|
"${EXTRA_ARGS[@]}"
|
|
|
|
- name: Fetch Dart/Flutter deps
|
|
run: flutter pub get
|
|
|
|
- name: Build Linux release
|
|
run: |
|
|
flutter build linux --release \
|
|
--dart-define=PEYA_ENABLE_MINING=${{ matrix.enable_mining }} \
|
|
--dart-define=PEYA_RELEASE_FLAVOR=${{ matrix.flavor }}
|
|
|
|
- name: Bundle xmrig
|
|
if: ${{ matrix.flavor == 'mining' }}
|
|
run: |
|
|
set -euo pipefail
|
|
install -Dm755 external/miner/xmrig \
|
|
build/linux/x64/release/bundle/external/miner/xmrig
|
|
|
|
- name: Upload Linux bundle
|
|
uses: https://github.com/actions/upload-artifact@v3
|
|
with:
|
|
name: peyawallet-${{ matrix.flavor }}-linux-release
|
|
path: build/linux/x64/release/bundle/**
|
|
if-no-files-found: error
|
|
|
|
build-windows:
|
|
name: Build Windows (${{ matrix.flavor }})
|
|
runs-on: windows-latest
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
include:
|
|
- flavor: lite
|
|
enable_mining: "false"
|
|
- flavor: mining
|
|
enable_mining: "true"
|
|
env:
|
|
PEYA_RELEASE_TAG: ${{ inputs.peya_release_tag }}
|
|
MONERO_C_RELEASE_TAG: ${{ inputs.monero_c_release_tag }}
|
|
XMRIG_RELEASE_TAG: ${{ inputs.xmrig_release_tag }}
|
|
steps:
|
|
- name: Checkout
|
|
uses: https://github.com/actions/checkout@v4
|
|
with:
|
|
fetch-depth: 1
|
|
submodules: false
|
|
|
|
- name: Configure Gitea auth for monero_c submodule
|
|
shell: bash
|
|
env:
|
|
PEYAWALLET_GITEA_PAT: ${{ secrets.PEYAWALLET_GITEA_PAT }}
|
|
PEYA_GITEA_PAT: ${{ secrets.PEYA_GITEA_PAT }}
|
|
GITEA_PAT: ${{ secrets.GITEA_PAT }}
|
|
run: |
|
|
set -euo pipefail
|
|
AUTH_TOKEN="${PEYAWALLET_GITEA_PAT:-${PEYA_GITEA_PAT:-${GITEA_PAT:-}}}"
|
|
if [ -n "${AUTH_TOKEN}" ]; then
|
|
git config --global url."http://tiamak:${AUTH_TOKEN}@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 monero_c
|
|
|
|
- name: Stage runtime from releases
|
|
shell: bash
|
|
env:
|
|
PEYA_GITEA_PAT: ${{ secrets.PEYA_GITEA_PAT }}
|
|
GITEA_PAT: ${{ secrets.PEYA_GITEA_PAT }}
|
|
PEYAWALLET_GITEA_PAT: ${{ secrets.PEYA_GITEA_PAT }}
|
|
MONERO_C_GITEA_PAT: ${{ secrets.PEYA_GITEA_PAT }}
|
|
run: |
|
|
set -euo pipefail
|
|
EXTRA_ARGS=()
|
|
if [ "${{ matrix.flavor }}" = "mining" ]; then
|
|
EXTRA_ARGS+=(--xmrig-tag "${XMRIG_RELEASE_TAG:-latest}")
|
|
fi
|
|
python -u scripts/ci/stage_release_runtime.py \
|
|
--platform windows \
|
|
--peya-tag "${PEYA_RELEASE_TAG:-latest}" \
|
|
--monero-c-tag "${MONERO_C_RELEASE_TAG:-latest}" \
|
|
--repo-root . \
|
|
"${EXTRA_ARGS[@]}"
|
|
|
|
- name: Show toolchain
|
|
shell: bash
|
|
run: flutter doctor -v
|
|
|
|
- name: Fetch Dart/Flutter deps
|
|
shell: bash
|
|
run: flutter pub get
|
|
|
|
- name: Build Windows release
|
|
shell: bash
|
|
run: |
|
|
flutter build windows --release \
|
|
--dart-define=PEYA_ENABLE_MINING=${{ matrix.enable_mining }} \
|
|
--dart-define=PEYA_RELEASE_FLAVOR=${{ matrix.flavor }}
|
|
|
|
- name: Bundle xmrig
|
|
if: ${{ matrix.flavor == 'mining' }}
|
|
shell: cmd
|
|
run: |
|
|
if not exist build\windows\x64\runner\Release\external\miner mkdir build\windows\x64\runner\Release\external\miner
|
|
copy external\miner\xmrig.exe build\windows\x64\runner\Release\external\miner\xmrig.exe
|
|
|
|
- name: Upload Windows bundle
|
|
uses: https://github.com/actions/upload-artifact@v3
|
|
with:
|
|
name: peyawallet-${{ matrix.flavor }}-windows-release
|
|
path: build/windows/x64/runner/Release/**
|
|
if-no-files-found: error
|