Skip to content

Adds release action

Adds release action #1

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*'
jobs:
create_release:
name: Create Release
runs-on: ubuntu-latest
outputs:
upload_url: ${{ steps.create_release.outputs.upload_url }}
steps:
- 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:
name: Build and Upload
needs: create_release
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
artifact_name: minos-codex
asset_name: minos-codex-linux-amd64
- os: ubuntu-latest
target: x86_64-pc-windows-gnu
artifact_name: minos-codex.exe
asset_name: minos-codex-windows-amd64.exe
- os: macos-latest
target: x86_64-apple-darwin
artifact_name: minos-codex
asset_name: minos-codex-macos-amd64
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- uses: actions-rs/cargo@v1
with:
use-cross: true
command: build
args: --release --target ${{ matrix.target }}
- 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: ./target/${{ matrix.target }}/release/${{ matrix.artifact_name }}
asset_name: ${{ matrix.asset_name }}
asset_content_type: application/octet-stream