Skip to content

Fix #675

Fix #675 #70

Workflow file for this run

name: Publish
on:
push:
branches:
- master
tags:
- "*.*.*"
pull_request:
jobs:
publish:
name: Publish for ${{ matrix.target }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
artifact_name: oha
release_name: oha-linux-amd64
target: x86_64-unknown-linux-musl
additional_args: "--features vsock"
use_cross: false
- os: windows-latest
artifact_name: oha.exe
release_name: oha-windows-amd64.exe
target: x86_64-pc-windows-msvc
additional_args: ""
use_cross: false
- os: macos-latest
artifact_name: oha
release_name: oha-macos-amd64
target: x86_64-apple-darwin
additional_args: ""
use_cross: false
- os: ubuntu-latest
artifact_name: oha
release_name: oha-linux-arm64
target: aarch64-unknown-linux-musl
additional_args: "--features vsock"
use_cross: true
- os: macos-14
artifact_name: oha
release_name: oha-macos-arm64
target: aarch64-apple-darwin
additional_args: ""
use_cross: false
env:
BUILD_CMD: cargo
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
- name: Install Rust toolchain
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}
- name: Install cross
if: matrix.use_cross
uses: taiki-e/install-action@v2
with:
tool: cross
- name: Overwrite build command env variable
if: matrix.use_cross
shell: bash
run: echo "BUILD_CMD=cross" >> $GITHUB_ENV
- name: Build
shell: bash
run: $BUILD_CMD build --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 }}
file: target/${{ matrix.target }}/release-ci/${{ matrix.artifact_name }}
asset_name: ${{ matrix.release_name }}
tag: ${{ github.ref }}