docs: add CHANGELOG #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: lint-test-release | |
on: | |
push: | |
branches: | |
- main | |
- "refs/tags/*" | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [ubuntu-latest, macos-latest] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Rust | |
uses: actions-rs/toolchain@v1 | |
with: | |
toolchain: stable | |
override: true | |
- name: Install dependencies | |
run: cargo fetch | |
- name: Check code formatting | |
run: cargo fmt -- --check | |
- name: Run lints | |
run: cargo clippy -- -D warnings | |
- name: Run tests | |
run: cargo test | |
- name: Build binary | |
run: cargo build --release | |
- name: Upload build artifact | |
uses: actions/upload-artifact@v3 | |
with: | |
name: tuni-${{ matrix.os }} | |
path: target/release/tuni | |
release: | |
runs-on: ubuntu-latest | |
needs: build | |
if: startsWith(github.ref, 'refs/tags/') | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Download build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: tuni-ubuntu-latest | |
path: ./artifacts/ubuntu | |
- name: Download build artifacts | |
uses: actions/download-artifact@v3 | |
with: | |
name: tuni-macos-latest | |
path: ./artifacts/macos | |
- name: Create GitHub Release | |
id: create_release | |
uses: actions/create-release@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
tag_name: ${{ github.ref_name }} | |
release_name: Release ${{ github.ref_name }} | |
draft: false | |
prerelease: false | |
- name: Upload Release Asset (Linux) | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./artifacts/ubuntu/tuni | |
asset_name: tuni-linux | |
asset_content_type: application/octet-stream | |
- name: Upload Release Asset (macOS) | |
uses: actions/upload-release-asset@v1 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
upload_url: ${{ steps.create_release.outputs.upload_url }} | |
asset_path: ./artifacts/macos/tuni | |
asset_name: tuni-macos | |
asset_content_type: application/octet-stream |