Skip to content

Bump actions

Bump actions #21

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: x86_64-pc-windows-gnu
os: windows-latest
extension: .exe
- target: x86_64-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: x86_64-pc-windows-gnu
os: windows-latest
extension: .exe
- target: x86_64-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:
- id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false
- run: |
echo '${{ steps.create-release.outputs.upload_url }}' > release_upload_url.txt
- uses: actions/upload-artifact@v4
with:
name: create-release
path: release_upload_url.txt
upload-release:
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')
strategy:
matrix:
target:
- x86_64-unknown-linux-gnu
- x86_64-apple-darwin
include:
- target: x86_64-pc-windows-gnu
extension: .exe
needs: [create-release]
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v4
with:
name: create-release
- id: upload-url
run: |
echo "url=$(cat create-release/release_upload_url.txt)" >> $GITHUB_OUTPUT
- uses: actions/download-artifact@v4
with:
name: build-${{ matrix.target }}
- run: find .
- uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.upload-url.outputs.url }}
asset_path: build-${{ matrix.target }}/split-test${{ matrix.extension }}
asset_name: split-test-${{ matrix.target }}${{ matrix.extension }}
asset_content_type: application/octet-stream