-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
release: create a release for pop-cli (#119)
* create release * add a production profile * build: enable vendored-openssl via feature to ease cross compilation (#122) --------- Co-authored-by: Frank Bell <[email protected]>
- Loading branch information
1 parent
15ce5fc
commit dbcf6ba
Showing
4 changed files
with
108 additions
and
3 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
name: pop-cli release | ||
|
||
on: | ||
release: | ||
types: [ published ] | ||
workflow_dispatch: | ||
inputs: | ||
ref: | ||
description: ref to build binary from | ||
required: false | ||
|
||
jobs: | ||
build-node: | ||
runs-on: ${{ matrix.platform.os }} | ||
permissions: | ||
contents: write | ||
strategy: | ||
matrix: | ||
platform: | ||
# Linux | ||
- os: ubuntu-22.04 | ||
target: aarch64-unknown-linux-gnu | ||
- os: ubuntu-22.04 | ||
target: x86_64-unknown-linux-gnu | ||
# macOS | ||
- os: macos-14 | ||
target: aarch64-apple-darwin | ||
- os: macos-14 | ||
target: x86_64-apple-darwin | ||
env: | ||
RUSTFLAGS: "${{ matrix.platform.cpu != '' && format('-C target-cpu={0}', matrix.platform.cpu) || '' }} ${{ matrix.platform.target == 'aarch64-unknown-linux-gnu' && '-C linker=aarch64-linux-gnu-gcc' || '' }}" | ||
path: "target/${{ matrix.platform.target }}/production" | ||
package: "pop-${{ matrix.platform.target }}${{ matrix.platform.cpu != '' && format('-{0}', matrix.platform.cpu) || '' }}.tar.gz" | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
ref: ${{ github.event.inputs.ref }} | ||
|
||
- name: Install packages (Linux) | ||
if: contains(matrix.platform.target, 'linux') | ||
run: | | ||
sudo apt-get install -y protobuf-compiler ${{ contains(matrix.platform.target, 'aarch64') && 'crossbuild-essential-arm64' || '' }} | ||
protoc --version | ||
- name: Install packages (macOS) | ||
if: contains(matrix.platform.target, 'apple') | ||
run: | | ||
brew install protobuf | ||
protoc --version | ||
- name: Add target | ||
run: rustup target add ${{ matrix.platform.target }} | ||
|
||
- name: Build pop-cli | ||
run: cargo build --profile=production -p pop-cli --target ${{ matrix.platform.target }} --features static-ssl | ||
|
||
- name: Package binary (Linux) | ||
if: contains(matrix.platform.target, 'linux') | ||
run: | | ||
cd ${{ env.path }} | ||
sha256sum pop > pop.sha256 | ||
tar -czf ${{ env.package }} pop pop.sha256 | ||
- name: Package binary (macOS) | ||
if: contains(matrix.platform.target, 'apple') | ||
run: | | ||
cd ${{ env.path }} | ||
shasum -a 256 pop > pop.sha256 | ||
tar -czf ${{ env.package }} pop pop.sha256 | ||
- name: Upload binary | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: binaries | ||
path: ${{ env.path }}/${{ env.package }} | ||
|
||
- name: Add binary to release | ||
if: github.event_name == 'release' | ||
uses: softprops/action-gh-release@v1 | ||
with: | ||
files: | | ||
${{ env.path }}/${{ env.package }} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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