-
Notifications
You must be signed in to change notification settings - Fork 148
92 lines (80 loc) · 2.54 KB
/
build-nightly-release.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
88
89
90
91
92
name: Nightly Build
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * 1-5"
- cron: "0 16 12 * *"
env:
CARGO_TERM_COLOR: always
jobs:
build-core:
name: Build core
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: ./.github/actions/maximize-disk-space
- uses: ./.github/actions/build-core
with:
profile: release
build-pruntime:
name: Build pruntime
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: true
- uses: ./.github/actions/maximize-disk-space
- uses: ./.github/actions/build-pruntime
build-contracts:
name: Build contracts
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
with:
submodules: 'true'
- uses: ./.github/actions/build-contracts
publish:
needs: [build-core, build-pruntime, build-contracts]
name: Pack and publish
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v3
- name: Download artifacts
uses: actions/download-artifact@v3
with:
path: ./dist
- name: Manually tag
run: echo "RELEASE_TAG=manually-$(date +'%Y-%m-%d-%H%M%S')" >> $GITHUB_ENV
- name: Nightly tag
run: echo "RELEASE_TAG=nightly-$(date +'%Y-%m-%d')" >> $GITHUB_ENV
if: github.event.schedule == '0 0 * * 1-5'
- name: Monthly tag
run: echo "RELEASE_TAG=monthly-$(date +'%Y-%m')" >> $GITHUB_ENV
if: github.event.schedule == '0 16 12 * *'
- name: Publish
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
tag_name: ${{ env.RELEASE_TAG }}
prerelease: true
body: Nightly build
files: |
./dist/pruntime-binaries/pruntime
./dist/pruntime-binaries/libpink.so.*
./dist/core-blockchain-binaries/phala-node
./dist/core-blockchain-binaries/pherry
./dist/contract-binaries/system.contract
./dist/contract-binaries/log_server.contract
./dist/contract-binaries/log_server.sidevm.wasm
./dist/contract-binaries/sidevm_deployer.contract
./dist/contract-binaries/tokenomic.contract
- name: Delete older nightly releases
uses: Phala-Network/delete-older-releases@master
with:
keep_latest: 30
delete_tags: true
delete_tag_pattern: nightly
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}