Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: add release workflow #58

Merged
merged 5 commits into from
Mar 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: pop release

on:
release:
types: [ published ]
workflow_dispatch:
inputs:
ref:
description: ref to build binary from
required: false

jobs:
build-node:
runs-on: ubuntu-22.04
permissions:
contents: write
strategy:
matrix:
cpu: [ "", "skylake" ]
peterwht marked this conversation as resolved.
Show resolved Hide resolved
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 build/${{ env.name }} > 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/${{ env.name }}
build/${{ env.name }}.sha256
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
Loading