chore: cargo fmt #830
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
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/[email protected]" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "${{ github.ref_name }}" | |
title: "pyroscope-${{ github.ref_name }}" | |
draft: true | |
prerelease: false | |
clibuilder-release: | |
name: clibuilder-release | |
runs-on: ubuntu-latest | |
if: "startsWith(github.ref, 'refs/tags/clibuilder-')" | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: docker/login-action@v2 | |
name: Login to Docker Hub | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- run: docker buildx create --use | |
- run: make -C docker push_cli_builder | |
manylinux-release: | |
name: manylinux-release | |
runs-on: ubuntu-latest | |
if: "startsWith(github.ref, 'refs/tags/manylinux-')" | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: docker/login-action@v2 | |
name: Login to Docker Hub | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- run: docker buildx create --use | |
- run: make -C docker push_aarch64 push_x86_64 | |
cli-release: | |
name: pyroscope-cli | |
runs-on: ubuntu-latest | |
if: "startsWith(github.ref, 'refs/tags/cli-')" | |
outputs: | |
upload_url: ${{ steps.auto-release.outputs.upload_url }} | |
steps: | |
- id: auto-release | |
uses: "marvinpinto/[email protected]" | |
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: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: docker/login-action@v2 | |
name: Login to Docker Hub | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_PASSWORD }} | |
- run: DOCKER_EXTRA="--push" make cli/docker-image | |
- run: DOCKER_EXTRA="--output=." make cli/docker-image | |
- name: Upload release archive | |
uses: actions/[email protected] | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.cli-release.outputs.upload_url }} | |
asset_path: "./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/[email protected]" | |
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/[email protected]" | |
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/[email protected]" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "${{ github.ref_name }}" | |
title: "Backend: ${{ github.ref_name }}" | |
draft: true | |
prerelease: false | |
python-release-linux: | |
needs: ['python-release'] | |
strategy: | |
fail-fast: false | |
matrix: | |
build-arch: | |
- manylinux2014_x86_64 | |
name: Linux - ${{ matrix.build-arch }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: AutoModality/action-clean@v1 | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Build in Docker | |
run: pyroscope_ffi/python/scripts/docker.sh | |
env: | |
BUILD_ARCH: ${{ matrix.build-arch }} | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ github.sha }} | |
path: pyroscope_ffi/python/dist/* | |
- name: Upload release artifact | |
uses: shogo82148/actions-upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.python-release.outputs.upload_url }} | |
asset_path: "pyroscope_ffi/python/dist/pyroscope*.whl" | |
python-release-linux-arm: | |
needs: ['python-release'] | |
strategy: | |
fail-fast: false | |
matrix: | |
build-arch: | |
- manylinux2014_aarch64 | |
name: Linux - ${{ matrix.build-arch }} | |
runs-on: [self-hosted, Linux, ARM64] | |
steps: | |
- uses: AutoModality/action-clean@v1 | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: Build in Docker | |
run: pyroscope_ffi/python/scripts/docker.sh | |
env: | |
BUILD_ARCH: ${{ matrix.build-arch }} | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ github.sha }} | |
path: pyroscope_ffi/python/dist/* | |
- name: Upload release artifact | |
uses: shogo82148/actions-upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.python-release.outputs.upload_url }} | |
asset_path: "pyroscope_ffi/python/dist/pyroscope*.whl" | |
python-release-macos: | |
needs: ['python-release'] | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- macos-version: "11.0" | |
target: x86_64-apple-darwin | |
py-platform: macosx-11_0_x86_64 | |
- macos-version: "11.0" | |
target: aarch64-apple-darwin | |
py-platform: macosx-11_0_arm64 | |
name: macOS - ${{ matrix.py-platform }} | |
runs-on: macos-${{ matrix.macos-version }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: ${{ matrix.target }} | |
profile: minimal | |
override: true | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Build Wheel | |
run: | | |
pip install wheel | |
python setup.py bdist_wheel -p ${{ matrix.py-platform }} | |
working-directory: pyroscope_ffi/python | |
env: | |
CARGO_BUILD_TARGET: ${{ matrix.target }} | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ github.sha }} | |
path: pyroscope_ffi/python/dist/* | |
- name: Upload release artifact | |
uses: shogo82148/actions-upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.python-release.outputs.upload_url }} | |
asset_path: "pyroscope_ffi/python/dist/pyroscope*.whl" | |
python-release-sdist: | |
needs: ['python-release'] | |
name: sdist | |
runs-on: ubuntu-latest | |
steps: | |
- uses: AutoModality/action-clean@v1 | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Upgrade pip | |
run: | | |
python -m pip install --upgrade pip pipenv wheel | |
- name: Build sdist | |
run: python setup.py sdist | |
working-directory: pyroscope_ffi/python | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ github.sha }} | |
path: pyroscope_ffi/python/dist/* | |
- name: Upload release artifact | |
uses: shogo82148/actions-upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.python-release.outputs.upload_url }} | |
asset_path: "pyroscope_ffi/python/dist/pyroscope-io-*.tar.gz" | |
python-release: | |
name: Python Package | |
runs-on: ubuntu-latest | |
if: "startsWith(github.ref, 'refs/tags/python-')" | |
continue-on-error: true | |
outputs: | |
upload_url: ${{ steps.auto-release.outputs.upload_url }} | |
steps: | |
- id: auto-release | |
uses: "marvinpinto/[email protected]" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "${{ github.ref_name }}" | |
title: "Python Package: ${{ github.ref_name }}" | |
draft: true | |
prerelease: false | |
ruby-release-linux: | |
needs: ['ruby-release'] | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- build-arch: x86_64 | |
target: x86_64-unknown-linux-gnu | |
name: Linux - ${{ matrix.build-arch }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: AutoModality/action-clean@v1 | |
- run: id | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.1' | |
- name: Install bundles | |
run: bundle | |
working-directory: pyroscope_ffi/ruby | |
- name: Generate extra libraries | |
run: BUILD_ARCH=manylinux2014_x86_64 ./pyroscope_ffi/ruby/scripts/docker.sh | |
- name: Copy generated extra libraries | |
run: mkdir -p lib/thread_id && cp ext/thread_id/target/release/libthread_id.so lib/thread_id/thread_id.so | |
working-directory: pyroscope_ffi/ruby | |
- name: Copy generated extra libraries | |
run: mkdir -p lib/rbspy && cp ./elflib/rbspy/wheelhouse/rbspy-1.0.0/rbspy/_native__lib.cpython-37m-x86_64-linux-gnu.so lib/rbspy/rbspy.so | |
working-directory: pyroscope_ffi/ruby | |
- name: Copy generated extra libraries | |
run: cp -r ./elflib/rbspy/wheelhouse/rbspy-1.0.0/rbspy.libs lib/rbspy.libs | |
working-directory: pyroscope_ffi/ruby | |
- name: Build linux gem | |
run: rake x86_64_linux:gem | |
working-directory: pyroscope_ffi/ruby | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ github.sha }} | |
path: pyroscope_ffi/ruby/pkg/*.gem | |
- name: Upload release artifact | |
uses: shogo82148/actions-upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.ruby-release.outputs.upload_url }} | |
asset_path: "pyroscope_ffi/ruby/pkg/*.gem" | |
ruby-release-linux-arm: | |
needs: ['ruby-release'] | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- build-arch: aarch64 | |
target: arm-unknown-linux-gnueabihf | |
name: Linux - ${{ matrix.build-arch }} | |
runs-on: [self-hosted, Linux, ARM64] | |
steps: | |
- name: rm -rf * - custom script instead of AutoModality/action-clean@v1 to run as sudo to remove root owned directories created by docker.sh | |
run: bash -c "set -e ; shopt -s dotglob; sudo rm -rf *" | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- name: asdf clone | |
run: ~/.asdf/bin/asdf || git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.11.1 ; | |
- name: asdf install | |
run: echo $HOME/.asdf/bin >> $GITHUB_PATH ; echo $HOME/.asdf/shims >> $GITHUB_PATH | |
- name: asdf install .tools-versions | |
run: asdf install | |
- name: Install bundles | |
run: bundle | |
working-directory: pyroscope_ffi/ruby | |
- name: Generate extra libraries | |
run: BUILD_ARCH=manylinux2014_aarch64 ./pyroscope_ffi/ruby/scripts/docker.sh | |
- name: Copy generated extra libraries | |
run: mkdir -p lib/thread_id && cp ext/thread_id/target/release/libthread_id.so lib/thread_id/thread_id.so | |
working-directory: pyroscope_ffi/ruby | |
- name: Copy generated extra libraries | |
run: mkdir -p lib/rbspy && cp ./elflib/rbspy/wheelhouse/rbspy-1.0.0/rbspy/_native__lib.cpython-37m-aarch64-linux-gnu.so lib/rbspy/rbspy.so | |
working-directory: pyroscope_ffi/ruby | |
- name: Copy generated extra libraries | |
run: cp -r ./elflib/rbspy/wheelhouse/rbspy-1.0.0/rbspy.libs lib/rbspy.libs | |
working-directory: pyroscope_ffi/ruby | |
- name: Build linux gem | |
run: rake aarch64_linux:gem | |
working-directory: pyroscope_ffi/ruby | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ github.sha }} | |
path: pyroscope_ffi/ruby/pkg/*.gem | |
- name: Upload release artifact | |
uses: shogo82148/actions-upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.ruby-release.outputs.upload_url }} | |
asset_path: "pyroscope_ffi/ruby/pkg/*.gem" | |
ruby-release-macos: | |
needs: ['ruby-release'] | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- macos-version: "11.0" | |
target: x86_64-apple-darwin | |
py-platform: macosx-11_0_x86_64 | |
- macos-version: "11.0" | |
target: aarch64-apple-darwin | |
py-platform: macosx-11_0_arm64 | |
name: macOS - ${{ matrix.platform }} | |
runs-on: macos-${{ matrix.macos-version }} | |
env: | |
RUST_TARGET: ${{ matrix.target }} | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: ${{ matrix.target }} | |
profile: minimal | |
override: true | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.1' | |
- name: Install bundles | |
run: bundle | |
working-directory: pyroscope_ffi/ruby | |
- name: Update lock files | |
run: cargo update | |
working-directory: pyroscope_ffi/ruby/ext/rbspy | |
- name: Update lock files | |
run: cargo update | |
working-directory: pyroscope_ffi/ruby/ext/thread_id | |
- name: Build native extensions | |
run: rake rbspy_install | |
working-directory: pyroscope_ffi/ruby | |
- name: Build native extensions | |
run: rake thread_id_install | |
working-directory: pyroscope_ffi/ruby | |
- if: matrix.target == 'x86_64-apple-darwin' | |
name: Build macos gem | |
run: rake x86_64_darwin:gem | |
working-directory: pyroscope_ffi/ruby | |
- if: matrix.target == 'aarch64-apple-darwin' | |
name: Build macos gem | |
run: rake arm64_darwin:gem | |
working-directory: pyroscope_ffi/ruby | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ github.sha }} | |
path: pyroscope_ffi/ruby/pkg/*.gem | |
- name: Upload release artifact | |
uses: shogo82148/actions-upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.ruby-release.outputs.upload_url }} | |
asset_path: "pyroscope_ffi/ruby/pkg/*.gem" | |
ruby-release-source: | |
needs: ['ruby-release'] | |
name: source | |
runs-on: ubuntu-latest | |
steps: | |
- uses: AutoModality/action-clean@v1 | |
- uses: actions/checkout@v3 | |
with: | |
submodules: recursive | |
- uses: ruby/setup-ruby@v1 | |
with: | |
ruby-version: '3.1' | |
- name: Install bundles | |
run: bundle | |
working-directory: pyroscope_ffi/ruby | |
- name: Build source gem | |
run: rake source:gem | |
working-directory: pyroscope_ffi/ruby | |
- uses: actions/upload-artifact@v2 | |
with: | |
name: ${{ github.sha }} | |
path: pyroscope_ffi/ruby/pkg/*.gem | |
- name: Upload release artifact | |
uses: shogo82148/actions-upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ needs.ruby-release.outputs.upload_url }} | |
asset_path: "pyroscope_ffi/ruby/pkg/*.gem" | |
ruby-release: | |
name: Ruby Gem | |
runs-on: ubuntu-latest | |
if: "startsWith(github.ref, 'refs/tags/ruby-')" | |
continue-on-error: true | |
outputs: | |
upload_url: ${{ steps.auto-release.outputs.upload_url }} | |
steps: | |
- id: auto-release | |
uses: "marvinpinto/[email protected]" | |
with: | |
repo_token: "${{ secrets.GITHUB_TOKEN }}" | |
automatic_release_tag: "${{ github.ref_name }}" | |
title: "Ruby Gem: ${{ github.ref_name }}" | |
draft: true | |
prerelease: false |