Skip to content

CI: Add Release Job #13

CI: Add Release Job

CI: Add Release Job #13

Workflow file for this run

name: Rust Binary Release
on:
push:
jobs:
build:
name: Build Rust Binary Releases
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
target: x86_64-unknown-linux-gnu
- os: windows-latest
target: x86_64-pc-windows-msvc
- os: macos-latest
target: x86_64-apple-darwin
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
toolchain: stable
target: ${{ matrix.target }}
override: true
- name: Build
run: cargo build --release --target ${{ matrix.target }}
- name: Package Artifacts
run: |
mkdir artifacts
cp target/${{ matrix.target }}/release/${{ env.PROJECT_NAME }} artifacts/
# Zip artifacts for Windows
if [ "${{ matrix.os }}" == "windows-latest" ]; then
7z a artifacts.zip artifacts/
else
tar -czvf artifacts.tar.gz artifacts/
fi
shell: bash
- name: Upload Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.os }}
path: ./artifacts.*
env:
PROJECT_NAME: quicssh
release:
name: Release
runs-on: ubuntu-latest
needs: build
steps:
- name: Download artifacts
uses: actions/download-artifact@v2
- name: Release
uses: marvinpinto/action-automatic-releases@latest
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
automatic_release_tag: latest
prerelease: false
title: Release
files: |
*.zip
*.tar.gz