Skip to content

Commit

Permalink
chore: development merge
Browse files Browse the repository at this point in the history
  • Loading branch information
stringhandler authored Aug 29, 2022
2 parents 2252f6a + 85acc2f commit 9153f9a
Show file tree
Hide file tree
Showing 283 changed files with 8,436 additions and 6,599 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/base_node_binaries.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
},
{
"name": "linux-arm64",
"runs-on": "ubuntu-18.04",
"runs-on": "ubuntu-latest",
"rust": "stable",
"target": "aarch64-unknown-linux-gnu",
"cross": false,
"cross": true,
"target_bins": "--bin tari_base_node --bin tari_console_wallet --bin tari_merge_mining_proxy --bin tari_miner",
"target_cpu": "generic",
"target_bins": "--bin tari_base_node --bin tari_console_wallet --bin tari_merge_mining_proxy --bin tari_miner --bin tari_validator_node",
"features": "safe"
},
{
Expand Down Expand Up @@ -43,7 +43,6 @@
"target": "x86_64-pc-windows-msvc",
"cross": false,
"target_cpu": "x86-64",
"target_bins": "--bin tari_base_node --bin tari_console_wallet --bin tari_merge_mining_proxy --bin tari_miner --bin tari_validator_node",
"features": "safe"
},
{
Expand All @@ -54,6 +53,7 @@
"cross": false,
"target_cpu": "generic",
"features": "safe",
"target_bins": "--bin tari_base_node --bin tari_console_wallet --bin tari_merge_mining_proxy --bin tari_miner",
"build_enabled": false
}
]
29 changes: 3 additions & 26 deletions .github/workflows/base_node_binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
override: true

- name: Install Linux dependencies - Ubuntu
if: startsWith(runner.os,'Linux')
if: ${{ startsWith(runner.os,'Linux') && matrix.builds.name != 'linux-arm64' }}
run: |
sudo apt-get update
sudo apt-get -y install \
Expand All @@ -125,11 +125,7 @@ jobs:
protobuf-compiler \
libncurses5-dev \
libncursesw5-dev \
zip \
gcc-aarch64-linux-gnu \
g++-aarch64-linux-gnu
sudo apt-get -y --purge remove \
clang-9 clang-format-9 libclang-common-9-dev libclang-cpp9 libclang1-9
zip
- name: Install macOS dependencies
if: startsWith(runner.os,'macOS')
Expand Down Expand Up @@ -182,25 +178,8 @@ jobs:
- name: Cache cargo files and outputs
uses: Swatinem/rust-cache@v1

# Fix me soon!
- name: Build rust binaries - hardcoded (linux-arm64)
if: ${{ matrix.builds.name == 'linux-arm64' }}
shell: bash
run: |
export RUSTFLAGS="-C target_cpu=generic"
export ROARING_ARCH=generic
export BUILD_TARGET="aarch64-unknown-linux-gnu/"
export RUST_TARGET="--target=aarch64-unknown-linux-gnu"
export ARCH=generic
export FEATURES=safe
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
export CC_aarch64_unknown_linux_gnu=aarch64-linux-gnu-gcc
export CXX_aarch64_unknown_linux_gnu=aarch64-linux-gnu-g++
export BINDGEN_EXTRA_CLANG_ARGS="--sysroot /usr/aarch64-linux-gnu/include/"
cargo build --release --target ${{ matrix.builds.target }} --features ${{ matrix.builds.features }} ${{ matrix.builds.target_bins }}
- name: Build rust binaries - Normal
if: ${{ matrix.builds.name != 'linux-arm64' }}
#if: ${{ matrix.builds.name != 'linux-arm64' }}
uses: actions-rs/cargo@v1
env:
RUSTFLAGS: "-C target_cpu=${{ matrix.builds.target_cpu }}"
Expand Down Expand Up @@ -229,7 +208,6 @@ jobs:
"tari_console_wallet"
"tari_miner"
"tari_merge_mining_proxy"
"tari_validator_node"
)
for FILE in "${FILES[@]}"; do
if [ -f "$GITHUB_WORKSPACE/target/${{ matrix.builds.target }}/release/${FILE}${TBN_EXT}" ]; then
Expand Down Expand Up @@ -274,7 +252,6 @@ jobs:
"tari_console_wallet"
"tari_miner"
"tari_merge_mining_proxy"
"tari_validator_node"
)
for FILE in "${FILES[@]}"; do
codesign --options runtime --force --verify --verbose --timestamp --sign "Developer ID Application: $MACOS_APPLICATION_ID" "/tmp/tari_testnet/runtime/$FILE"
Expand Down
91 changes: 59 additions & 32 deletions .github/workflows/build_dockers.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
---
name: Build docker images

on:
'on':
push:
paths-ignore:
- '**/*.md'
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
- 'v[0-9]+.[0-9]+.[0-9]*'
branches:
- "build-*"
- 'build_dockers*'
schedule:
- cron: "05 00 * * *"
- cron: '05 00 * * *'
workflow_dispatch:
inputs:
# toolchain:
Expand All @@ -25,24 +27,24 @@ on:
description: 'docker platform(s)'
type: choice
options:
- linux/amd64
- linux/arm64
- linux/arm64, linux/amd64
- linux/amd64
- linux/arm64
- linux/arm64, linux/amd64
build_items:
default: tari_all
description: 'image(s) to build'
type: choice
options:
- all
- tari_all
- tari_base_node
- tari_wallet
- tari_mm_proxy
- tari_sha3_miner
- 3rdparty_all
- tor
- monerod
- xmrig
- all
- tari_all
- tari_base_node
- tari_wallet
- tari_mm_proxy
- tari_sha3_miner
- 3rdparty_all
- tor
- monerod
- xmrig

env:
toolchain_default: nightly-2022-05-01
Expand All @@ -51,29 +53,54 @@ jobs:
builds_envs_setup:
runs-on: ubuntu-latest
outputs:
toolchain: ${{ steps.set_toolchain.outputs.toolchain }}
toolchain: ${{ steps.envs_setup.outputs.toolchain }}
platforms: ${{ steps.envs_setup.outputs.platforms }}
version: ${{ steps.envs_setup.outputs.version }}
tag_alias: ${{ steps.envs_setup.outputs.tag_alias }}
build_items: ${{ steps.envs_setup.outputs.build_items }}

steps:
- name: Set toolchain
id: set_toolchain
- name: envs setup
id: envs_setup
shell: bash
run: |
if [ -z "${{ inputs.toolchain }}" ]; then
echo "Using default"
btoolchain=${{ env.toolchain_default }}
else
echo "Using provided input"
btoolchain=${{ inputs.toolchain }}
echo "Workflow triggered by ${{ github.actor }} for ${{ github.event_name }}"
echo "SHA - ${GITHUB_SHA}"
VSHA_SHORT=$(echo ${GITHUB_SHA::7})
echo "SHA short - ${VSHA_SHORT}"
echo "VSHA_SHORT=${VSHA_SHORT}" >> $GITHUB_ENV
TOOLCHAIN=${{ github.event.inputs.toolchain }}
echo "::set-output name=toolchain::${TOOLCHAIN:-${{ env.toolchain_default }}}"
if [[ "${{ github.ref }}" =~ ^refs/tags/v* ]] && [ "${{ github.event_name }}" != "workflow_dispatch" ] ; then
echo "Tagged Build - Build everything"
VERSION="${{ github.ref_name }}_$(date -u '+%Y%m%d')_${VSHA_SHORT}"
echo "Version used - ${VERSION}"
echo "::set-output name=platforms::linux/arm64, linux/amd64"
echo "::set-output name=version::${VERSION}"
echo "::set-output name=tag_alias::latest"
echo "::set-output name=build_items::all"
fi
if [ "${{ github.event_name }}" == "workflow_dispatch" ] ; then
echo "Manual Build - selective"
echo "::set-output name=platforms::${{ github.event.inputs.platforms }}"
echo "::set-output name=version::${{ github.event.inputs.version }}"
echo "::set-output name=tag_alias::${{ github.event.inputs.tag_alias }}"
echo "::set-output name=build_items::${{ github.event.inputs.build_items }}"
fi
if [ "${{ github.event_name }}" == "schedule" ] && [ "${{ github.event.schedule }}" == "05 00 * * *" ] ; then
echo "Daily Build - limited"
echo "::set-output name=platforms::linux/amd64"
echo "::set-output name=tag_alias::latest-daily"
echo "::set-output name=build_items::tari_all"
fi
echo "Rust toolchain - ${btoolchain} ."
echo "toolchain=${btoolchain}" >> $GITHUB_ENV
builds_run:
needs: builds_envs_setup
uses: ./.github/workflows/build_dockers_workflow.yml
secrets: inherit
with:
toolchain: ${{ needs.builds_envs_setup.outputs.toolchain }}
platforms: ${{ inputs.platforms }}
version: ${{ inputs.version }}
tag_alias: ${{ inputs.tag_alias }}
build_items: ${{ inputs.build_items }}
platforms: ${{ needs.builds_envs_setup.outputs.platforms }}
version: ${{ needs.builds_envs_setup.outputs.version }}
tag_alias: ${{ needs.builds_envs_setup.outputs.tag_alias }}
build_items: ${{ needs.builds_envs_setup.outputs.build_items }}
2 changes: 1 addition & 1 deletion .github/workflows/build_dockers_workflow.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
name: Build docker images - workflow_call/on-demand

on:
'on':
workflow_call:
secrets:
DOCKER_PROVIDER:
Expand Down
99 changes: 99 additions & 0 deletions .github/workflows/build_libwallets.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
---
name: Build libwallets

'on':
push:
tags:
- "v[0-9]+.[0-9]+.[0-9]+"
branches:
- "build-libwallet-*"
schedule:
- cron: "05 00 * * *"
workflow_dispatch:
inputs:
build_android:
type: boolean
default: true
build_ios:
type: boolean
default: true
toolchain:
type: string
description: 'Rust toolchain'

env:
toolchain_default: nightly-2022-05-01

jobs:
builds_envs_setup:
runs-on: ubuntu-latest
outputs:
toolchain: ${{ steps.envs_setup.outputs.toolchain }}
build_android: ${{ steps.envs_setup.outputs.build_android }}
build_ios: ${{ steps.envs_setup.outputs.build_ios }}

steps:
- name: envs setup
id: envs_setup
run: |
TOOLCHAIN=${{ github.event.inputs.toolchain }}
echo "::set-output name=toolchain::${TOOLCHAIN:-${{ env.toolchain_default }}}"
BUILD_ANDROID=${{ github.event.inputs.build_android }}
echo "::set-output name=build_android::${BUILD_ANDROID:-true}"
BUILD_IOS=${{ github.event.inputs.build_ios }}
echo "::set-output name=build_ios::${BUILD_IOS:-true}"
builds_run:
needs: builds_envs_setup
uses: ./.github/workflows/build_libwallets_workflow.yml
with:
toolchain: ${{ needs.builds_envs_setup.outputs.toolchain }}
build_android: ${{ needs.builds_envs_setup.outputs.build_android }}
build_ios: ${{ needs.builds_envs_setup.outputs.build_ios }}

libwallet_uploads:
needs: builds_run
runs-on: ubuntu-latest
steps:
- name: Download binaries
uses: actions/download-artifact@v3
with:
path: libwallets

- name: Verify checksums
shell: bash
working-directory: libwallets
run: |
ls -alhtR
find . -name "*.sha256sums" -print | xargs cat >> libwallets.txt.sha256sums-verify
cat libwallets.txt.sha256sums-verify
sha256sum -c libwallets.txt.sha256sums-verify
- name: Sync to S3 on tag
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
continue-on-error: true # Don't break if s3 upload fails
uses: jakejarvis/s3-sync-action@v0.5.1
with:
args: --acl public-read --follow-symlinks
env:
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: "us-east-1" # optional: defaults to us-east-1
SOURCE_DIR: "$GITHUB_WORKSPACE/libwallets"
DEST_DIR: "libwallet"

create-release:
runs-on: ubuntu-latest
needs: libwallet_uploads
if: ${{ startsWith(github.ref, 'refs/tags/v') }}
steps:
- name: Download binaries
uses: actions/download-artifact@v2
- name: Create release
uses: ncipollo/release-action@v1
with:
artifacts: "libwallet*/**/*"
token: ${{ secrets.GITHUB_TOKEN }}
prerelease: true
draft: true
Loading

0 comments on commit 9153f9a

Please sign in to comment.