Skip to content

Nightly Build

Nightly Build #456

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 }}