-
Notifications
You must be signed in to change notification settings - Fork 12
87 lines (78 loc) · 3.14 KB
/
build_nightly.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
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 # v1.2.0
- 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 # v4.2.1
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 # v4.4.3
with:
name: ${{ env.artifact_name }}
path: |
./target/release/iota
./target/release/iota-indexer