Skip to content

fix release

fix release #3

Workflow file for this run

name: Release
on:
push:
tags:
- "v[0-9]+.*"
jobs:
create-release:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Create Release
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
build-and-upload:
needs: create-release
name: Build and upload for ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
artifact_name: sherlock
asset_name: sherlock-linux
- os: windows-latest
artifact_name: sherlock-windows.exe
asset_name: sherlock-windows.exe
- os: macos-latest
artifact_name: sherlock-macos
asset_name: sherlock-macos
steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Build
run: cargo build --release
- name: Rename binary
run: |
if [ "${{ matrix.os }}" = "windows-latest" ]; then
mv target/release/sherlock.exe ${{ matrix.artifact_name }}
else
mv target/release/sherlock ${{ matrix.artifact_name }}
fi
shell: bash
- name: Upload Release Asset
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ needs.create-release.outputs.upload_url }}
asset_path: ./${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
asset_content_type: application/octet-stream