name: Pre-Release
on: [push]
jobs:
lib-release:
name: pyroscope-main
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/lib-')"
continue-on-error: true
steps:
- uses: "marvinpinto/action-automatic-releases@v1.1.1"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ github.ref_name }}"
title: "pyroscope-${{ github.ref_name }}"
draft: true
prerelease: false
cli-release:
name: pyroscope-cli
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/cli-')"
steps:
- uses: "marvinpinto/action-automatic-releases@v1.1.1"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ github.ref_name }}"
title: "pyroscope-${{ github.ref_name }}"
draft: true
prerelease: false
cli-artifacts:
name: pyroscope-cli - build aritifacts
needs: ['cli-release']
runs-on: ${{ matrix.os }}
env:
CARGO: cargo
TARGET_FLAGS: ""
TARGET_DIR: ./target
RUST_BACKTRACE: 1
strategy:
matrix:
build: [linux, linux-arm, macos]
include:
- build: linux
os: ubuntu-18.04
rust: stable
target: x86_64-unknown-linux-musl
- build: linux-arm
os: ubuntu-18.04
rust: stable
target: arm-unknown-linux-gnueabihf
- build: macos
os: macos-latest
rust: stable
target: x86_64-apple-darwin
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: Install packages (Ubuntu)
if: matrix.os == 'ubuntu-18.04'
run: |
ci/ubuntu-install-packages
- name: Install packages (macOS)
if: matrix.os == 'macos-latest'
run: |
ci/macos-install-packages
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: ${{ matrix.rust }}
profile: minimal
override: true
target: ${{ matrix.target }}
- name: Use Cross
shell: bash
run: |
cargo install cross
echo "CARGO=cross" >> $GITHUB_ENV
echo "TARGET_FLAGS=--target ${{ matrix.target }}" >> $GITHUB_ENV
echo "TARGET_DIR=./target/${{ matrix.target }}" >> $GITHUB_ENV
- name: Show command used for Cargo
run: |
echo "cargo command is: ${{ env.CARGO }}"
echo "target flag is: ${{ env.TARGET_FLAGS }}"
echo "target dir is: ${{ env.TARGET_DIR }}"
- name: Build release binary
run: ${{ env.CARGO }} build --manifest-path pyroscope_cli/Cargo.toml --verbose --release ${{ env.TARGET_FLAGS }}
- name: Strip release binary (linux and macos)
if: matrix.build == 'linux' || matrix.build == 'macos'
run: strip "pyroscope_cli/target/${{ matrix.target }}/release/pyroscope-cli"
- name: Strip release binary (arm)
if: matrix.build == 'linux-arm'
run: |
docker run --rm -v \
"$PWD/target:/target:Z" \
rustembedded/cross:arm-unknown-linux-gnueabihf \
arm-linux-gnueabihf-strip \
/target/arm-unknown-linux-gnueabihf/release/pyroscope-cli
- name: Upload release archive
uses: actions/upload-release-asset@v1.0.1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: "pyroscope_cli/target/${{ matrix.target }}/release/pyroscope-cli"
asset_name: "pyroscope-cli"
asset_content_type: application/octet-stream
pprofrs-release:
name: pyroscope-pprofrs
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/pprofrs-')"
continue-on-error: true
steps:
- uses: "marvinpinto/action-automatic-releases@v1.1.1"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ github.ref_name }}"
title: "Backend: ${{ github.ref_name }}"
draft: true
prerelease: false
rbspy-release:
name: pyroscope-rbspy
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/rbspy-')"
continue-on-error: true
steps:
- uses: "marvinpinto/action-automatic-releases@v1.1.1"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ github.ref_name }}"
title: "Backend: ${{ github.ref_name }}"
draft: true
prerelease: false
pyspy-release:
name: pyroscope-pyspy
runs-on: ubuntu-latest
if: "startsWith(github.ref, 'refs/tags/pyspy-')"
continue-on-error: true
steps:
- uses: "marvinpinto/action-automatic-releases@v1.1.1"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
automatic_release_tag: "${{ github.ref_name }}"
title: "Backend: ${{ github.ref_name }}"
draft: true
prerelease: false