Skip to content

Release 0.1.7

Release 0.1.7 #11

Workflow file for this run

name: Build and Release
on:
push:
tags:
- '*'
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# os: [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-latest, macos-latest]
steps:
- name: Checkout repository
uses: actions/checkout@v3
- name: Set up Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Build release
run: |
mkdir -p build
if [ ${{ matrix.os }} == 'windows-latest' ]; then
rustup target add x86_64-pc-windows-gnu
cargo install cross
cross build --target x86_64-pc-windows-gnu --release;
cp target/x86_64-pc-windows-gnu/release/marmite.exe ./build/
elif [ ${{ matrix.os }} == 'ubuntu-latest' ]; then
rustup target add x86_64-unknown-linux-gnu
cargo install cross
cross build --target x86_64-unknown-linux-gnu --release;
cp target/x86_64-unknown-linux-gnu/release/marmite ./build/
elif [ ${{ matrix.os }} == 'macos-latest' ]; then
rustup target add x86_64-apple-darwin
cargo install cross
cross build --target x86_64-apple-darwin --release;
cp target/x86_64-apple-darwin/release/marmite ./build/
fi
shell: bash
- name: Upload binary as artifact
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}-binary
path: ./build/marmite*
release:
needs: build
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: Checkout repository
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
- name: Upload Linux binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ubuntu-latest-binary
asset_name: linux_binary
asset_content_type: application/octet-stream
- name: Upload macOS binary
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: macos-latest-binary
asset_name: macos_binary
asset_content_type: application/octet-stream
# - name: Upload Windows binary
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ steps.create_release.outputs.upload_url }}
# asset_path: windows-latest-binary
# asset_name: windows_binary
# asset_content_type: application/octet-stream