Skip to content

Commit

Permalink
build: add release workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
evilrobot-01 committed Mar 28, 2024
1 parent 6f3a0a8 commit 957c5a4
Show file tree
Hide file tree
Showing 2 changed files with 61 additions and 0 deletions.
56 changes: 56 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: Build Release

on:
release:
types: [ published ]
workflow_dispatch:
inputs:
ref:
description: ref to build binary from
required: false
push:
branches:
- 'frank/build-release'

jobs:
build-binary:
runs-on: ubuntu-22.04
strategy:
matrix:
cpu: [ "", "skylake" ]
env:
RUSTFLAGS: "-C target-cpu=${{ matrix.cpu }}"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}

- name: Install protoc
run: |
sudo apt-get install -y protobuf-compiler
protoc --version
- name: Setup Rust toolchain
run: rustup show

- name: Build Node
run: cargo build --profile=production --all

- name: Save parachain binary
run: |
mkdir -p build
cp target/production/pop-node build/pop-node${{ matrix.cpu != '' && format('-{0}', matrix.cpu) || '' }}
- name: Upload binary
uses: actions/upload-artifact@v4
with:
name: binaries
path: build

- name: Add artifacts to release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v1
with:
files: |
build/pop-node${{ matrix.cpu != '' && format('-{0}', matrix.cpu) || '' }}
5 changes: 5 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
[profile.release]
panic = "unwind"

[profile.production]
inherits = "release"
lto = true
codegen-units = 1

[workspace.package]
authors = ["R0GUE <go@r0gue.io>"]
edition = "2021"
Expand Down

0 comments on commit 957c5a4

Please sign in to comment.