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 b2f230a
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 2 deletions.
54 changes: 54 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: pop release

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

jobs:
build-node:
runs-on: ubuntu-22.04
strategy:
matrix:
cpu: [ "", "skylake" ]
env:
RUSTFLAGS: "-C target-cpu=${{ matrix.cpu }}"
name: "pop-node${{ matrix.cpu != '' && format('-{0}', matrix.cpu) || '' }}"
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}

- name: Install packages
run: |
sudo apt-get install -y protobuf-compiler
protoc --version
- name: Build node
run: cargo build --profile=production -p pop-node

- name: Save binary
run: |
mkdir -p build
cp target/production/pop-node build/${{ env.name }}
sha256sum target/production/pop-node > build/${{ env.name }}.sha256
- name: Upload binary
uses: actions/upload-artifact@v3
with:
name: binaries
path: build

- name: Add binary to release
if: github.event_name == 'release'
uses: softprops/action-gh-release@v1
with:
files: build
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

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
2 changes: 1 addition & 1 deletion node/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "pop-node"
version = "0.1.0"
version = "0.1.0-alpha"
authors.workspace = true
description.workspace = true
license = "Unlicense"
Expand Down

0 comments on commit b2f230a

Please sign in to comment.