diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..1eb44d24 --- /dev/null +++ b/.github/workflows/release.yml @@ -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) || '' }} \ No newline at end of file diff --git a/Cargo.toml b/Cargo.toml index 70257b37..31f1d3b0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,11 @@ [profile.release] panic = "unwind" +[profile.production] +inherits = "release" +lto = true +codegen-units = 1 + [workspace.package] authors = ["R0GUE "] edition = "2021"