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

release pgo binary #429

Merged
merged 1 commit into from
Mar 16, 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
54 changes: 54 additions & 0 deletions .github/workflows/release-pgo.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: Publish PGO

on:
push:
tags:
- "*.*.*"

jobs:
publish:
name: Publish for ${{ matrix.target }} PGO
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
artifact_name: oha
release_name: oha-linux-amd64-pgo
target: x86_64-unknown-linux-musl
additional_args: "--features vsock"
- os: windows-latest
artifact_name: oha.exe
release_name: oha-windows-amd64-pgo.exe
target: x86_64-pc-windows-msvc
additional_args: ""
- os: macos-latest
artifact_name: oha
release_name: oha-macos-amd64-pgo
target: x86_64-apple-darwin
additional_args: ""
- os: macos-14
artifact_name: oha
release_name: oha-macos-arm64-pgo
target: aarch64-apple-darwin
additional_args: ""

steps:
- uses: actions/checkout@v4
- name: Install musl-tools on Linux
run: sudo apt-get update --yes && sudo apt-get install --yes musl-tools
if: contains(matrix.target, 'musl')
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
components: llvm-tools-preview
- run: cargo install cargo-pgo
- uses: taiki-e/install-action@just
- run: just pgo '--target ${{ matrix.target }} ${{ matrix.additional_args }}'
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v1-release
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/${{ matrix.target }}/pgo/${{ matrix.artifact_name }}
asset_name: ${{ matrix.release_name }}
tag: ${{ github.ref }}
21 changes: 17 additions & 4 deletions justfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,20 @@
pgo:
[unix]
pgo addtional-args="":
#!/bin/bash
trap "kill 0" EXIT
# Disable trap in CI
# `just` returns weired exit code if we use trap
if [ -z $CI]; then trap "kill 0" EXIT; fi
cargo run --release --manifest-path pgo/server/Cargo.toml &
# Should be more than 1m
cargo pgo run -- --profile pgo -- -z 3m -c 900 --no-tui http://localhost:8888
cargo pgo optimize build -- --profile pgo
cargo pgo run -- --profile pgo {{addtional-args}} -- -z 3m -c 900 --no-tui http://localhost:8888
cargo pgo optimize build -- --profile pgo {{addtional-args}}

set windows-powershell := true

[windows]
pgo addtional-args="":
try { \
$proc = Start-Process -NoNewWindow -PassThru cargo -ArgumentList 'run','--release','--manifest-path','pgo/server/Cargo.toml'; \
cargo pgo run -- --profile pgo {{addtional-args}} -- -z 3m -c 900 --no-tui http://localhost:8888; \
cargo pgo optimize build -- --profile pgo {{addtional-args}}; \
} finally { Stop-Process -Id $proc.Id }