Skip to content

# Initial Commit

# Initial Commit #4

name: Build and Release
on:
push:
tags:
- "v*"
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, windows-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Install Rust
uses: actions-rs/toolchain@v1
with:
toolchain: stable
override: true
- name: Build
uses: actions-rs/cargo@v1
with:
command: build
args: --release
- name: Extract version
id: extract_version
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV
- name: Upload artifact (Linux)
if: matrix.os == 'ubuntu-latest'
uses: actions/upload-artifact@v2
with:
name: mysql-table-exporter-${{ matrix.os }}
path: target/release/mysql-table-exporter
- name: Upload artifact (Windows)
if: matrix.os == 'windows-latest'
uses: actions/upload-artifact@v2
with:
name: mysql-table-exporter-${{ matrix.os }}
path: target/release/mysql-table-exporter.exe
release:
needs: build
runs-on: ubuntu-latest
steps:
- name: Download artifacts (Linux)
uses: actions/download-artifact@v2
with:
name: mysql-table-exporter-ubuntu-latest
path: release
- name: Download artifacts (Windows)
uses: actions/download-artifact@v2
with:
name: mysql-table-exporter-windows-latest
path: release
- name: Create release
uses: "marvinpinto/action-automatic-releases@latest"
with:
repo_token: "${{ secrets.GITHUB_TOKEN }}"
prerelease: false
files: release/*