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

64 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
2023-04-05 13:05:15 +02:00
continue-on-error: false
2023-03-18 10:27:34 +01:00
with:
2023-04-05 13:05:15 +02:00
path: |
~/.cargo/registry
~/.cargo/git
key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }}
2023-03-18 10:27:34 +01:00
restore-keys: |
2023-04-05 13:05:15 +02:00
${{ runner.os }}-cargo-
2023-03-16 19:27:48 +01:00
- name: Build
2023-04-04 00:36:40 +02:00
run: make
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