mirror of
https://github.com/MedzikUser/HomeDisk.git
synced 2024-08-14 21:46:53 +00:00
100 lines
2.4 KiB
YAML
100 lines
2.4 KiB
YAML
|
name: Build release binaries (and publish them if this is a tag)
|
||
|
|
||
|
on:
|
||
|
push:
|
||
|
|
||
|
# pull_request:
|
||
|
|
||
|
workflow_dispatch:
|
||
|
|
||
|
env:
|
||
|
CARGO_TERM_COLOR: always
|
||
|
|
||
|
jobs:
|
||
|
build-release:
|
||
|
uses: ./.github/workflows/build_releases.yml
|
||
|
|
||
|
clippy-and-tests:
|
||
|
strategy:
|
||
|
fail-fast: false
|
||
|
matrix:
|
||
|
os: [ubuntu-latest, windows-latest, macos-latest]
|
||
|
rust: [stable, nightly]
|
||
|
|
||
|
name: ${{ matrix.rust }} on ${{ matrix.os }}
|
||
|
runs-on: ${{ matrix.os }}
|
||
|
|
||
|
steps:
|
||
|
- name: Checkout
|
||
|
uses: actions/checkout@v3
|
||
|
|
||
|
- name: Setup Rust toolchain
|
||
|
id: rust-toolchain
|
||
|
uses: actions-rs/toolchain@v1
|
||
|
with:
|
||
|
profile: minimal
|
||
|
toolchain: ${{ matrix.rust }}
|
||
|
override: true
|
||
|
components: clippy
|
||
|
|
||
|
- name: Cache
|
||
|
uses: actions/cache@v3
|
||
|
id: cache
|
||
|
with:
|
||
|
path: |
|
||
|
~/.cargo/registry/cache/
|
||
|
target/
|
||
|
key: clippy-test-${{ runner.os }}-${{ matrix.rust }}-${{ steps.rust-toolchain.outputs.rustc_hash }}-${{ hashFiles('**/Cargo.lock') }}
|
||
|
|
||
|
- name: cargo clippy
|
||
|
uses: actions-rs/cargo@v1
|
||
|
with:
|
||
|
command: clippy
|
||
|
args: --no-deps -- -D warnings
|
||
|
|
||
|
- name: cargo test
|
||
|
uses: actions-rs/cargo@v1
|
||
|
with:
|
||
|
command: test
|
||
|
args: --all-features
|
||
|
|
||
|
upload-release:
|
||
|
runs-on: ubuntu-latest
|
||
|
needs: [build-release]
|
||
|
if: startsWith(github.ref, 'refs/tags/v')
|
||
|
|
||
|
steps:
|
||
|
- name: Download artifacts
|
||
|
uses: actions/download-artifact@v3
|
||
|
with:
|
||
|
path: ./
|
||
|
|
||
|
- name: Move artifacts
|
||
|
run: |
|
||
|
mkdir release
|
||
|
mv release-*/* release/
|
||
|
|
||
|
- name: Get tag name
|
||
|
id: tag_name
|
||
|
run: |
|
||
|
echo ::set-output name=current_version::${GITHUB_REF#refs/tags/v}
|
||
|
|
||
|
- name: Upload release files
|
||
|
uses: softprops/action-gh-release@17cd0d34deddf848fc0e7d9be5202c148c270a0a # 0.1.14
|
||
|
with:
|
||
|
token: ${{ secrets.GITHUB_TOKEN }}
|
||
|
prerelease: false
|
||
|
tag_name: ${{ github.ref }}
|
||
|
draft: true
|
||
|
fail_on_unmatched_files: true
|
||
|
name: ${{ github.ref }} Release
|
||
|
body: |
|
||
|
<!-- Write summary here -->
|
||
|
---
|
||
|
## Features
|
||
|
## Changes
|
||
|
## Bug Fixes
|
||
|
## Internal Changes
|
||
|
files: |
|
||
|
./release/*
|