Build #6
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: Dispatch Build | |
env: | |
PROJECT_NAME: code2prompt | |
PROJECT_DESC: "A command-line tool to generate an LLM prompt from codebases of any size, fast." | |
PROJECT_AUTH: "mufeedvh" | |
on: | |
workflow_dispatch: | |
jobs: | |
build: | |
name: Build | |
runs-on: ${{ matrix.job.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
job: | |
- { os: ubuntu-latest , target: arm-unknown-linux-gnueabihf , use-cross: use-cross } | |
- { os: ubuntu-latest , target: aarch64-unknown-linux-gnu , use-cross: use-cross } | |
- { os: ubuntu-latest , target: i686-unknown-linux-gnu , use-cross: use-cross } | |
- { os: ubuntu-latest , target: i686-unknown-linux-musl , use-cross: use-cross } | |
- { os: ubuntu-latest , target: x86_64-unknown-linux-gnu , use-cross: use-cross } | |
- { os: ubuntu-latest , target: x86_64-unknown-linux-musl , use-cross: use-cross } | |
- { os: macos-latest , target: x86_64-apple-darwin } | |
- { os: macos-latest , target: aarch64-apple-darwin } | |
- { os: windows-latest , target: i686-pc-windows-gnu } | |
- { os: windows-latest , target: i686-pc-windows-msvc } | |
- { os: windows-latest , target: x86_64-pc-windows-gnu } | |
- { os: windows-latest , target: x86_64-pc-windows-msvc } | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Install Rust toolchain | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
target: ${{ matrix.job.target }} | |
override: true | |
default: true | |
- name: Install musl tools (Linux) | |
if: contains(matrix.job.target, 'musl') | |
run: sudo apt-get update && sudo apt-get install -y musl-tools | |
- name: Install MinGW toolchain (Windows) | |
if: contains(matrix.job.target, 'windows-gnu') | |
uses: egor-tensin/setup-mingw@v2 | |
with: | |
platform: ${{ matrix.job.target }} | |
- name: Build release binary | |
uses: actions-rs/cargo@v1 | |
with: | |
use-cross: ${{ matrix.job.use-cross }} | |
command: build | |
args: --release --target ${{ matrix.job.target }} --verbose | |
env: | |
OPENSSL_DIR: /usr/local/opt/openssl | |
PKG_CONFIG_ALLOW_CROSS: 1 | |
- name: Strip release binary (Unix) | |
if: matrix.job.target != 'x86_64-pc-windows-msvc' | |
run: strip "target/${{ matrix.job.target }}/release/code2prompt" |