-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
66 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
name: CD | ||
|
||
on: workflow_dispatch | ||
|
||
jobs: | ||
release: | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest, macos-latest, windows-latest] | ||
runs-on: ${{ matrix.os }} | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Get version | ||
id: get_version | ||
run: echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT | ||
|
||
- name: Restore cargo cache | ||
uses: Swatinem/rust-cache@v2 | ||
env: | ||
cache-name: ci | ||
with: | ||
shared-key: ${{ matrix.os }}-${{ env.cache-name }}-stable | ||
|
||
- name: Install Rust | ||
uses: dtolnay/rust-toolchain@stable | ||
with: | ||
components: clippy | ||
|
||
- name: Build | ||
run: cargo build | ||
|
||
|
||
- name: Setup MUSL | ||
if: matrix.os == 'ubuntu-latest' | ||
run: | | ||
rustup target add x86_64-unknown-linux-musl | ||
sudo apt-get -qq install musl-tools | ||
- name: Build Release Mac | ||
if: matrix.os == 'macos-latest' | ||
run: make release-mac | ||
- name: Build Release Linux | ||
if: matrix.os == 'ubuntu-latest' | ||
run: make release-linux-musl | ||
- name: Build Release Win | ||
if: matrix.os == 'windows-latest' | ||
run: make release-win | ||
- name: Build Release Linux ARM | ||
if: matrix.os == 'ubuntu-22.04' | ||
run: make release-linux-arm | ||
|
||
- name: Release | ||
uses: softprops/action-gh-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
body: ${{ steps.release_notes.outputs.release_notes }} | ||
prerelease: ${{ contains(github.ref, '-') }} | ||
files: | | ||
./release/*.tar.gz | ||
./release/*.zip | ||
./release/*.msi | ||