Skip to content

Commit

Permalink
ci: add release job
Browse files Browse the repository at this point in the history
  • Loading branch information
Stef16Robbe committed Nov 5, 2024
1 parent 2c09c1e commit 9b202a4
Showing 1 changed file with 53 additions and 0 deletions.
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
# from: https://github.com/kriskw1999/ratatui-snake/blob/main/.github/workflows/release.yaml
name: Release
on:
push:
tags:
- v[0-9]+.*
jobs:
build:
permissions:
contents: write
continue-on-error: false
strategy:
matrix:
include:
- target: x86_64-unknown-linux-gnu
os: ubuntu-latest
- target: x86_64-unknown-linux-musl
os: ubuntu-latest
- target: aarch64-apple-darwin
os: macos-latest
- target: x86_64-apple-darwin
os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Install Target
uses: dtolnay/rust-toolchain@stable
with:
targets: ${{ matrix.target }}

- name: Install musl
if: matrix.target == 'x86_64-unknown-linux-musl'
run: |
sudo apt update
sudo apt install -y musl-tools gcc
- name: Build
run: cargo build --release --target ${{ matrix.target }}

- name: Strip Binary (linux)
if: matrix.target == 'x86_64-unknown-linux-gnu' || matrix.target == 'x86_64-unknown-linux-musl'
run: strip ./target/${{ matrix.target }}/release/kman

- name: Rename Binary (unix)
run: mv ./target/${{ matrix.target }}/release/kman ./kman-${{ matrix.target }}

- name: Upload Binary
uses: softprops/action-gh-release@v2
with:
files: "kman*"

0 comments on commit 9b202a4

Please sign in to comment.