Mirror von
https://github.com/Chaoscaot/schemsearch
synchronisiert 2024-11-15 00:10:13 +01:00
64 Zeilen
1.9 KiB
YAML
64 Zeilen
1.9 KiB
YAML
name: Release Build
|
|
|
|
on:
|
|
release:
|
|
types:
|
|
- published
|
|
|
|
env:
|
|
CARGO_TERM_COLOR: always
|
|
|
|
jobs:
|
|
build:
|
|
|
|
strategy:
|
|
matrix:
|
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
|
|
runs-on: ${{ matrix.os }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- name: Cache Cargo modules
|
|
id: cache-cargo
|
|
uses: actions/cache@v3
|
|
continue-on-error: false
|
|
with:
|
|
path: |
|
|
~/.cargo/registry
|
|
~/.cargo/git
|
|
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-cargo-
|
|
- name: Build
|
|
run: make
|
|
- name: Create Tarball
|
|
if: ${{ matrix.os != 'windows-latest' }}
|
|
run: tar -czvf schemsearch-cli-${{ matrix.os }}.tar.gz -C target/release schemsearch-cli
|
|
- name: upload linux/darwin artifact
|
|
if: ${{ matrix.os != 'windows-latest' }}
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
with:
|
|
upload_url: ${{ github.event.release.upload_url }}
|
|
asset_path: schemsearch-cli-${{ matrix.os }}.tar.gz
|
|
asset_name: schemsearch-cli-${{ matrix.os }}.tar.gz
|
|
asset_content_type: application/gzip
|
|
- uses: vimtor/action-zip@v1
|
|
name: Compress
|
|
if: ${{ matrix.os == 'windows-latest' }}
|
|
with:
|
|
files: target/release/schemsearch-cli.exe
|
|
dest: schemsearch-cli-${{ matrix.os }}.zip
|
|
- name: upload windows artifact
|
|
if: ${{ matrix.os == 'windows-latest' }}
|
|
uses: actions/upload-release-asset@v1
|
|
env:
|
|
GITHUB_TOKEN: ${{ github.token }}
|
|
with:
|
|
upload_url: ${{ github.event.release.upload_url }}
|
|
asset_path: schemsearch-cli-${{ matrix.os }}.zip
|
|
asset_name: schemsearch-cli-${{ matrix.os }}.zip
|
|
asset_content_type: application/zip
|