Skip to content

Rust Build and Release #13

Rust Build and Release

Rust Build and Release #13

Workflow file for this run

name: Rust Build and Release
on:
push:
paths:
- '**/*.rs'
- 'Cargo.toml'
workflow_dispatch:
jobs:
build:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-pc-windows-msvc
os: windows-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Build & Rename
shell: bash
run: |

Check failure on line 25 in .github/workflows/build.yaml

View workflow run for this annotation

GitHub Actions / Rust Build and Release

Invalid workflow file

The workflow is not valid. .github/workflows/build.yaml (Line: 25, Col: 14): Unrecognized named-value: 'echo'. Located at position 34 within expression: matrix.os == 'windows-latest' && echo '.exe' || echo ''
cargo build --profile opt --target ${{ matrix.target }}
mkdir -p build
EXECUTABLE=$(find target -maxdepth 2 -type f -executable | head -n 1)
cp "$EXECUTABLE" "build/peerban-${{ matrix.target }}${{ matrix.os == 'windows-latest' && echo '.exe' || echo '' }}"
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.target }}
path: build/*
release:
needs: build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/download-artifact@v4
with:
path: release_binaries
- name: Get version
run: |
echo "VERSION=$(cargo pkgid | cut -d# -f2 | cut -d: -f2)" > $GITHUB_ENV
- name: Create Release
uses: softprops/action-gh-release@v2
with:
files: release_binaries/**
tag_name: ${{ env.VERSION }}
draft: false
prerelease: false
token: ${{ secrets.GITHUB_TOKEN }}