-
Notifications
You must be signed in to change notification settings - Fork 159
49 lines (47 loc) · 1.75 KB
/
release.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: Release
on:
push:
tags:
- v*
jobs:
build:
name: Build
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- os: ubuntu-latest
file: forest-${{ github.ref_name }}-linux-amd64.zip
- os: macos-latest
file: forest-${{ github.ref_name }}-macos-amd64.zip
steps:
- name: Checkout Sources
uses: actions/checkout@v4
- name: Homebrew Utils
if: contains(matrix.os, 'macos')
run: |
brew install --verbose coreutils
- name: Rust Cache
uses: Swatinem/rust-cache@v2
timeout-minutes: 5
continue-on-error: true
- name: Cargo Build
run: cargo build --release --bin forest --bin forest-cli --bin forest-tool
- name: Compress Binary
run: |
mkdir -p forest-${{ github.ref_name }}
cp -v target/release/forest target/release/forest-cli target/release/forest-tool forest-${{ github.ref_name }}
cp -rv CHANGELOG.md LICENSE-APACHE LICENSE-MIT README.md documentation forest-${{ github.ref_name }}
sha256sum forest-${{ github.ref_name }}/forest > forest-${{ github.ref_name }}/forest.sha256
sha256sum forest-${{ github.ref_name }}/forest-cli > forest-${{ github.ref_name }}/forest-cli.sha256
sha256sum forest-${{ github.ref_name }}/forest-tool > forest-${{ github.ref_name }}/forest-tool.sha256
zip -r ${{ matrix.file }} forest-${{ github.ref_name }}
- name: Upload Binary
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ github.token }}
file: ${{ matrix.file }}
asset_name: ${{ matrix.file }}
tag: ${{ github.ref_name }}
overwrite: true
prerelease: true