Skip to content

remove rename binary #21

remove rename binary

remove rename binary #21

Workflow file for this run

name: Build and release binary
on:
push:
branches:
- main
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
REPOSITORY: ${{ github.event.repository.name }}
jobs:
build:
runs-on: '${{ matrix.os }}'
strategy:
matrix:
include:
- os: macos-latest
target: x86_64-apple-darwin
suffix: ''
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
suffix: ''
- os: windows-latest
target: x86_64-pc-windows-msvc
suffix: .exe
steps:
- uses: actions/checkout@master
with:
lfs: true
- id: get_version
run: echo ::set-output "name=VERSION::$(IFS=\=;cat Cargo.toml | grep version | head -n1 | awk {'print $3'})"
shell: bash
- uses: actions/cache@v1
with:
path: ~/.cargo/registry
key: '${{ runner.os }}-${{ matrix.target }}-cargo-registry-${{ hashFiles(''**/Cargo.lock'') }}'
- uses: actions/cache@v1
with:
path: ~/.cargo/git
key: '${{ runner.os }}-${{ matrix.target }}-cargo-index-${{ hashFiles(''**/Cargo.lock'') }}'
- uses: actions/cache@v1
with:
path: target
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
override: true
- uses: actions-rs/cargo@v1
env:
VERSION: '${{ steps.get_version.outputs.VERSION }}'
with:
command: build
args: '--release'
- uses: actions/upload-artifact@v2
with:
name: ${{ env.REPOSITORY }}-${{ matrix.target }}
path: ./target/release/${{ env.REPOSITORY }}${{ matrix.suffix }}
if-no-files-found: error
release:
needs:
- build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
with:
lfs: true
- uses: actions/download-artifact@v3
- name: Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.ACTIONS_TOKEN }}
with:
generate_release_notes: true
draft: true
fail_on_unmatched_files: true
files: |
${{ env.REPOSITORY }}-x86_64-apple-darwin
${{ env.REPOSITORY }}-x86_64-unknown-linux-gnu
${{ env.REPOSITORY }}-x86_64-pc-windows.exe