Skip to content

wip

wip #27

Workflow file for this run

name: Release
on:
push:
tags:
- "v*"
pull_request:
branches: [main]
jobs:
build:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
os: ubuntu-24.04-arm
- target: x86_64-pc-windows-gnu
os: windows-latest
extension: .exe
- target: x86_64-apple-darwin
os: macos-latest
- target: aarch64-apple-darwin
os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
targets: ${{ matrix.target }}
- run: cargo build --release --target=${{ matrix.target }}
- uses: actions/upload-artifact@v4
with:
name: build-${{ matrix.target }}
path: target/${{ matrix.target }}/release/split-test${{ matrix.extension }}
test-artifact:
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: aarch64-unknown-linux-gnu
os: ubuntu-24.04-arm
- target: x86_64-pc-windows-gnu
os: windows-latest
extension: .exe
- target: x86_64-apple-darwin
os: macos-latest
- target: aarch64-apple-darwin
os: macos-latest
runs-on: ${{ matrix.os }}
needs: [build]
steps:
- uses: actions/download-artifact@v4
with:
name: build-${{ matrix.target }}
- run: chmod +x ./split-test${{ matrix.extension }}
- run: ./split-test${{ matrix.extension }} --help
create-release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
needs: [test-artifact]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
path: build
pattern: build-*
- run: |
for dir in build/*; do
if [ -f $dir/split-test.exe ]; then
mv $dir/split-test.exe split-test-${dir##build/build-}.exe
else
mv $dir/split-test split-test-${dir##build/build-}
fi
done
ls -la .
tree .
# - uses: softprops/action-gh-release@v2
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# name: Release ${{ github.ref }}
# draft: false
# prerelease: false
# files: |