Skip to content

docs: Enhance README.md #53

docs: Enhance README.md

docs: Enhance README.md #53

Workflow file for this run

name: Release
on:
push:
tags:
- 'v*.*.*'
jobs:
release:
strategy:
matrix:
config:
- { os: ubuntu-latest, target: 'x86_64-unknown-linux-gnu' }
- { os: ubuntu-latest, target: 'x86_64-unknown-linux-musl' }
- { os: ubuntu-latest, target: 'aarch64-unknown-linux-gnu' }
- { os: ubuntu-latest, target: 'aarch64-unknown-linux-musl' }
- { os: macos-latest, target: 'x86_64-apple-darwin' }
- { os: macos-latest, target: 'aarch64-apple-darwin' }
# - { os: windows-latest, target: 'x86_64-pc-windows-gnu' }
- { os: windows-latest, target: 'x86_64-pc-windows-msvc' }
runs-on: ${{ matrix.config.os }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Install dependencies for Ubuntu
if: matrix.config.os == 'ubuntu-latest'
run: |
sudo apt update
sudo apt install -y libssl-dev pkg-config build-essential
- name: Setup Rust
uses: dtolnay/rust-toolchain@stable
with:
toolchain: stable
target: ${{ matrix.config.target }}
- name: Build with cross
run: |
cargo install cross
cross build --release --target ${{ matrix.config.target }}
- name: Upload binary
uses: actions/upload-artifact@v3
with:
name: ${{ matrix.config.target }}
path: |
if: matrix.config.os == 'ubuntu-latest' || matrix.config.os == 'macos-latest'
target/${{ matrix.config.target }}/release/jobcan
if: matrix.config.os == 'windows-latest'
target/${{ matrix.config.target }}/release/jobcan.exe
- name: Compress binary for ubuntu and macos
if: matrix.config.os == 'ubuntu-latest' || matrix.config.os == 'macos-latest'
run: |
cd target/${{ matrix.config.target }}/release
tar -czf jobcan-${{ matrix.config.target }}.tar.gz jobcan
- name: Compress binary for windows
if: matrix.config.os == 'windows-latest'
run: |
cd target/${{ matrix.config.target }}/release
Compress-Archive -Path jobcan.exe -Destination jobcan-${{ matrix.config.target }}.zip
- name: Create release draft
uses: softprops/action-gh-release@v1
with:
files: |
target/${{ matrix.config.target }}/release/jobcan-${{ matrix.config.target }}.tar.gz
target/${{ matrix.config.target }}/release/jobcan-${{ matrix.config.target }}.zip
draft: true
token: ${{ secrets.TOKEN_FOR_RELEASE }}
generate_release_notes: true
fail_on_unmatched_files: false