1
0
Mirror von https://github.com/Chaoscaot/schemsearch synchronisiert 2024-09-16 13:11:21 +02:00
schemsearch/.github/workflows/release-build.yml

63 Zeilen
1.9 KiB
YAML

2023-03-16 19:27:48 +01:00
name: Release Build
on:
release:
types:
- published
env:
CARGO_TERM_COLOR: always
jobs:
build:
2023-03-16 20:09:12 +01:00
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
2023-03-16 19:27:48 +01:00
steps:
- uses: actions/checkout@v3
2023-03-18 10:27:34 +01:00
- name: Cache Cargo modules
id: cache-cargo
uses: actions/cache@v3
env:
cache-name: cache-cargo-target-release
with:
path: target
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('**/Cargo.lock') }}
restore-keys: |
${{ runner.os }}-${{ env.cache-name }}-
2023-03-16 19:27:48 +01:00
- name: Build
2023-03-16 20:40:17 +01:00
run: cargo build --verbose --release -p schemsearch-cli
2023-03-16 19:27:48 +01:00
- name: Create Tarball
2023-03-16 20:09:12 +01:00
if: ${{ matrix.os != 'windows-latest' }}
2023-03-16 20:21:05 +01:00
run: tar -czvf schemsearch-cli-${{ matrix.os }}.tar.gz -C target/release schemsearch-cli
2023-03-16 20:09:12 +01:00
- name: upload linux/darwin artifact
if: ${{ matrix.os != 'windows-latest' }}
2023-03-16 19:27:48 +01:00
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ github.token }}
with:
2023-03-16 19:51:59 +01:00
upload_url: ${{ github.event.release.upload_url }}
2023-03-16 20:09:12 +01:00
asset_path: schemsearch-cli-${{ matrix.os }}.tar.gz
asset_name: schemsearch-cli-${{ matrix.os }}.tar.gz
2023-03-16 19:27:48 +01:00
asset_content_type: application/gzip
2023-03-16 20:09:12 +01:00
- 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 }}
2023-03-16 20:29:04 +01:00
asset_path: schemsearch-cli-${{ matrix.os }}.zip
2023-03-16 20:09:12 +01:00
asset_name: schemsearch-cli-${{ matrix.os }}.zip
asset_content_type: application/zip