forked from velas/velas-chain
-
Notifications
You must be signed in to change notification settings - Fork 0
122 lines (104 loc) · 3.86 KB
/
build-release.yaml
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
name: Release
on:
push:
tags:
- v**
# Can be replaced by cron job
branches:
- develop
- "test-release"
- development/test_ci
permissions: write-all
jobs:
build:
runs-on: ${{ matrix.target }}
defaults:
run:
shell: bash -eo pipefail "{0}"
strategy:
matrix:
build: ["linux", "darwin-macos"]
include:
- build: linux
os: linux
target: x86_64-unknown-linux-gnu
cargo_folder: ~/.cargo
exe_ext: ""
- build: darwin-macos
os: osx
target: x86_64-apple-darwin
cargo_folder: ~/.cargo
exe_ext: ""
steps:
- uses: actions/checkout@v3
- name: Set up version
run: echo "VERSION=${GITHUB_REF##*/}" >> $GITHUB_ENV
- name: Emulate travis env (set CI_BRANCH)
run: |
echo "CI_BRANCH=release" >> $GITHUB_ENV
echo "CI_TAG=$VERSION" >> $GITHUB_ENV
echo "CI_OS_NAME=${{ matrix.os }}" >> $GITHUB_ENV
echo "OSTYPE=${{ matrix.build }}" >> $GITHUB_ENV
# Compile with optimisation for skylake CPU to avoid AVX512 simd, that is not exist at any cpu.
- name: Set up rust flag
run: echo RUSTFLAGS="-C target-cpu=skylake" >> $GITHUB_ENV
if: matrix.os == 'linux'
- name: Install deps
run: |
./ci/install_deps.sh
echo "PATH="${{matrix.cargo_folder}}/bin:$PATH"" >> $GITHUB_ENV
# on current infrastructure without cache build take 3:39 ,
# with cache and no dif, build take ~1min + ~3:30 for unpacking and ~3:30 for packing cache which makes it absolutely impractical
# - name: Cache cargo registry
# uses: actions/cache@v1
# with:
# path: ${{matrix.cargo_folder}}/registry
# key: ${{ matrix.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
# restore-keys: |
# ${{ matrix.os }}-cargo-registry-
# - name: Cache cargo index
# uses: actions/cache@v1
# with:
# path: ${{matrix.cargo_folder}}/git
# key: ${{ matrix.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
# restore-keys: |
# ${{ matrix.os }}-cargo-index-
# - name: Cache cargo build
# uses: actions/cache@v1
# with:
# path: target
# key: ${{ matrix.os }}-cargo-release-target-${{ hashFiles('**/Cargo.lock') }}
# restore-keys: |
# ${{ matrix.os }}-cargo-release-target-
- name: Build release
run: ./ci/publish-tarball.sh --no-spl
- name: Nightly release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# TAG: nightly
TARGET: ${{ matrix.target }}
EXE_EXT: ${{ matrix.exe_ext }}
# run: env GITHUB_TOKEN=${GITHUB_TOKEN_RUNNER} ./ci/github-check-nightly-release.sh
run: env TAG="nightly-$(date '+%Y-%m-%d')" ./ci/github-check-nightly-release.sh
if: ${{ !startsWith(github.ref, 'refs/tags/') }}
- name: Upload
uses: softprops/action-gh-release@v1
# if: github.event.action == 'published'
if: startsWith(github.ref, 'refs/tags/') # Only for tagged release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
files: |
velas-release-${{ matrix.target }}.tar.bz2
velas-release-${{ matrix.target }}.yml
velas-install-init-${{ matrix.target }}${{matrix.exe_ext}}
- name: Upload bpf
uses: softprops/action-gh-release@v1
# Only for tagged release and linux
if: ${{ startsWith(github.ref, 'refs/tags/') && matrix.os == 'linux' }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
draft: true
files: bpf-sdk.tar.bz2