bumped version to v0.35.1 #123
Workflow file for this run
This file contains hidden or 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: build | |
on: | |
push: | |
tags: | |
- v* | |
jobs: | |
build: | |
name: Build | |
strategy: | |
matrix: | |
build: | |
- platform: macos-x86_64 | |
target: x86_64-apple-darwin | |
os: macos-latest | |
- platform: macos-aarch64 | |
target: aarch64-apple-darwin | |
os: macos-latest | |
- platform: linux-x86_64 | |
target: x86_64-unknown-linux-musl | |
os: ubuntu-latest | |
- platform: windows-x86_64 | |
target: x86_64-pc-windows-msvc | |
os: windows-latest | |
- platform: windows-aarch64 | |
target: aarch64-pc-windows-msvc | |
os: windows-latest | |
runs-on: ${{ matrix.build.os }} | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Install target | |
run: rustup target add ${{ matrix.build.target }} | |
- name: Setup musl | |
run: sudo apt-get install -y musl-tools | |
if: endsWith(matrix.build.target, '-musl') | |
- name: Setup windows | |
run: | | |
# setup perl for bash shell https://github.com/sfackler/rust-openssl/issues/2149#issuecomment-2014064057 | |
echo "PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 | |
echo "OPENSSL_SRC_PERL=$((where.exe perl)[0])" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 | |
if: runner.os == 'Windows' | |
- uses: Swatinem/rust-cache@v2 | |
- name: Build | |
env: | |
TARGET: ${{ matrix.build.target }} | |
shell: bash | |
run: | | |
declare output | |
output="$( | |
cargo build \ | |
--workspace \ | |
--release \ | |
--target "$TARGET" \ | |
--message-format=json \ | |
| jq -r '.message.rendered // .executable // empty' | |
)" | |
{ | |
echo 'ARTIFACT_PATHS<<EOF' | |
echo "$output" | |
echo 'EOF' | |
} >> "$GITHUB_ENV" | |
- name: Upload binary | |
uses: actions/upload-artifact@v4 | |
with: | |
name: ${{ matrix.build.platform }} | |
path: ${{ env.ARTIFACT_PATHS }} | |
if-no-files-found: error | |
release: | |
name: Release | |
needs: build | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Download artifacts | |
uses: actions/download-artifact@v4 | |
with: | |
path: artifacts | |
- name: Create Release | |
env: | |
GITHUB_USER: ${{ github.repository_owner }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
mkdir assets | |
for file in artifacts/*/*; do | |
filename="$(basename "$file")" | |
name="${filename%\.exe}" | |
extension="${filename#"$name"}" | |
platform="$(basename "$(dirname "$file")")" | |
mv "$file" "assets/${name}-${platform}${extension}" | |
chmod +x "assets/${name}-${platform}${extension}" | |
done | |
# create release | |
gh release create \ | |
--title "$GITHUB_REF_NAME" \ | |
--notes '' \ | |
"$GITHUB_REF_NAME" \ | |
"assets/"* |