Skip to content

Commit

Permalink
Merge pull request #673 from hatoo/test-build
Browse files Browse the repository at this point in the history
Test build on CI
  • Loading branch information
hatoo authored Jan 20, 2025
2 parents dc0558d + 4cc0d1b commit 853de7a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 10 deletions.
30 changes: 20 additions & 10 deletions .github/workflows/release-pgo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ name: Publish PGO

on:
push:
branches:
- master
tags:
- "*.*.*"
pull_request:

jobs:
publish:
Expand All @@ -22,32 +25,39 @@ jobs:
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: ""
# - 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: ilammy/setup-nasm@v1
- 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: Swatinem/rust-cache@v2
- uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
components: llvm-tools-preview
- run: cargo install cargo-pgo --version 0.2.8
- uses: oven-sh/setup-bun@v2
- run: bun run pgo.js --target ${{ matrix.target }} ${{ matrix.additional_args }}
- name: Upload
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.release_name }}
path: target/${{ matrix.target }}/pgo/${{ matrix.artifact_name }}
- name: Upload binaries to release
uses: svenstaro/upload-release-action@v2
if: startsWith(github.ref, 'refs/tags/v')
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: target/${{ matrix.target }}/pgo/${{ matrix.artifact_name }}
Expand Down
10 changes: 10 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,11 @@ name: Publish

on:
push:
branches:
- master
tags:
- "*.*.*"
pull_request:

jobs:
publish:
Expand Down Expand Up @@ -44,13 +47,20 @@ jobs:
- 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: Swatinem/rust-cache@v2
- name: Build binary
uses: houseabsolute/actions-rust-cross@v1
with:
command: build
target: ${{ matrix.target }}
args: --profile release-ci --target ${{ matrix.target }} --locked --no-default-features --features rustls ${{ matrix.additional_args }}
- name: Upload
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.release_name }}
path: target/${{ matrix.target }}/release-ci/${{ matrix.artifact_name }}
- name: Upload binaries to release
if: startsWith(github.ref, 'refs/tags/v')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
Expand Down

0 comments on commit 853de7a

Please sign in to comment.