Release #33
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: Release | |
on: | |
workflow_dispatch: | |
inputs: | |
tag: | |
description: Tag for release | |
required: true | |
jobs: | |
build-binary: | |
name: Build Binary | |
runs-on: self-hosted | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.inputs.tag }} | |
- name: Setup Rust | |
run: rustup show | |
- name: Build | |
run: | | |
cargo build --locked --release --features turing-node,oak-node | |
mkdir -p artifacts/ | |
cp target/release/oak-collator artifacts/ | |
- name: Build debian | |
run: | | |
cargo install cargo-deb | |
cargo deb -p oak-node -- --release --features turing-node,oak-node | |
cp target/debian/*.deb artifacts/ | |
- name: Upload binary | |
uses: actions/upload-artifact@v2 | |
with: | |
name: oak-collator | |
path: artifacts/ | |
build-runtime: | |
name: Build Runtime | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
chain: ["turing", "oak"] | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.inputs.tag }} | |
- name: Build | |
id: srtool_build | |
uses: chevdor/[email protected] | |
with: | |
chain: ${{ matrix.chain }} | |
tag: 1.66.1 | |
- name: Summary | |
run: | | |
echo '${{ steps.srtool_build.outputs.json }}' | jq . > ${{ matrix.chain }}-srtool-digest.json | |
cat ${{ matrix.chain }}-srtool-digest.json | |
cp ${{ steps.srtool_build.outputs.wasm_compressed }} ${{ matrix.chain }}-runtime.wasm | |
- name: Upload runtime | |
uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ matrix.chain }}-runtime | |
path: | | |
${{ matrix.chain }}-runtime.wasm | |
${{ matrix.chain }}-srtool-digest.json | |
release: | |
name: Release | |
runs-on: ubuntu-latest | |
needs: | |
- build-binary | |
- build-runtime | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v2 | |
with: | |
ref: ${{ github.event.inputs.tag }} | |
fetch-depth: 0 | |
- name: Download binary | |
uses: actions/download-artifact@v2 | |
with: | |
name: oak-collator | |
- name: Get debian package name | |
id: package | |
run: | | |
echo ::set-output name=name::$(ls -a *.deb | head -n 1) | |
- name: Download Turing runtime | |
uses: actions/download-artifact@v2 | |
with: | |
name: turing-runtime | |
- name: Download OAK runtime | |
uses: actions/download-artifact@v2 | |
with: | |
name: oak-runtime | |
- name: Generate notes | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
./.maintain/generate-release-notes ${{ github.event.inputs.tag }} > notes.md | |
- name: Create release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.event.inputs.tag }} | |
release_name: ${{ github.event.inputs.tag }} | |
body_path: notes.md | |
draft: true | |
- name: Upload binary | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: oak-collator | |
asset_name: oak-collator | |
asset_content_type: application/octet-stream | |
- name: Upload deb | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ${{ steps.package.outputs.name }} | |
asset_name: oak-collator.deb | |
asset_content_type: application/octet-stream | |
- name: Upload Turing runtime | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: turing-runtime.wasm | |
asset_name: turing-runtime.wasm | |
asset_content_type: application/octet-stream | |
- name: Upload Turing runtime digest | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: turing-srtool-digest.json | |
asset_name: turing-srtool-digest.json | |
asset_content_type: application/octet-stream | |
- name: Upload OAK runtime | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: oak-runtime.wasm | |
asset_name: oak-runtime.wasm | |
asset_content_type: application/octet-stream | |
- name: Upload OAK runtime digest | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: oak-srtool-digest.json | |
asset_name: oak-srtool-digest.json | |
asset_content_type: application/octet-stream |