build: add release workflow #1
Workflow file for this run
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: 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) || '' }} |