Build nightly IOTA binaries #30
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build nightly IOTA binaries | |
on: | |
schedule: | |
- cron: "0 4 * * *" # Runs every day at 4 AM | |
workflow_dispatch: | |
inputs: | |
iota_branch: | |
description: "IOTA repo branch to build artifacts from (default: develop)" | |
type: string | |
required: false | |
env: | |
# Nightly builds are cut from develop. | |
TAG_NAME: "${{ github.event.inputs.iota_branch || 'develop' }}" | |
CARGO_TERM_COLOR: always | |
# Disable incremental compilation. | |
# | |
# Incremental compilation is useful as part of an edit-build-test-edit cycle, | |
# as it lets the compiler avoid recompiling code that hasn't changed. However, | |
# on CI, we're not making small edits; we're almost always building the entire | |
# project from scratch. Thus, incremental compilation on CI actually | |
# introduces *additional* overhead to support making future builds | |
# faster...but no future builds will ever occur in any given CI environment. | |
# | |
# See https://matklad.github.io/2021/09/04/fast-rust-builds.html#ci-workflow | |
# for details. | |
CARGO_INCREMENTAL: 0 | |
# Allow more retries for network requests in cargo (downloading crates) and | |
# rustup (installing toolchains). This should help to reduce flaky CI failures | |
# from transient network timeouts or other issues. | |
CARGO_NET_RETRY: 10 | |
RUSTUP_MAX_RETRIES: 10 | |
# Don't emit giant backtraces in the CI logs. | |
RUST_BACKTRACE: short | |
jobs: | |
release-nightly-build: | |
name: Build & Publish Nightly Binaries | |
timeout-minutes: 80 | |
strategy: | |
matrix: | |
os: [self-hosted] | |
fail-fast: false | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Clean up tag name ${{ env.TAG_NAME }} and create artifact name | |
shell: bash | |
run: | | |
export iota_branch=$(echo ${{ env.TAG_NAME }} | sed s/'refs\/tags\/'//) | |
echo "iota_branch=${iota_branch}" >> $GITHUB_ENV | |
export artifact_name="iota-nightly-$(date -Idate)" | |
echo "artifact_name=${artifact_name}" >> $GITHUB_ENV | |
- name: Install Foundry | |
uses: foundry-rs/foundry-toolchain@8f1998e9878d786675189ef566a2e4bf24869773 # pin@v1 | |
- name: Install PostgreSQL library headers | |
shell: bash | |
run: sudo apt-get install -y libpq-dev | |
- name: Set os/arch variables | |
if: matrix.os != 'windows-ghcloud' | |
shell: bash | |
run: | | |
export arch=$(uname -m) | |
export system_os=$(echo ${{ matrix.os }} | cut -d- -f1) | |
export os_type="${system_os}-${arch}" | |
echo "os_type=${system_os}-${arch}" >> $GITHUB_ENV | |
- name: Checking out ${{ env.iota_branch }} | |
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # pin@v4 | |
with: | |
ref: ${{ env.iota_branch }} | |
- name: cargo build (release) for ${{ matrix.os }} platform | |
shell: bash | |
run: | | |
[ -f ~/.cargo/env ] && source ~/.cargo/env ; cargo build --release --bin iota --bin iota-indexer --features indexer | |
- name: Upload artifacts | |
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # pin@v4 | |
with: | |
name: ${{ env.artifact_name }} | |
path: | | |
./target/release/iota | |
./target/release/iota-indexer |